even-more-bountiful/build.gradle
2023-09-29 04:25:25 -06:00

114 lines
3.8 KiB
Groovy

plugins {
id "fabric-loom" version "1.3-SNAPSHOT"
id "legacy-looming" version "1.3-SNAPSHOT" // Version must be the same as fabric-loom's
id "maven-publish"
id 'io.github.juuxel.loom-vineflower' version "1.11.0"
id "com.modrinth.minotaur" version "2.+"
}
version = project.mod_version
group = project.maven_group
projchangelog = project.projchangelog
repositories {}
loom {
accessWidenerPath = file("src/main/resources/emb.accesswidener")
// Only needed for versions not available from vanilla launcher by default.
// customMinecraftManifest.set("https://meta.legacyfabric.net/v2/manifest/${minecraft_version}")
// Required by 1.7.x
runs {
client {
programArgs "--userProperties", "{}"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings(legacy.yarn(project.minecraft_version, project.yarn_build))
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API provides hooks for events, item registration, and more. As most mods will need this, it's included by default.
// If you know for a fact you don't, it's not required and can be safely removed.
modImplementation "net.legacyfabric.legacy-fabric-api:legacy-fabric-api:${project.fabric_version}"
// You can retrieve a specific api module using this notation.
// modImplementation(legacy.apiModule("legacy-fabric-item-groups-v1", project.fabric_version))
}
base {
archivesName = project.archives_base_name
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// Ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) it.options.release = 8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${base.archivesName.get()}" }
}
}
//modrinth
import com.modrinth.minotaur.dependencies.ModDependency
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)
modrinth {
token = System.getenv("MODRINTH_TOKEN") // Please use an environment variable for this! The default is `$MODRINTH_TOKEN`.
projectId = "even-more-bountiful" // The ID of your Modrinth project. Slugs will not work.
versionNumber = version // The (preferably SemVer) version of the mod. If not specified, it'll use the `version` declaration
versionType = "alpha" // This is the default -- can also be `beta` or `alpha`
uploadFile = remapJar // Tells Minotaur to use the remapped jar
gameVersions = ["1.7.10"] // An array of game versions the version supports
loaders = ["fabric"] // Self-explanatory.
changelog = projchangelog
dependencies { // A special DSL for creating dependencies
// scope.type
// The scope can be `required`, `optional`, `incompatible`, or `embedded`
// The type can either be `project` or `version`
required.project "legacy-fabric-api" // Creates a new required dependency on Fabric API
// optional.project "legacy-modmenu"//, "modmenu version" // Creates a new optional dependency on this specific version of Sodium
}
syncBodyFrom = rootProject.file("README.md").text
}
// Configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// Select the repositories you want to publish to
repositories {
// Uncomment to publish to the local maven
// mavenLocal()
}
}