2021-05-14 13:01:45 +08:00
|
|
|
import org.cadixdev.gradle.licenser.LicenseExtension
|
2019-10-13 17:02:47 +08:00
|
|
|
import org.gradle.plugins.ide.idea.model.IdeaModel
|
|
|
|
|
2019-07-11 08:07:37 +08:00
|
|
|
plugins {
|
2021-05-14 13:01:45 +08:00
|
|
|
`java-library`
|
|
|
|
antlr
|
2019-07-11 08:07:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
applyPlatformAndCoreConfiguration()
|
|
|
|
|
2020-10-09 08:42:23 +08:00
|
|
|
repositories {
|
|
|
|
ivy {
|
|
|
|
url = uri("https://repo.enginehub.org/language-files/")
|
|
|
|
name = "EngineHub Language Files"
|
|
|
|
patternLayout {
|
|
|
|
artifact("[organisation]/[module]/[revision]/[artifact]-[revision](+[classifier])(.[ext])")
|
|
|
|
setM2compatible(true)
|
|
|
|
}
|
2021-01-25 18:14:09 +08:00
|
|
|
metadataSources {
|
|
|
|
artifact()
|
|
|
|
}
|
2020-10-09 08:42:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
register("languageFiles")
|
2019-07-11 08:07:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2021-01-25 18:14:09 +08:00
|
|
|
constraints {
|
|
|
|
"implementation"( "org.yaml:snakeyaml") {
|
2021-06-12 05:46:10 +08:00
|
|
|
version { require("1.26") }
|
2021-01-25 18:14:09 +08:00
|
|
|
because("Bukkit provides SnakeYaml")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-16 09:48:47 +08:00
|
|
|
"api"(project(":worldedit-libs:core"))
|
2021-07-29 14:01:35 +08:00
|
|
|
"compileOnly"("de.schlichtherle:truezip:6.8.4")
|
2021-01-25 18:14:09 +08:00
|
|
|
"implementation"("org.mozilla:rhino-runtime:1.7.13")
|
2021-06-12 03:45:38 +08:00
|
|
|
"implementation"("org.yaml:snakeyaml:1.26")
|
2021-01-25 18:14:09 +08:00
|
|
|
"implementation"("com.google.guava:guava")
|
2020-07-16 09:48:47 +08:00
|
|
|
"implementation"("com.google.code.findbugs:jsr305:1.3.9")
|
2021-01-25 18:14:09 +08:00
|
|
|
"implementation"("com.google.code.gson:gson")
|
2021-03-29 11:35:48 +08:00
|
|
|
|
2021-12-13 07:49:32 +08:00
|
|
|
"implementation"("org.apache.logging.log4j:log4j-api:${Versions.LOG4J}") {
|
|
|
|
because("Mojang provides Log4J")
|
2021-03-29 11:35:48 +08:00
|
|
|
}
|
|
|
|
|
2021-01-25 18:14:09 +08:00
|
|
|
"implementation"("it.unimi.dsi:fastutil")
|
2019-07-11 08:07:37 +08:00
|
|
|
|
2021-01-25 18:14:09 +08:00
|
|
|
val antlrVersion = "4.9.1"
|
2019-10-13 17:02:47 +08:00
|
|
|
"antlr"("org.antlr:antlr4:$antlrVersion")
|
|
|
|
"implementation"("org.antlr:antlr4-runtime:$antlrVersion")
|
|
|
|
|
2019-07-11 08:07:37 +08:00
|
|
|
"compileOnly"(project(":worldedit-libs:core:ap"))
|
|
|
|
"annotationProcessor"(project(":worldedit-libs:core:ap"))
|
|
|
|
// ensure this is on the classpath for the AP
|
2021-12-01 05:01:06 +08:00
|
|
|
"annotationProcessor"("com.google.guava:guava:${Versions.GUAVA}")
|
2019-07-11 08:07:37 +08:00
|
|
|
"compileOnly"("com.google.auto.value:auto-value-annotations:${Versions.AUTO_VALUE}")
|
|
|
|
"annotationProcessor"("com.google.auto.value:auto-value:${Versions.AUTO_VALUE}")
|
2020-10-09 08:42:23 +08:00
|
|
|
|
2021-08-16 15:30:32 +08:00
|
|
|
"languageFiles"("${project.group}:worldedit-lang:7.2.6:355@zip")
|
2020-10-09 08:42:23 +08:00
|
|
|
|
2021-12-13 07:49:32 +08:00
|
|
|
"testRuntimeOnly"("org.apache.logging.log4j:log4j-core:${Versions.LOG4J}")
|
2019-07-11 08:07:37 +08:00
|
|
|
}
|
|
|
|
|
2020-04-01 09:13:32 +08:00
|
|
|
tasks.named<Test>("test") {
|
|
|
|
maxHeapSize = "1G"
|
|
|
|
}
|
|
|
|
|
2019-07-11 08:07:37 +08:00
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
|
|
dependsOn(":worldedit-libs:build")
|
|
|
|
options.compilerArgs.add("-Aarg.name.key.prefix=")
|
|
|
|
}
|
|
|
|
|
2019-10-13 17:02:47 +08:00
|
|
|
tasks.named<AntlrTask>("generateGrammarSource").configure {
|
|
|
|
val pkg = "com.sk89q.worldedit.antlr"
|
|
|
|
outputDirectory = file("build/generated-src/antlr/main/${pkg.replace('.', '/')}")
|
|
|
|
arguments = listOf(
|
|
|
|
"-visitor", "-package", pkg,
|
|
|
|
"-Xexact-output-dir"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-05-14 13:01:45 +08:00
|
|
|
tasks.named("sourcesJar") {
|
|
|
|
mustRunAfter("generateGrammarSource")
|
|
|
|
}
|
|
|
|
|
2019-10-19 13:39:52 +08:00
|
|
|
configure<LicenseExtension> {
|
|
|
|
exclude {
|
|
|
|
it.file.startsWith(project.buildDir)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tasks.withType<Checkstyle>().configureEach {
|
|
|
|
exclude("com/sk89q/worldedit/antlr/**/*.java")
|
|
|
|
}
|
|
|
|
|
2019-10-13 17:02:47 +08: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-13 03:57:07 +08:00
|
|
|
sourceSets.named("main") {
|
|
|
|
java {
|
|
|
|
srcDir("src/legacy/java")
|
|
|
|
}
|
2019-07-11 08:07:37 +08:00
|
|
|
}
|
2019-12-09 10:46:18 +08:00
|
|
|
|
2020-10-09 08:42:23 +08:00
|
|
|
tasks.named<Copy>("processResources") {
|
|
|
|
from(configurations.named("languageFiles")) {
|
|
|
|
rename {
|
|
|
|
"i18n.zip"
|
2020-02-04 13:26:13 +08:00
|
|
|
}
|
2020-10-09 08:42:23 +08:00
|
|
|
into("lang")
|
2020-02-04 13:26:13 +08:00
|
|
|
}
|
2020-07-13 03:57:07 +08:00
|
|
|
}
|
2021-06-14 02:32:38 +08:00
|
|
|
|
|
|
|
configure<PublishingExtension> {
|
|
|
|
publications.named<MavenPublication>("maven") {
|
|
|
|
artifactId = the<BasePluginConvention>().archivesBaseName
|
|
|
|
from(components["java"])
|
|
|
|
}
|
|
|
|
}
|