65 lines
1.6 KiB
Plaintext
65 lines
1.6 KiB
Plaintext
|
|
|
|
subprojects {
|
|
apply(plugin = "java")
|
|
apply(plugin = "idea")
|
|
tasks.withType<AbstractArchiveTask>().configureEach() {
|
|
destinationDirectory.set(
|
|
rootProject.projectDir.resolve("mod_build")
|
|
)
|
|
}
|
|
tasks.named("jar") {
|
|
enabled = false
|
|
}
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
options.release.set(17)
|
|
}
|
|
}
|
|
tasks.withType<JavaExec> {
|
|
jvmArgs = listOf(
|
|
"-Dfile.encoding=UTF-8",
|
|
"-Dsun.stdout.encoding=UTF-8",
|
|
"-Dsun.stderr.encoding=UTF-8"
|
|
)
|
|
}
|
|
tasks.withType<JavaCompile> {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
val loaders = listOf("Fabric", "Forge", "NeoForge")
|
|
val mod_minecrat_versions: String by project
|
|
|
|
val modVersions = mod_minecrat_versions.split(",")
|
|
|
|
modVersions.forEach {
|
|
tasks.register("build_$it") {
|
|
group = "mod_${it}"
|
|
dependsOn(":modsrc:${it}:shadowJar")
|
|
}
|
|
loaders.forEach { ti ->
|
|
run {
|
|
if (findProject(":modsrc:$it:$ti") != null) {
|
|
println("$it:$ti")
|
|
tasks.register("${ti}RunServer_$it") {
|
|
group = "mod_$it"
|
|
dependsOn(":modsrc:$it:$ti:runServer")
|
|
}
|
|
tasks.register("${ti}RunClient_$it") {
|
|
group = "mod_$it"
|
|
dependsOn(":modsrc:$it:$ti:runClient")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.register("cleanAll", Delete::class) {
|
|
subprojects.forEach{
|
|
val task = it.tasks.findByName("clean")
|
|
if (task != null){
|
|
dependsOn(task)
|
|
}
|
|
}
|
|
group = "build"
|
|
delete("mod_build")
|
|
}
|