2020-07-14 02:50:59 +00:00
|
|
|
import org.gradle.plugins.ide.idea.model.IdeaModel
|
2019-08-26 04:45:03 +00:00
|
|
|
|
|
|
|
plugins {
|
2021-05-14 08:31:32 +00:00
|
|
|
`java-library`
|
|
|
|
antlr
|
2019-08-26 04:45:03 +00:00
|
|
|
}
|
|
|
|
|
2021-07-01 20:16:25 +00:00
|
|
|
project.description = "Core"
|
|
|
|
|
2019-08-26 04:45:03 +00:00
|
|
|
applyPlatformAndCoreConfiguration()
|
|
|
|
|
2021-02-11 16:59:03 +00:00
|
|
|
dependencies {
|
|
|
|
constraints {
|
2021-09-08 15:39:43 +00:00
|
|
|
implementation("org.yaml:snakeyaml") {
|
2022-09-26 21:45:06 +00:00
|
|
|
version { strictly("1.33") }
|
2021-02-11 16:59:03 +00:00
|
|
|
because("Bukkit provides SnakeYaml")
|
2021-02-04 22:06:49 +00:00
|
|
|
}
|
2019-08-26 04:45:03 +00:00
|
|
|
}
|
|
|
|
|
2021-08-01 17:28:51 +00:00
|
|
|
// Modules
|
|
|
|
api(projects.worldeditLibs.core)
|
|
|
|
compileOnly(projects.worldeditLibs.core.ap)
|
|
|
|
annotationProcessor(projects.worldeditLibs.core.ap)
|
|
|
|
|
|
|
|
// Minecraft expectations
|
|
|
|
implementation(libs.fastutil)
|
2022-06-09 23:26:48 +00:00
|
|
|
implementation("com.google.guava:guava")
|
|
|
|
implementation("com.google.code.gson:gson")
|
2021-08-01 17:28:51 +00:00
|
|
|
|
|
|
|
// Platform expectations
|
2021-02-11 16:59:03 +00:00
|
|
|
implementation("org.yaml:snakeyaml")
|
2021-08-01 17:28:51 +00:00
|
|
|
|
|
|
|
// Logging
|
2022-06-09 23:26:48 +00:00
|
|
|
implementation("org.apache.logging.log4j:log4j-api")
|
2019-11-19 21:25:36 +00:00
|
|
|
|
2021-08-01 17:28:51 +00:00
|
|
|
// Plugins
|
2022-06-09 23:26:48 +00:00
|
|
|
compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false }
|
2021-08-01 17:28:51 +00:00
|
|
|
|
2019-08-26 04:45:03 +00:00
|
|
|
// ensure this is on the classpath for the AP
|
2021-08-01 17:28:51 +00:00
|
|
|
annotationProcessor(libs.guava)
|
|
|
|
compileOnly(libs.autoValueAnnotations)
|
|
|
|
annotationProcessor(libs.autoValue)
|
|
|
|
|
|
|
|
// Third party
|
2021-09-22 21:00:12 +00:00
|
|
|
compileOnly(libs.truezip)
|
2021-08-01 17:28:51 +00:00
|
|
|
implementation(libs.findbugs)
|
|
|
|
implementation(libs.rhino)
|
2022-06-09 23:26:48 +00:00
|
|
|
compileOnly("net.kyori:adventure-api")
|
2021-08-01 17:28:51 +00:00
|
|
|
compileOnlyApi(libs.adventureNbt)
|
2022-06-09 23:26:48 +00:00
|
|
|
compileOnlyApi("net.kyori:adventure-text-minimessage")
|
2021-09-24 14:49:30 +00:00
|
|
|
implementation(libs.zstd) { isTransitive = false }
|
2022-06-14 15:02:11 +00:00
|
|
|
compileOnly("com.intellectualsites.paster:Paster")
|
2021-08-01 17:28:51 +00:00
|
|
|
compileOnly(libs.lz4Java) { isTransitive = false }
|
|
|
|
compileOnly(libs.sparsebitset)
|
2021-09-24 14:49:30 +00:00
|
|
|
compileOnly(libs.parallelgzip) { isTransitive = false }
|
2021-08-01 17:28:51 +00:00
|
|
|
antlr(libs.antlr4)
|
|
|
|
implementation(libs.antlr4Runtime)
|
|
|
|
implementation(libs.jsonSimple) { isTransitive = false }
|
|
|
|
|
|
|
|
// Tests
|
|
|
|
testRuntimeOnly(libs.log4jCore)
|
|
|
|
testImplementation(libs.adventureNbt)
|
2021-08-10 08:31:37 +00:00
|
|
|
testImplementation(libs.parallelgzip)
|
2019-08-26 04:45:03 +00:00
|
|
|
}
|
|
|
|
|
2020-04-01 01:13:32 +00:00
|
|
|
tasks.named<Test>("test") {
|
|
|
|
maxHeapSize = "1G"
|
|
|
|
}
|
|
|
|
|
2019-08-26 04:45:03 +00:00
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
|
|
dependsOn(":worldedit-libs:build")
|
|
|
|
options.compilerArgs.add("-Aarg.name.key.prefix=")
|
|
|
|
}
|
|
|
|
|
2019-10-13 09:02:47 +00:00
|
|
|
tasks.named<AntlrTask>("generateGrammarSource").configure {
|
|
|
|
val pkg = "com.sk89q.worldedit.antlr"
|
|
|
|
outputDirectory = file("build/generated-src/antlr/main/${pkg.replace('.', '/')}")
|
|
|
|
arguments = listOf(
|
2021-01-21 12:07:17 +00:00
|
|
|
"-visitor", "-package", pkg,
|
|
|
|
"-Xexact-output-dir"
|
2019-10-13 09:02:47 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-05-14 08:31:32 +00:00
|
|
|
tasks.named("sourcesJar") {
|
|
|
|
mustRunAfter("generateGrammarSource")
|
|
|
|
}
|
|
|
|
|
2019-10-13 09:02:47 +00:00
|
|
|
// Give intellij info about where ANTLR code comes from
|
|
|
|
plugins.withId("idea") {
|
|
|
|
configure<IdeaModel> {
|
|
|
|
afterEvaluate {
|
|
|
|
module.sourceDirs.add(file("src/main/antlr"))
|
|
|
|
module.sourceDirs.add(file("build/generated-src/antlr/main"))
|
|
|
|
module.generatedSourceDirs.add(file("build/generated-src/antlr/main"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-14 02:50:59 +00:00
|
|
|
sourceSets.named("main") {
|
|
|
|
java {
|
|
|
|
srcDir("src/legacy/java")
|
|
|
|
}
|
2019-08-26 04:45:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named<Copy>("processResources") {
|
|
|
|
filesMatching("fawe.properties") {
|
|
|
|
expand("version" to "$version",
|
|
|
|
"commit" to "${rootProject.ext["revision"]}",
|
|
|
|
"date" to "${rootProject.ext["date"]}")
|
|
|
|
}
|
|
|
|
}
|