WorldEdit/worldedit-core/build.gradle.kts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

130 lines
3.5 KiB
Plaintext
Raw Normal View History

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 {
`java-library`
antlr
2019-07-11 08:07:37 +08:00
}
applyPlatformAndCoreConfiguration()
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)
}
metadataSources {
artifact()
}
}
}
configurations {
register("languageFiles")
2019-07-11 08:07:37 +08:00
}
dependencies {
constraints {
"implementation"( "org.yaml:snakeyaml") {
2021-06-12 05:46:10 +08:00
version { require("1.26") }
because("Bukkit provides SnakeYaml")
}
}
"api"(project(":worldedit-libs:core"))
"compileOnly"("de.schlichtherle:truezip:6.8.4")
"implementation"("org.mozilla:rhino-runtime:1.7.13")
2021-06-12 03:45:38 +08:00
"implementation"("org.yaml:snakeyaml:1.26")
"implementation"("com.google.guava:guava")
"implementation"("com.google.code.findbugs:jsr305:1.3.9")
"implementation"("com.google.code.gson:gson")
2021-06-09 10:18:24 +08:00
"implementation"("org.apache.logging.log4j:log4j-api:2.14.1") {
because("Mojang provides Log4J 2.14.1")
}
"implementation"("it.unimi.dsi:fastutil")
2019-07-11 08:07:37 +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
"annotationProcessor"("com.google.guava:guava:21.0")
"compileOnly"("com.google.auto.value:auto-value-annotations:${Versions.AUTO_VALUE}")
"annotationProcessor"("com.google.auto.value:auto-value:${Versions.AUTO_VALUE}")
2021-08-16 15:30:32 +08:00
"languageFiles"("${project.group}:worldedit-lang:7.2.6:355@zip")
2021-06-09 10:18:24 +08:00
"testRuntimeOnly"("org.apache.logging.log4j:log4j-core:2.14.1")
2019-07-11 08:07:37 +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"
)
}
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"))
}
}
}
sourceSets.named("main") {
java {
srcDir("src/legacy/java")
}
2019-07-11 08:07:37 +08:00
}
tasks.named<Copy>("processResources") {
from(configurations.named("languageFiles")) {
rename {
"i18n.zip"
}
into("lang")
}
}
configure<PublishingExtension> {
publications.named<MavenPublication>("maven") {
artifactId = the<BasePluginConvention>().archivesBaseName
from(components["java"])
}
}