2019-08-25 11:58:28 +02:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
|
2020-08-14 21:29:15 +02:00
|
|
|
plugins {
|
|
|
|
`java-library`
|
2021-08-17 16:57:35 +02:00
|
|
|
|
|
|
|
alias(libs.plugins.pluginyml)
|
2020-08-14 21:29:15 +02:00
|
|
|
}
|
|
|
|
|
2021-07-01 22:16:25 +02:00
|
|
|
project.description = "CLI"
|
|
|
|
|
2019-08-25 11:58:28 +02:00
|
|
|
applyPlatformAndCoreConfiguration()
|
|
|
|
applyShadowConfiguration()
|
|
|
|
|
2021-09-07 10:19:04 +02:00
|
|
|
addJarManifest(
|
|
|
|
WorldEditKind.Standalone("com.sk89q.worldedit.cli.CLIWorldEdit"),
|
|
|
|
extraAttributes = mapOf(
|
|
|
|
// We don't have any multi-release stuff, but Log4J does.
|
|
|
|
"Multi-Release" to "true",
|
|
|
|
),
|
|
|
|
)
|
2021-02-25 22:58:17 +01:00
|
|
|
|
2019-08-25 11:58:28 +02:00
|
|
|
dependencies {
|
2021-08-01 19:28:51 +02:00
|
|
|
// Modules
|
|
|
|
api(projects.worldeditCore)
|
|
|
|
compileOnly(projects.worldeditLibs.core.ap)
|
|
|
|
annotationProcessor(projects.worldeditLibs.core.ap)
|
|
|
|
|
|
|
|
// Minecraft expectations
|
|
|
|
annotationProcessor(libs.guava)
|
|
|
|
implementation(libs.guava)
|
|
|
|
implementation(libs.gson)
|
|
|
|
|
|
|
|
// Logging
|
|
|
|
implementation(libs.log4jBom) {
|
2021-03-29 15:29:16 +02:00
|
|
|
because("We control Log4J on this platform")
|
2021-08-01 19:28:51 +02:00
|
|
|
}
|
|
|
|
implementation(libs.log4j)
|
|
|
|
implementation(libs.log4jCore
|
|
|
|
)
|
2021-03-29 15:29:16 +02:00
|
|
|
implementation("commons-cli:commons-cli:1.4")
|
2021-09-06 20:17:43 +02:00
|
|
|
api(libs.parallelgzip) { isTransitive = false }
|
2021-09-07 10:41:42 +02:00
|
|
|
api(libs.lz4Java)
|
|
|
|
api(libs.lz4JavaStream) { isTransitive = false }
|
2019-08-25 11:58:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named<ShadowJar>("shadowJar") {
|
|
|
|
dependencies {
|
|
|
|
include { true }
|
2021-09-06 20:17:43 +02:00
|
|
|
relocate("org.anarres", "com.fastasyncworldedit.core.internal.io")
|
2021-09-07 10:41:42 +02:00
|
|
|
relocate("net.jpountz", "com.fastasyncworldedit.core.jpountz")
|
|
|
|
relocate("org.lz4", "com.fastasyncworldedit.core.lz4")
|
2019-08-25 11:58:28 +02:00
|
|
|
}
|
2021-07-22 22:11:43 +02:00
|
|
|
archiveFileName.set(moduleIdentifier)
|
2019-08-25 11:58:28 +02:00
|
|
|
minimize {
|
2019-09-02 05:11:34 +02:00
|
|
|
exclude(dependency("org.apache.logging.log4j:log4j-core"))
|
2019-08-25 11:58:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named("assemble").configure {
|
|
|
|
dependsOn("shadowJar")
|
|
|
|
}
|
2021-07-22 22:11:43 +02:00
|
|
|
|
|
|
|
val moduleIdentifier = "${rootProject.name}-${project.description}-${project.version}.jar"
|
|
|
|
val decoration = "\n****************************************"
|
|
|
|
val websiteURL = "https://www.spigotmc.org/resources/13932/"
|
|
|
|
|
|
|
|
bukkit {
|
|
|
|
name = "FastAsyncWorldEdit-COMMAND_LINE_INTERFACE_NOT_A_PLUGIN"
|
|
|
|
main = "com.sk89q.worldedit.cli.AccessPoint"
|
|
|
|
apiVersion = decoration +
|
|
|
|
"\n* 404 - Plugin Not Found.\n" +
|
|
|
|
"* You installed the command line interface (CLI) which is not a plugin.\n" +
|
|
|
|
"* Stop your server, delete `$moduleIdentifier`" +
|
|
|
|
" and download the proper one from:\n" +
|
|
|
|
"* $websiteURL\n" +
|
|
|
|
"* (contains `-Bukkit-` instead of `-CLI-` in the name ;)" +
|
|
|
|
decoration
|
|
|
|
version = rootProject.version.toString()
|
|
|
|
website = websiteURL
|
|
|
|
}
|