Files
AstraContent/build.gradle.kts
T

61 lines
2.1 KiB
Kotlin
Raw Normal View History

plugins {
java
id("net.neoforged.moddev") version "2.0.146"
}
group = "online.astradev"
version = "0.2.4"
repositories { mavenCentral() }
2026-09-19 16:32:25 +03:00
val astraPlusApi = providers.gradleProperty("astraPlusApi")
.orElse("../AstraPlus/build/libs/AstraPlus-0.9.9-api.jar")
2026-09-19 16:32:25 +03:00
val astraPlusRuntime = providers.gradleProperty("astraPlusRuntime")
.orElse("../AstraPlus/build/libs/AstraPlus-0.9.9.jar")
dependencies {
2026-09-19 16:32:25 +03:00
compileOnly(files(astraPlusApi))
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))
}
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 {
includeEmptyDirs = false
inputs.property("modVersion", project.version)
filesMatching("META-INF/neoforge.mods.toml") { expand("version" to project.version) }
}
tasks.test {
useJUnitPlatform()
workingDir = layout.buildDirectory.dir("test-runtime").get().asFile
doFirst { workingDir.mkdirs() }
}
tasks.withType<Jar>().configureEach { includeEmptyDirs = false }
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
2026-09-19 16:32:25 +03:00
compileClasspath += files(astraPlusRuntime)
runtimeClasspath += output + compileClasspath
}
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")
}