47 lines
1.6 KiB
Kotlin
47 lines
1.6 KiB
Kotlin
// Gradle plugin for mod authors (id dev.overlord.zomboidforge.mod): dependencies, mod.toml,
|
|
// build-time checks, packaging, and a local test server. Runs inside the mod's Gradle JVM, so
|
|
// it targets Java 17; the checks run in a separate Java 25 process (mod-tools).
|
|
|
|
plugins {
|
|
id("zomboidforge.java-conventions")
|
|
id("zomboidforge.publishing")
|
|
`java-gradle-plugin`
|
|
}
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
options.release = 17
|
|
}
|
|
|
|
gradlePlugin {
|
|
plugins {
|
|
create("mod") {
|
|
id = "dev.overlord.zomboidforge.mod"
|
|
implementationClass = "dev.overlord.zomboidforge.gradle.ZomboidForgeModPlugin"
|
|
displayName = "ZomboidForge mod"
|
|
description = "Builds, checks, and packages server-side Java mods for ZomboidForge."
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.processResources {
|
|
// The plugin resolves api and mod-tools in its own version.
|
|
val pluginVersion = project.version.toString()
|
|
inputs.property("version", pluginVersion)
|
|
filesMatching("**/plugin.properties") { expand("version" to pluginVersion) }
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation(libs.bundles.asm)
|
|
testImplementation(platform(libs.junit.bom))
|
|
testImplementation(libs.junit.jupiter)
|
|
testRuntimeOnly(libs.junit.platform.launcher)
|
|
}
|
|
|
|
tasks.test {
|
|
// The functional tests resolve api and mod-tools from the repository in build/repo.
|
|
dependsOn(":api:publishAllPublicationsToBuildRepository", ":mod-tools:publishAllPublicationsToBuildRepository")
|
|
|
|
val repository = layout.settingsDirectory.dir("build/repo").asFile.absolutePath
|
|
systemProperty("zomboidforge.testRepository", repository)
|
|
}
|