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:
1 parent
68cd9fc4f9
commit
063ad8a3e1
27 files changed
+1976
-30
No files matched your search
@@ -0,0 +1,42 @@
|
||||
// Build-time checks for mods, run by the ZomboidForge Gradle plugin in a separate Java 25
|
||||
// process. Published as one self-contained jar (dev.overlord.zomboidforge:mod-tools) without
|
||||
// dependencies, so a mod's build only needs the ZomboidForge Maven repository.
|
||||
|
||||
plugins {
|
||||
id("zomboidforge.java-conventions")
|
||||
id("zomboidforge.publishing")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":api"))
|
||||
implementation(project(":core"))
|
||||
implementation(project(":patcher"))
|
||||
implementation(libs.bundles.asm)
|
||||
|
||||
testImplementation(platform(libs.junit.bom))
|
||||
testImplementation(libs.junit.jupiter)
|
||||
testRuntimeOnly(libs.junit.platform.launcher)
|
||||
}
|
||||
|
||||
val toolJar = tasks.register<Jar>("toolJar") {
|
||||
description = "The mod tools with every runtime dependency, for publishing."
|
||||
archiveBaseName = "mod-tools"
|
||||
archiveClassifier = "all"
|
||||
manifest.attributes("Main-Class" to "dev.overlord.zomboidforge.tools.ModCheck")
|
||||
|
||||
from(sourceSets.main.map { it.output })
|
||||
// Mapping the classpath to zip trees loses its task dependencies; the input restores them.
|
||||
inputs.files(configurations.runtimeClasspath)
|
||||
from(configurations.runtimeClasspath.map { classpath -> classpath.map { zipTree(it) } })
|
||||
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "META-INF/versions/*/module-info.class", "module-info.class")
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("modTools") {
|
||||
artifactId = "mod-tools"
|
||||
artifact(toolJar) { classifier = null }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user