Files
AstraPlusEditor/build.gradle.kts
T

74 lines
3.7 KiB
Kotlin
Raw Normal View History

plugins {
java
id("net.neoforged.moddev") version "2.0.146"
}
group = "online.astradev"
version = "0.3.7"
repositories { mavenCentral() }
dependencies {
testImplementation("com.google.code.gson:gson:2.14.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.11.4")
}
neoForge {
version = "26.2.0.75"
mods { create("astrapluseditor") { sourceSet(sourceSets.main.get()) } }
}
java { toolchain.languageVersion.set(JavaLanguageVersion.of(25)) }
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(25)
}
tasks.processResources {
inputs.property("modVersion", project.version)
filesMatching("META-INF/neoforge.mods.toml") { expand("version" to project.version) }
}
tasks.test { useJUnitPlatform() }
val verification = sourceSets.create("verification") {
compileClasspath += sourceSets.main.get().output + sourceSets.main.get().compileClasspath
runtimeClasspath += output + compileClasspath + sourceSets.main.get().runtimeClasspath
}
val compatibility = sourceSets.create("compatibility") {
compileClasspath += sourceSets.main.get().compileClasspath
runtimeClasspath += output + compileClasspath + sourceSets.main.get().runtimeClasspath
}
neoForge {
mods {
create("astrapluseditor_verify") { sourceSet(verification) }
create("astrapluseditor_compat") { sourceSet(compatibility) }
}
runs {
create("verificationClient") {
client()
sourceSet.set(verification)
loadedMods.set(setOf(mods.getByName("astrapluseditor"), mods.getByName("astrapluseditor_verify")))
gameDirectory.set(layout.buildDirectory.dir("isolated-editor"))
systemProperty("astrapluseditor.isolatedVerification", "true")
systemProperty("astrapluseditor.mobGroupsVerification", providers.gradleProperty("mobGroupsVerification").orElse("false").get())
systemProperty("astrapluseditor.recipeVerification", providers.gradleProperty("recipeVerification").orElse("false").get())
systemProperty("astrapluseditor.enchantmentVerification", providers.gradleProperty("enchantmentVerification").orElse("false").get())
systemProperty("astrapluseditor.networkVerification", providers.gradleProperty("networkVerification").orElse("false").get())
systemProperty("astrapluseditor.mobTransportVerification", providers.gradleProperty("mobTransportVerification").orElse("false").get())
systemProperty("astrapluseditor.iconVerification", providers.gradleProperty("iconVerification").orElse("false").get())
systemProperty("astrapluseditor.iconVerificationPort", providers.gradleProperty("iconVerificationPort").orElse("26702").get())
systemProperty("astrapluseditor.translationPack", providers.gradleProperty("translationPack")
.orElse(layout.buildDirectory.file("icon-server/astraplus/output/AstraPlus.zip").map { it.asFile.absolutePath }).get())
programArgument("--width"); programArgument("1280")
programArgument("--height"); programArgument("720")
programArgument("--username"); programArgument("AstraEditVerify")
}
create("compatibilityClient") {
client()
sourceSet.set(compatibility)
loadedMods.set(setOf(mods.getByName("astrapluseditor_compat")))
gameDirectory.set(layout.buildDirectory.dir("isolated-noeditor"))
systemProperty("astrapluseditor.isolatedVerification", "true")
programArgument("--width"); programArgument("960")
programArgument("--height"); programArgument("540")
programArgument("--username"); programArgument("AstraGuest")
}
}
}