WorldEdit/worldedit-bukkit/build.gradle.kts
Octavia Togami 609c7b8cc4
Scrapped Logging Framework 4 Java (#1715)
* The scramble is complete

* Fix version decl for Bukkit Log4J

* Swap out to a compatibility layer for LogManager

Slightly slower, but compatible across all Java versions

* Piston released with SL4JF removal

* Clean up declarations a bit
2021-03-28 20:35:48 -07:00

85 lines
3.1 KiB
Plaintext

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
`java-library`
}
applyPlatformAndCoreConfiguration()
applyShadowConfiguration()
repositories {
maven { url = uri("https://hub.spigotmc.org/nexus/content/groups/public") }
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
}
configurations.all {
resolutionStrategy {
force("com.google.guava:guava:21.0")
}
}
dependencies {
"api"(project(":worldedit-core"))
"api"(project(":worldedit-libs:bukkit"))
"api"("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT") {
exclude("junit", "junit")
}
"implementation"(enforcedPlatform("org.apache.logging.log4j:log4j-bom:2.8.1") {
// Note: Paper will bump to 2.11.2, but we should only depend on 2.8 APIs for compatibility.
because("Spigot provides Log4J (sort of, not in API, implicitly part of server)")
})
"implementation"("org.apache.logging.log4j:log4j-api")
"compileOnly"("org.jetbrains:annotations:20.1.0")
"compileOnly"("com.destroystokyo.paper:paper-api:1.16.1-R0.1-SNAPSHOT") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
"implementation"("io.papermc:paperlib:1.0.6")
"compileOnly"("com.sk89q:dummypermscompat:1.10")
"implementation"("org.bstats:bstats-bukkit:2.1.0")
"implementation"("it.unimi.dsi:fastutil")
"testImplementation"("org.mockito:mockito-core:1.9.0-rc1")
}
tasks.named<Copy>("processResources") {
val internalVersion = project.ext["internalVersion"]
inputs.property("internalVersion", internalVersion)
filesMatching("plugin.yml") {
expand("internalVersion" to internalVersion)
}
// exclude adapters entirely from this JAR, they should only be in the shadow JAR
exclude("**/worldedit-adapters.jar")
}
addJarManifest(WorldEditKind.Plugin, includeClasspath = true)
tasks.named<ShadowJar>("shadowJar") {
from(zipTree("src/main/resources/worldedit-adapters.jar").matching {
exclude("META-INF/")
})
dependencies {
// In tandem with not bundling log4j, we shouldn't relocate base package here.
// relocate("org.apache.logging", "com.sk89q.worldedit.log4j")
relocate("org.antlr.v4", "com.sk89q.worldedit.antlr4")
include(dependency(":worldedit-core"))
// Purposefully not included, we assume (even though no API exposes it) that Log4J will be present at runtime
// If it turns out not to be true for Spigot/Paper, our only two official platforms, this can be uncommented.
// include(dependency("org.apache.logging.log4j:log4j-api"))
include(dependency("org.antlr:antlr4-runtime"))
relocate("org.bstats", "com.sk89q.worldedit.bstats") {
include(dependency("org.bstats:"))
}
relocate("io.papermc.lib", "com.sk89q.worldedit.bukkit.paperlib") {
include(dependency("io.papermc:paperlib"))
}
relocate("it.unimi.dsi.fastutil", "com.sk89q.worldedit.bukkit.fastutil") {
include(dependency("it.unimi.dsi:fastutil"))
}
}
}
tasks.named("assemble").configure {
dependsOn("shadowJar")
}