WorldEdit/worldedit-core/build.gradle.kts

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

143 lines
4.1 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")
2022-06-04 16:12:56 +08:00
"compileOnlyApi"("com.google.code.findbugs:jsr305:1.3.9")
"implementation"("com.google.code.gson:gson")
"implementation"("com.sk89q:jchronic:0.2.4a") {
exclude(group = "junit", module = "junit")
}
"implementation"("com.thoughtworks.paranamer:paranamer:2.6")
"implementation"("com.sk89q.lib:jlibnoise:1.0.0")
"api"(platform("org.enginehub.lin-bus:lin-bus-bom:${Versions.LIN_BUS}"))
"api"("org.enginehub.lin-bus:lin-bus-tree") {
exclude(group = "org.jetbrains", module = "annotations")
}
"api"("org.enginehub.lin-bus.format:lin-bus-format-snbt") {
exclude(group = "org.jetbrains", module = "annotations")
}
"implementation"("org.apache.logging.log4j:log4j-api:${Versions.LOG4J}") {
because("Mojang provides Log4J")
}
"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
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}")
2021-08-16 15:30:32 +08:00
"languageFiles"("${project.group}:worldedit-lang:7.2.6:355@zip")
"testRuntimeOnly"("org.apache.logging.log4j:log4j-core:${Versions.LOG4J}")
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"])
}
}