Simplify train and rail logic and consolidate integration tests

This commit is contained in:
2026-09-13 21:55:44 +03:00
parent c39e91d836
commit 2c651a12fc
46 changed files with 2660 additions and 1233 deletions
+32 -8
View File
@@ -1,6 +1,9 @@
plugins { java; id("net.neoforged.moddev") version "2.0.146" }
plugins {
java
id("net.neoforged.moddev") version "2.0.146"
}
group = "online.astradev"
version = "0.2.1"
version = "0.2.2"
repositories { mavenCentral() }
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
@@ -10,13 +13,34 @@ neoForge {
version = "26.2.0.79"
mods { create("astracontent") { sourceSet(sourceSets.main.get()) } }
}
java { toolchain.languageVersion.set(JavaLanguageVersion.of(25)); withSourcesJar() }
tasks.withType<JavaCompile>().configureEach { options.encoding = "UTF-8"; options.release.set(25) }
tasks.processResources { filesMatching("META-INF/neoforge.mods.toml") { expand("version" to project.version) } }
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
withSourcesJar()
}
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() }
sourceSets.test { compileClasspath += sourceSets.main.get().compileClasspath; runtimeClasspath += sourceSets.main.get().compileClasspath }
val verification = sourceSets.create("verification") {
sourceSets.test {
compileClasspath += sourceSets.main.get().compileClasspath
runtimeClasspath += sourceSets.main.get().compileClasspath
}
val integrationTest = sourceSets.create("integrationTest") {
compileClasspath += sourceSets.main.get().output + sourceSets.main.get().compileClasspath
runtimeClasspath += output + compileClasspath
}
tasks.register<Jar>("verificationJar") { from(verification.output); archiveClassifier.set("verification") }
tasks.register<Jar>("integrationTestJar") {
from(integrationTest.output)
archiveClassifier.set("integration-tests")
}
tasks.register<Exec>("integrationTest") {
dependsOn("build", "integrationTestJar")
commandLine("pwsh", "-NoProfile", "-File", "src/integrationTest/run.ps1")
if (providers.gradleProperty("experimental").isPresent) args("-Experimental")
}