Files
ZomboidForge/api/build.gradle.kts

42 lines
1.1 KiB
Kotlin

// API for custom Java mods. Version-independent: no references to game classes.
// Published as dev.overlord.zomboidforge:api; mods compile against it.
plugins {
id("zomboidforge.java-conventions")
id("zomboidforge.publishing")
`java-library`
}
java {
withSourcesJar()
withJavadocJar()
}
tasks.javadoc {
// api.internal connects the API to the runtime and is not part of the documented API.
exclude("dev/overlord/zomboidforge/api/internal/**")
(options as StandardJavadocDocletOptions).apply {
// IntelliJ's @noinspection in package-info.java is not a Javadoc tag.
tags("noinspection:X")
addStringOption("Xdoclint:all,-missing", "-quiet")
}
}
publishing {
publications {
create<MavenPublication>("api") {
from(components["java"])
}
}
}
dependencies {
// Published as a compile-time dependency, so mods see the API's annotations; never in their lib/.
compileOnlyApi(libs.jetbrains.annotations)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.platform.launcher)
}