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 {
|
2023-08-09 18:52:18 +00:00
|
|
|
implementation(libs.snakeyaml) {
|
2023-09-29 20:00:58 +00:00
|
|
|
version { strictly("2.2") }
|
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)
|
2023-08-09 18:52:18 +00:00
|
|
|
implementation(libs.guava)
|
|
|
|
implementation(libs.gson)
|
2021-08-01 17:28:51 +00:00
|
|
|
|
|
|
|
// Platform expectations
|
2023-08-09 18:52:18 +00:00
|
|
|
implementation(libs.snakeyaml)
|
2021-08-01 17:28:51 +00:00
|
|
|
|
|
|
|
// Logging
|
2023-08-09 18:52:18 +00:00
|
|
|
implementation(libs.log4jApi)
|
2019-11-19 21:25:36 +00:00
|
|
|
|
2021-08-01 17:28:51 +00:00
|
|
|
// Plugins
|
2023-08-09 18:52:18 +00:00
|
|
|
compileOnly(libs.plotSquaredCore) { 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)
|
2023-08-09 18:52:18 +00:00
|
|
|
compileOnly(libs.adventureApi)
|
|
|
|
compileOnlyApi(libs.adventureMiniMessage)
|
2021-09-24 14:49:30 +00:00
|
|
|
implementation(libs.zstd) { isTransitive = false }
|
2023-08-09 18:52:18 +00:00
|
|
|
compileOnly(libs.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 }
|
2024-06-26 19:55:47 +00:00
|
|
|
implementation(platform(libs.linBus.bom))
|
2021-08-01 17:28:51 +00:00
|
|
|
|
|
|
|
// Tests
|
|
|
|
testRuntimeOnly(libs.log4jCore)
|
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"]}")
|
|
|
|
}
|
|
|
|
}
|