67 lines
2.8 KiB
Kotlin
67 lines
2.8 KiB
Kotlin
plugins {
|
|
java
|
|
id("net.neoforged.moddev") version "2.0.146"
|
|
}
|
|
|
|
group = "online.astradev"
|
|
version = "0.3.0"
|
|
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.79"
|
|
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.networkVerification", providers.gradleProperty("networkVerification").orElse("false").get())
|
|
systemProperty("astrapluseditor.mobTransportVerification", providers.gradleProperty("mobTransportVerification").orElse("false").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")
|
|
}
|
|
}
|
|
}
|