80 lines
2.0 KiB
Kotlin
80 lines
2.0 KiB
Kotlin
plugins {
|
|
id("net.fabricmc.fabric-loom-remap") version "1.17.7"
|
|
id("maven-publish")
|
|
}
|
|
|
|
val minecraftVersion = stonecutter.current.project
|
|
val loaderVersion = property("loader_version") as String
|
|
val fabricApiVersion = property("fabric_api_version") as String
|
|
val javaVersion = (property("java_version") as String).toInt()
|
|
|
|
version = property("mod_version")!!
|
|
group = property("maven_group")!!
|
|
|
|
base {
|
|
archivesName.set("anarchymod-mc-${minecraftVersion}")
|
|
}
|
|
|
|
dependencies {
|
|
minecraft("com.mojang:minecraft:$minecraftVersion")
|
|
mappings(loom.officialMojangMappings())
|
|
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
|
|
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
|
|
implementation("com.google.code.gson:gson:2.14.0")
|
|
}
|
|
|
|
loom {
|
|
runConfigs.all {
|
|
ideConfigGenerated(true)
|
|
runDir = "../../run"
|
|
}
|
|
}
|
|
|
|
tasks.processResources {
|
|
inputs.property("version", project.version)
|
|
inputs.property("minecraft_version", minecraftVersion)
|
|
inputs.property("loader_version", loaderVersion)
|
|
inputs.property("java_version", javaVersion)
|
|
filteringCharset = "UTF-8"
|
|
|
|
filesMatching("fabric.mod.json") {
|
|
expand(
|
|
"version" to project.version,
|
|
"minecraft_version" to minecraftVersion,
|
|
"loader_version" to loaderVersion,
|
|
"java_version" to javaVersion
|
|
)
|
|
}
|
|
|
|
filesMatching("anarchymod.mixins.json") {
|
|
expand(
|
|
"java_version" to javaVersion
|
|
)
|
|
}
|
|
}
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
options.encoding = "UTF-8"
|
|
options.release.set(javaVersion)
|
|
}
|
|
|
|
java {
|
|
toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion))
|
|
withSourcesJar()
|
|
}
|
|
|
|
tasks.jar {
|
|
from("LICENSE") {
|
|
rename { "${it}_${base.archivesName.get()}" }
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
create<MavenPublication>("mavenJava") {
|
|
artifactId = base.archivesName.get()
|
|
from(components["java"])
|
|
}
|
|
}
|
|
}
|