2022-01-15 01:18:02 +01:00
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
`java-library`
|
|
|
|
id("com.diffplug.spotless") version "6.1.2"
|
|
|
|
id ("com.github.node-gradle.node") version "3.0.1"
|
2024-06-03 21:50:52 +02:00
|
|
|
id ("com.github.johnrengelman.shadow") version "8.1.1"
|
2022-10-24 23:24:41 +02:00
|
|
|
id ("com.modrinth.minotaur") version "2.+"
|
2022-01-15 01:18:02 +01:00
|
|
|
}
|
|
|
|
|
2024-04-04 02:07:09 +02:00
|
|
|
group = "de.bluecolored.bluemap"
|
2022-07-30 16:07:10 +02:00
|
|
|
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore
|
2022-01-15 01:18:02 +01:00
|
|
|
|
2024-03-29 13:08:59 +01:00
|
|
|
val javaTarget = 16
|
2022-01-15 01:18:02 +01:00
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.toVersion(javaTarget)
|
|
|
|
targetCompatibility = JavaVersion.toVersion(javaTarget)
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2024-04-04 02:07:09 +02:00
|
|
|
maven ("https://libraries.minecraft.net")
|
|
|
|
maven ("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") {
|
2022-01-15 01:18:02 +01:00
|
|
|
content {
|
|
|
|
includeGroup ("org.spigotmc")
|
|
|
|
}
|
|
|
|
}
|
2024-04-04 02:07:09 +02:00
|
|
|
maven ("https://oss.sonatype.org/content/repositories/snapshots")
|
|
|
|
maven ("https://repo.bluecolored.de/releases")
|
2022-01-15 01:18:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-04-04 02:07:09 +02:00
|
|
|
api ("de.bluecolored.bluemap:BlueMapCommon") {
|
2022-01-15 01:18:02 +01:00
|
|
|
//exclude dependencies provided by bukkit
|
|
|
|
exclude( group = "com.google.guava", module = "guava" )
|
|
|
|
exclude( group = "com.google.code.gson", module = "gson" )
|
|
|
|
}
|
|
|
|
|
2024-03-29 13:08:59 +01:00
|
|
|
shadow ("org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT")
|
2022-01-15 01:18:02 +01:00
|
|
|
implementation ("org.bstats:bstats-bukkit:2.2.1")
|
|
|
|
|
|
|
|
testImplementation ("org.junit.jupiter:junit-jupiter:5.8.2")
|
|
|
|
testRuntimeOnly ("org.junit.jupiter:junit-jupiter-engine:5.8.2")
|
|
|
|
}
|
|
|
|
|
|
|
|
spotless {
|
|
|
|
java {
|
|
|
|
target ("src/*/java/**/*.java")
|
|
|
|
|
|
|
|
licenseHeaderFile("../../HEADER")
|
|
|
|
indentWithSpaces()
|
|
|
|
trimTrailingWhitespace()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(JavaCompile::class).configureEach {
|
|
|
|
options.apply {
|
|
|
|
encoding = "utf-8"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(AbstractArchiveTask::class).configureEach {
|
|
|
|
isReproducibleFileOrder = true
|
|
|
|
isPreserveFileTimestamps = false
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.processResources {
|
|
|
|
from("src/main/resources") {
|
|
|
|
include("plugin.yml")
|
|
|
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
|
|
|
|
|
|
|
expand (
|
|
|
|
"version" to project.version
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.shadowJar {
|
|
|
|
destinationDirectory.set(file("../../build/release"))
|
2022-07-30 16:07:10 +02:00
|
|
|
archiveFileName.set("BlueMap-${project.version}-${project.name}.jar")
|
2022-01-15 01:18:02 +01:00
|
|
|
|
|
|
|
//relocate ("com.flowpowered.math", "de.bluecolored.shadow.flowpowered.math") //DON"T relocate this, because the API depends on it
|
|
|
|
relocate ("com.typesafe.config", "de.bluecolored.shadow.typesafe.config")
|
2024-02-23 21:58:50 +01:00
|
|
|
relocate ("de.bluecolored.bluenbt", "de.bluecolored.shadow.bluenbt")
|
2022-01-15 01:18:02 +01:00
|
|
|
relocate ("org.spongepowered.configurate", "de.bluecolored.shadow.configurate")
|
|
|
|
relocate ("org.bstats", "de.bluecolored.shadow.bstats")
|
|
|
|
relocate ("com.mojang.brigadier", "de.bluecolored.shadow.mojang.brigadier")
|
|
|
|
relocate ("com.github.benmanes.caffeine", "de.bluecolored.shadow.benmanes.caffeine")
|
|
|
|
relocate ("org.aopalliance", "de.bluecolored.shadow.aopalliance")
|
|
|
|
relocate ("javax.inject", "de.bluecolored.shadow.javax.inject")
|
|
|
|
relocate ("org.checkerframework", "de.bluecolored.shadow.checkerframework")
|
|
|
|
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
|
|
|
|
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
|
2023-05-09 22:52:29 +02:00
|
|
|
relocate ("io.airlift", "de.bluecolored.shadow.airlift")
|
2024-02-07 23:01:31 +01:00
|
|
|
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
|
2022-01-15 02:02:03 +01:00
|
|
|
|
|
|
|
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
|
|
|
|
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")
|
|
|
|
|
|
|
|
relocate ("org.apache.commons.dbcp2", "de.bluecolored.shadow.apache.commons.dbcp2")
|
|
|
|
relocate ("org.apache.commons.logging", "de.bluecolored.shadow.apache.commons.logging")
|
|
|
|
relocate ("org.apache.commons.pool2", "de.bluecolored.shadow.apache.commons.pool2")
|
2022-01-15 01:18:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("release") {
|
|
|
|
dependsOn(tasks.shadowJar)
|
|
|
|
}
|
2022-10-24 23:24:41 +02:00
|
|
|
|
|
|
|
modrinth {
|
|
|
|
token.set(System.getenv("MODRINTH_TOKEN"))
|
|
|
|
projectId.set("swbUV1cr")
|
|
|
|
versionNumber.set("${project.version}-${project.name}")
|
2023-11-19 16:00:46 +01:00
|
|
|
changelog.set(file("../../release.md")
|
|
|
|
.readText()
|
|
|
|
.replace("{version}", project.version.toString()))
|
2022-10-24 23:24:41 +02:00
|
|
|
uploadFile.set(tasks.findByName("shadowJar"))
|
2023-07-27 22:08:52 +02:00
|
|
|
loaders.addAll("spigot", "paper", "purpur")
|
2022-10-24 23:24:41 +02:00
|
|
|
gameVersions.addAll(
|
2024-03-29 13:08:59 +01:00
|
|
|
"1.16.5",
|
2022-10-24 23:43:02 +02:00
|
|
|
"1.17", "1.17.1",
|
2022-10-24 23:56:56 +02:00
|
|
|
"1.18", "1.18.1", "1.18.2",
|
2023-07-15 13:45:44 +02:00
|
|
|
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
|
2024-06-17 19:47:42 +02:00
|
|
|
"1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4", "1.20.5", "1.20.6",
|
|
|
|
"1.21"
|
2022-10-24 23:24:41 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("publish") {
|
|
|
|
dependsOn("modrinth")
|
|
|
|
}
|