2023-03-31 00:25:13 +02:00
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
`java-library`
|
|
|
|
id("com.diffplug.spotless") version "6.1.2"
|
|
|
|
id ("com.github.node-gradle.node") version "3.0.1"
|
|
|
|
id ("com.github.johnrengelman.shadow") version "7.1.2"
|
|
|
|
id ("com.modrinth.minotaur") version "2.+"
|
2023-09-05 15:34:46 +02:00
|
|
|
id ("io.papermc.hangar-publish-plugin") version "0.1.0"
|
2023-03-31 00:25:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
group = "de.bluecolored.bluemap.bukkit"
|
|
|
|
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore
|
|
|
|
|
|
|
|
val javaTarget = 17
|
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.toVersion(javaTarget)
|
|
|
|
targetCompatibility = JavaVersion.toVersion(javaTarget)
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
setUrl("https://libraries.minecraft.net")
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
setUrl("https://jitpack.io")
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
setUrl("https://repo.papermc.io/repository/maven-public/")
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
api ("de.bluecolored.bluemap.common:BlueMapCommon") {
|
|
|
|
//exclude dependencies provided by bukkit
|
|
|
|
exclude( group = "com.google.guava", module = "guava" )
|
|
|
|
exclude( group = "com.google.code.gson", module = "gson" )
|
|
|
|
}
|
|
|
|
|
2023-09-05 15:34:46 +02:00
|
|
|
shadow ("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
|
2023-03-31 00:25:13 +02: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"))
|
|
|
|
archiveFileName.set("BlueMap-${project.version}-${project.name}.jar")
|
|
|
|
|
|
|
|
//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")
|
|
|
|
relocate ("net.querz.nbt", "de.bluecolored.shadow.querz.nbt")
|
|
|
|
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")
|
2023-03-31 00:25:13 +02: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.io", "de.bluecolored.shadow.apache.commons.io")
|
|
|
|
relocate ("org.apache.commons.lang3", "de.bluecolored.shadow.apache.commons.lang3")
|
|
|
|
relocate ("org.apache.commons.logging", "de.bluecolored.shadow.apache.commons.logging")
|
|
|
|
relocate ("org.apache.commons.pool2", "de.bluecolored.shadow.apache.commons.pool2")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("release") {
|
|
|
|
dependsOn(tasks.shadowJar)
|
|
|
|
}
|
|
|
|
|
2023-05-13 11:33:41 +02:00
|
|
|
modrinth {
|
|
|
|
token.set(System.getenv("MODRINTH_TOKEN"))
|
|
|
|
projectId.set("swbUV1cr")
|
|
|
|
versionNumber.set("${project.version}-${project.name}")
|
2023-09-05 15:34:46 +02:00
|
|
|
changelog.set("Releasenotes and Changelog: \nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}")
|
2023-05-13 11:33:41 +02:00
|
|
|
uploadFile.set(tasks.findByName("shadowJar"))
|
2023-09-05 15:34:46 +02:00
|
|
|
loaders.addAll("paper","purpur","folia")
|
2023-05-13 11:33:41 +02:00
|
|
|
gameVersions.addAll(
|
2023-09-27 17:39:47 +02:00
|
|
|
"1.20.1", "1.20.2"
|
2023-05-13 11:33:41 +02:00
|
|
|
)
|
|
|
|
}
|
2023-03-31 00:25:13 +02:00
|
|
|
|
2023-09-05 15:34:46 +02:00
|
|
|
hangarPublish {
|
|
|
|
publications.register("plugin") {
|
|
|
|
version.set(project.version as String)
|
|
|
|
id.set("BlueMap")
|
|
|
|
channel.set("Release")
|
|
|
|
changelog.set("Releasenotes and Changelog: \nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}")
|
|
|
|
|
|
|
|
apiKey.set(System.getenv("HANGAR_TOKEN"))
|
|
|
|
|
|
|
|
// register platforms
|
|
|
|
platforms {
|
|
|
|
register(io.papermc.hangarpublishplugin.model.Platforms.PAPER) {
|
|
|
|
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
|
|
|
|
platformVersions.set(listOf(
|
2023-09-27 17:39:47 +02:00
|
|
|
"1.20.1", "1.20.2"
|
2023-09-05 15:34:46 +02:00
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-13 11:33:41 +02:00
|
|
|
tasks.register("publish") {
|
|
|
|
dependsOn("modrinth")
|
2023-09-28 14:07:11 +02:00
|
|
|
dependsOn("publishPluginPublicationToHangar")
|
2023-03-31 00:25:13 +02:00
|
|
|
}
|