2021-06-07 14:17:39 +02:00
|
|
|
import org.apache.tools.ant.filters.ReplaceTokens
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("java")
|
|
|
|
id("net.kyori.indra")
|
|
|
|
id("net.kyori.indra.checkstyle")
|
|
|
|
id("net.kyori.indra.publishing")
|
|
|
|
}
|
|
|
|
|
2021-06-09 00:36:43 +02:00
|
|
|
val baseExtension = extensions.create<EssentialsBaseExtension>("essentials", project)
|
|
|
|
|
2021-06-07 14:17:39 +02:00
|
|
|
val checkstyleVersion = "8.36.2"
|
2023-09-23 00:38:57 +02:00
|
|
|
val spigotVersion = "1.20.2-R0.1-SNAPSHOT"
|
2021-06-07 14:17:39 +02:00
|
|
|
val junit5Version = "5.7.0"
|
|
|
|
val mockitoVersion = "3.2.0"
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
testImplementation("org.junit.jupiter", "junit-jupiter", junit5Version)
|
|
|
|
testImplementation("org.junit.vintage", "junit-vintage-engine", junit5Version)
|
|
|
|
testImplementation("org.mockito", "mockito-core", mockitoVersion)
|
|
|
|
|
2021-06-09 00:36:43 +02:00
|
|
|
constraints {
|
|
|
|
implementation("org.yaml:snakeyaml:1.28") {
|
|
|
|
because("Bukkit API ships old versions, Configurate requires modern versions")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
if (baseExtension.injectBukkitApi.get()) {
|
|
|
|
dependencies {
|
|
|
|
api("org.spigotmc", "spigot-api", spigotVersion)
|
2021-06-07 14:49:33 +02:00
|
|
|
}
|
2021-06-07 14:17:39 +02:00
|
|
|
}
|
2021-08-02 14:21:53 +02:00
|
|
|
if (baseExtension.injectBstats.get()) {
|
|
|
|
dependencies {
|
|
|
|
implementation("org.bstats", "bstats-bukkit", "1.8")
|
|
|
|
}
|
|
|
|
}
|
2021-06-07 14:17:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
|
|
|
// Version Injection
|
|
|
|
processResources {
|
|
|
|
// Always process resources if version string or git branch changes
|
|
|
|
val fullVersion = rootProject.ext["FULL_VERSION"] as String
|
|
|
|
val gitBranch = rootProject.ext["GIT_BRANCH"] as String
|
|
|
|
inputs.property("fullVersion", fullVersion)
|
|
|
|
inputs.property("gitBranch", gitBranch)
|
|
|
|
filter<ReplaceTokens>(
|
|
|
|
"beginToken" to "\${",
|
|
|
|
"endToken" to "}",
|
|
|
|
"tokens" to mapOf(
|
|
|
|
"full.version" to fullVersion,
|
|
|
|
"git.branch" to gitBranch
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
compileJava {
|
|
|
|
options.compilerArgs.add("-Xlint:-deprecation")
|
|
|
|
}
|
|
|
|
javadoc {
|
|
|
|
title = "${project.name} API (v${rootProject.ext["FULL_VERSION"]})"
|
|
|
|
val options = options as? StandardJavadocDocletOptions ?: return@javadoc
|
|
|
|
options.links(
|
|
|
|
"https://hub.spigotmc.org/javadocs/spigot/"
|
|
|
|
)
|
|
|
|
options.addBooleanOption("Xdoclint:none", true)
|
|
|
|
}
|
|
|
|
withType<Jar> {
|
|
|
|
archiveVersion.set(rootProject.ext["FULL_VERSION"] as String)
|
|
|
|
}
|
2021-08-31 22:27:35 +02:00
|
|
|
withType<Sign> {
|
|
|
|
onlyIf { project.hasProperty("forceSign") }
|
|
|
|
}
|
2021-06-07 14:17:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Dependency caching
|
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy.cacheChangingModulesFor(5, "minutes")
|
|
|
|
}
|
|
|
|
|
|
|
|
indra {
|
|
|
|
checkstyle(checkstyleVersion)
|
|
|
|
|
|
|
|
github("EssentialsX", "Essentials")
|
|
|
|
gpl3OnlyLicense()
|
|
|
|
|
|
|
|
publishReleasesTo("essx", "https://repo.essentialsx.net/releases/")
|
|
|
|
publishSnapshotsTo("essx", "https://repo.essentialsx.net/snapshots/")
|
|
|
|
|
|
|
|
configurePublications {
|
|
|
|
pom {
|
|
|
|
description.set("The essential plugin suite for Minecraft servers.")
|
|
|
|
url.set("https://essentialsx.net")
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id.set("mdcfe")
|
|
|
|
name.set("MD")
|
|
|
|
email.set("md@n3fs.co.uk")
|
|
|
|
}
|
|
|
|
developer {
|
|
|
|
id.set("pop4959")
|
|
|
|
}
|
|
|
|
developer {
|
|
|
|
id.set("JRoy")
|
|
|
|
name.set("Josh Roy")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ciManagement {
|
|
|
|
system.set("Jenkins")
|
|
|
|
url.set("https://ci.ender.zone/job/EssentialsX")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
javaVersions {
|
|
|
|
target(8)
|
2021-11-22 14:18:06 +01:00
|
|
|
minimumToolchain(17)
|
2021-06-07 14:17:39 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// undo https://github.com/KyoriPowered/indra/blob/master/indra-common/src/main/kotlin/net/kyori/indra/IndraPlugin.kt#L57
|
2022-02-28 21:51:26 +01:00
|
|
|
extensions.getByType<BasePluginExtension>().archivesName.set(project.name)
|