79 lines
1.9 KiB
Kotlin
79 lines
1.9 KiB
Kotlin
plugins {
|
|
id("fabric-loom") version "1.15.4"
|
|
id("maven-publish")
|
|
}
|
|
|
|
val minecraftVersion = property("minecraft_version") as String
|
|
val loaderVersion = property("loader_version") as String
|
|
val fabricApiVersion = property("fabric_api_version") as String
|
|
|
|
version = rootProject.version
|
|
group = property("maven_group")!!
|
|
|
|
base {
|
|
archivesName.set("anarchymod-${project.name}")
|
|
}
|
|
|
|
repositories {
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
resources.srcDir(project(":common").sourceSets["main"].resources.srcDirs)
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
minecraft("com.mojang:minecraft:$minecraftVersion")
|
|
mappings(loom.officialMojangMappings())
|
|
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
|
|
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
|
|
implementation(project(":common"))
|
|
}
|
|
|
|
tasks.named<Jar>("jar") {
|
|
dependsOn(project(":common").tasks.named("classes"))
|
|
from(project(":common").sourceSets["main"].output)
|
|
}
|
|
|
|
tasks.processResources {
|
|
inputs.property("version", project.version)
|
|
inputs.property("minecraft_version", minecraftVersion)
|
|
inputs.property("loader_version", loaderVersion)
|
|
filteringCharset = "UTF-8"
|
|
|
|
filesMatching("fabric.mod.json") {
|
|
expand(
|
|
"version" to project.version,
|
|
"minecraft_version" to minecraftVersion,
|
|
"loader_version" to loaderVersion,
|
|
"fabric_api_version" to fabricApiVersion
|
|
)
|
|
}
|
|
}
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
options.encoding = "UTF-8"
|
|
options.release.set(21)
|
|
}
|
|
|
|
java {
|
|
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
|
withSourcesJar()
|
|
}
|
|
|
|
tasks.jar {
|
|
from("LICENSE") {
|
|
rename { "${it}_${base.archivesName.get()}" }
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
create<MavenPublication>("mavenJava") {
|
|
artifactId = base.archivesName.get()
|
|
from(components["java"])
|
|
}
|
|
}
|
|
}
|