Add mod setup tools and project initialization support.

This commit is contained in:
Overlord committed 2026-10-10 19:16:56 +02:00
1 parent a5766f3a1b
commit 32fab0c1d4
9 files changed
+684 -55

No files matched your search

+23 -5
View File
@@ -1,6 +1,7 @@
// 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).
// Gradle plugins for mod authors (ids dev.overlord.zomboidforge for settings.gradle.kts and
// 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")
@@ -20,6 +21,13 @@ gradlePlugin {
displayName = "ZomboidForge mod"
description = "Builds, checks, and packages server-side Java mods for ZomboidForge."
}
create("settings") {
id = "dev.overlord.zomboidforge"
implementationClass = "dev.overlord.zomboidforge.gradle.ZomboidForgeSettingsPlugin"
displayName = "ZomboidForge mod project"
description = "Makes a ZomboidForge mod project a single settings.gradle.kts."
}
}
}
@@ -38,9 +46,19 @@ dependencies {
}
tasks.test {
// The functional tests resolve api and mod-tools from the repository in build/repo.
dependsOn(":api:publishAllPublicationsToBuildRepository", ":mod-tools:publishAllPublicationsToBuildRepository")
// The functional tests resolve api and mod-tools from the repository in build/repo, the
// updater tests the plugin as well.
dependsOn(
":api:publishAllPublicationsToBuildRepository",
":mod-tools:publishAllPublicationsToBuildRepository",
"publishAllPublicationsToBuildRepository",
)
val repository = layout.settingsDirectory.dir("build/repo").asFile.absolutePath
systemProperty("zomboidforge.testRepository", repository)
// The updater tests run zomboidforge.jsh with the wrapper of the repository root.
val root = layout.settingsDirectory.asFile.absolutePath
inputs.file(layout.settingsDirectory.file("zomboidforge.jsh"))
systemProperty("zomboidforge.root", root)
}