43 lines
1.6 KiB
Kotlin
43 lines
1.6 KiB
Kotlin
// 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 }
|
|
}
|
|
}
|
|
}
|