Introduce gradle-plugin and mod-tools modules. Add ZomboidForge Gradle plugin for building, checking, and packaging mods. Include support for local test servers, automated game jar downloads, and mod descriptor generation. Add mod-tools for runtime mod checks and validations.

This commit is contained in:
Overlord committed 2026-10-02 15:36:10 +02:00
1 parent 68cd9fc4f9
commit 063ad8a3e1
27 files changed
+1976 -30

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
// 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)
}