51 lines
1.9 KiB
Kotlin
51 lines
1.9 KiB
Kotlin
plugins {
|
|
id("dev.overlord.zomboidforge.mod") version "0.4.0" // the plugin's version is the ZomboidForge API version
|
|
}
|
|
|
|
version = "0.1.0"
|
|
|
|
zomboidForge {
|
|
id = "lua_mod_automator"
|
|
name = "LuaModAutomator"
|
|
entrypoint = "dev.overlord.luamodautomator.LuaModAutomatorMod"
|
|
game("42") // ServerOptions, GameServer, CommandBase
|
|
serverImage = "git.security-command.org/overlord/zomboidforge:0.4.0-pz42.21"
|
|
}
|
|
|
|
dependencies {
|
|
implementation("com.google.code.gson:gson:2.13.2") // bundled into the mod's lib/
|
|
|
|
compileOnly("org.jetbrains:annotations:26.0.2")
|
|
testCompileOnly("org.jetbrains:annotations:26.0.2")
|
|
|
|
// ZomboidForge's config.toml parser and binder, to bind the settings the way the server does.
|
|
testImplementation("dev.overlord.zomboidforge:mod-tools:0.4.0")
|
|
|
|
testImplementation(platform("org.junit:junit-bom:6.1.3"))
|
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
}
|
|
|
|
// Gson's Error Prone annotations matter only to the compiler; lib/ is the runtime classpath.
|
|
configurations.runtimeClasspath {
|
|
exclude(group = "com.google.errorprone")
|
|
}
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
options.encoding = "UTF-8"
|
|
options.compilerArgs.addAll(listOf("-Xlint:all", "-Xlint:-options", "-Xlint:-path"))
|
|
}
|
|
|
|
tasks.test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
// Prints what the server would set for a config.toml: ./gradlew -q resolveCollection --args=<config.toml>
|
|
tasks.register<JavaExec>("resolveCollection") {
|
|
group = "zomboidforge"
|
|
description = "Resolves the collection of a config.toml like the server does at startup and prints Mods=, WorkshopItems=, and Map=."
|
|
classpath = sourceSets.test.get().runtimeClasspath
|
|
mainClass = "dev.overlord.luamodautomator.ResolveCollection"
|
|
workingDir = File(System.getProperty("user.dir"))
|
|
}
|