2026-09-13 21:55:44 +03:00
|
|
|
plugins {
|
|
|
|
|
java
|
|
|
|
|
id("net.neoforged.moddev") version "2.0.146"
|
|
|
|
|
}
|
2026-09-13 09:16:42 +03:00
|
|
|
group = "online.astradev"
|
2026-09-24 20:43:20 +03:00
|
|
|
version = "0.2.6"
|
2026-09-13 09:16:42 +03:00
|
|
|
repositories { mavenCentral() }
|
2026-09-19 16:32:25 +03:00
|
|
|
val astraPlusApi = providers.gradleProperty("astraPlusApi")
|
2026-09-24 20:43:20 +03:00
|
|
|
.orElse("../AstraPlus/build/libs/AstraPlus-0.9.13-api.jar")
|
2026-09-19 16:32:25 +03:00
|
|
|
val astraPlusRuntime = providers.gradleProperty("astraPlusRuntime")
|
2026-09-24 20:43:20 +03:00
|
|
|
.orElse("../AstraPlus/build/libs/AstraPlus-0.9.13.jar")
|
2026-09-13 09:16:42 +03:00
|
|
|
dependencies {
|
2026-09-19 16:32:25 +03:00
|
|
|
compileOnly(files(astraPlusApi))
|
2026-09-13 09:16:42 +03:00
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
|
|
|
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.11.4")
|
2026-09-19 16:32:25 +03:00
|
|
|
testRuntimeOnly(files(astraPlusRuntime))
|
2026-09-13 09:16:42 +03:00
|
|
|
}
|
|
|
|
|
neoForge {
|
|
|
|
|
version = "26.2.0.79"
|
|
|
|
|
mods { create("astracontent") { sourceSet(sourceSets.main.get()) } }
|
|
|
|
|
}
|
2026-09-13 21:55:44 +03:00
|
|
|
java {
|
|
|
|
|
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
|
|
|
|
|
withSourcesJar()
|
|
|
|
|
}
|
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
|
|
|
options.encoding = "UTF-8"
|
|
|
|
|
options.release.set(25)
|
|
|
|
|
}
|
|
|
|
|
tasks.processResources {
|
2026-09-13 23:17:48 +03:00
|
|
|
includeEmptyDirs = false
|
2026-09-13 21:55:44 +03:00
|
|
|
inputs.property("modVersion", project.version)
|
|
|
|
|
filesMatching("META-INF/neoforge.mods.toml") { expand("version" to project.version) }
|
|
|
|
|
}
|
2026-09-13 23:17:48 +03:00
|
|
|
tasks.test {
|
|
|
|
|
useJUnitPlatform()
|
|
|
|
|
workingDir = layout.buildDirectory.dir("test-runtime").get().asFile
|
|
|
|
|
doFirst { workingDir.mkdirs() }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.withType<Jar>().configureEach { includeEmptyDirs = false }
|
2026-09-13 21:55:44 +03:00
|
|
|
sourceSets.test {
|
2026-09-20 07:24:54 +03:00
|
|
|
java.srcDir("src/verificationSupport/java")
|
2026-09-13 21:55:44 +03:00
|
|
|
compileClasspath += sourceSets.main.get().compileClasspath
|
|
|
|
|
runtimeClasspath += sourceSets.main.get().compileClasspath
|
|
|
|
|
}
|
|
|
|
|
val integrationTest = sourceSets.create("integrationTest") {
|
2026-09-20 07:24:54 +03:00
|
|
|
java.srcDir("src/verificationSupport/java")
|
2026-09-13 09:16:42 +03:00
|
|
|
compileClasspath += sourceSets.main.get().output + sourceSets.main.get().compileClasspath
|
2026-09-19 16:32:25 +03:00
|
|
|
compileClasspath += files(astraPlusRuntime)
|
2026-09-13 09:16:42 +03:00
|
|
|
runtimeClasspath += output + compileClasspath
|
|
|
|
|
}
|
2026-09-13 21:55:44 +03:00
|
|
|
tasks.register<Jar>("integrationTestJar") {
|
|
|
|
|
from(integrationTest.output)
|
2026-09-20 07:24:54 +03:00
|
|
|
from("src/main/resources") { include("content/astracontent/legacy-rails.json") }
|
2026-09-13 21:55:44 +03:00
|
|
|
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")
|
2026-09-24 20:43:20 +03:00
|
|
|
providers.gradleProperty("upgradeFrom").orNull?.let { args("-UpgradeFrom", it) }
|
|
|
|
|
providers.gradleProperty("astraPlusRuntime").orNull?.let { args("-PlusJar", it) }
|
2026-09-13 21:55:44 +03:00
|
|
|
}
|
2026-09-24 19:56:28 +03:00
|
|
|
|
|
|
|
|
tasks.register<Exec>("compatibilityTest") {
|
|
|
|
|
commandLine("pwsh", "-NoProfile", "-File", "src/integrationTest/compatibility.ps1")
|
|
|
|
|
providers.gradleProperty("oldContentJar").orNull?.let { args("-OldContentJar", it) }
|
|
|
|
|
providers.gradleProperty("astraPlusRuntime").orNull?.let { args("-PlusJar", it) }
|
|
|
|
|
}
|