From 20304bf7ade9522c132e141a48bd1e9fc56ab669 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Thu, 11 Feb 2021 11:59:03 -0500 Subject: [PATCH] Cherry-pick build-script changes from upstream --- buildSrc/build.gradle.kts | 21 +++--------- buildSrc/src/main/kotlin/PlatformConfig.kt | 15 +++----- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- worldedit-bukkit/build.gradle.kts | 23 ++++++------- worldedit-core/build.gradle.kts | 40 +++++++++++----------- 6 files changed, 42 insertions(+), 61 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index c0f2746a6..7bbaf06cf 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -30,18 +30,6 @@ repositories { } } } -/* -configurations.all { - resolutionStrategy { - // Fabric needs this. - force( - "commons-io:commons-io:2.6", - "org.ow2.asm:asm:8.0.1", - "org.ow2.asm:asm-commons:8.0.1" - ) - } -} - */ val properties = Properties().also { props -> project.projectDir.resolveSibling("gradle.properties").bufferedReader().use { @@ -57,12 +45,11 @@ dependencies { implementation("net.ltgt.apt-eclipse:net.ltgt.apt-eclipse.gradle.plugin:0.21") implementation("net.ltgt.apt-idea:net.ltgt.apt-idea.gradle.plugin:0.21") /* - implementation("gradle.plugin.com.mendhak.gradlecrowdin:plugin:0.1.0") - implementation("org.enginehub.gradle:gradle-codecov-plugin:0.1.0") - implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.16.0") - implementation("gradle.plugin.org.spongepowered:spongegradle:0.9.0") - implementation("net.minecraftforge.gradle:ForgeGradle:3.0.181") + implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.19.0") + implementation("org.spongepowered:SpongeGradle:0.11.5") + implementation("net.minecraftforge.gradle:ForgeGradle:4.0.9") implementation("net.fabricmc:fabric-loom:$loomVersion") implementation("net.fabricmc:sponge-mixin:$mixinVersion") + implementation("org.enginehub.gradle:gradle-codecov-plugin:0.1.0") */ } diff --git a/buildSrc/src/main/kotlin/PlatformConfig.kt b/buildSrc/src/main/kotlin/PlatformConfig.kt index 68f58640c..53750d461 100644 --- a/buildSrc/src/main/kotlin/PlatformConfig.kt +++ b/buildSrc/src/main/kotlin/PlatformConfig.kt @@ -27,11 +27,6 @@ fun Project.applyPlatformAndCoreConfiguration() { ext["internalVersion"] = "$version;${rootProject.ext["gitCommitHash"]}" - configure { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = sourceCompatibility - } - tasks .withType() .matching { it.name == "compileJava" || it.name == "compileTestJava" } @@ -55,11 +50,11 @@ fun Project.applyPlatformAndCoreConfiguration() { dependencies { "compileOnly"("org.jetbrains:annotations:20.1.0") - "testImplementation"("org.junit.jupiter:junit-jupiter-api:5.6.1") - "testImplementation"("org.junit.jupiter:junit-jupiter-params:5.6.1") - "testImplementation"("org.mockito:mockito-core:3.3.3") - "testImplementation"("org.mockito:mockito-junit-jupiter:3.3.3") - "testRuntime"("org.junit.jupiter:junit-jupiter-engine:5.6.1") + "testImplementation"("org.junit.jupiter:junit-jupiter-api:${Versions.JUNIT}") + "testImplementation"("org.junit.jupiter:junit-jupiter-params:${Versions.JUNIT}") + "testImplementation"("org.mockito:mockito-core:${Versions.MOCKITO}") + "testImplementation"("org.mockito:mockito-junit-jupiter:${Versions.MOCKITO}") + "testRuntime"("org.junit.jupiter:junit-jupiter-engine:${Versions.JUNIT}") } // Java 8 turns on doclint which we fail diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1c4bcc29e..25d326531 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index a7e4bdc9a..7c7bd3470 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,7 +6,7 @@ listOf("bukkit", "core").forEach { include("worldedit-libs:$it") include("worldedit-$it") } -include("worldedit-mod") +// include("worldedit-mod") include("worldedit-libs:core:ap") dependencyResolutionManagement { diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index 88f7dd13e..2868200e7 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -1,7 +1,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { - id("java-library") + `java-library` } applyPlatformAndCoreConfiguration() @@ -87,7 +87,7 @@ dependencies { compileOnly("org.spigotmcv1_16_r1:spigotmcv1_16_r1:1_16_r1") compileOnly("org.spigotmcv1_16_r2:spigotmcv1_16_r2:1_16_r2") compileOnly("org.spigotmcv1_16_r3:spigotmcv1_16_r3:1_16_r3") - implementation("it.unimi.dsi:fastutil:8.4.4") + implementation("it.unimi.dsi:fastutil") api("com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT") { exclude("junit", "junit") isTransitive = false @@ -99,7 +99,7 @@ dependencies { compileOnly("com.sk89q:dummypermscompat:1.10") { exclude("com.github.MilkBowl", "VaultAPI") } - implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.8.1") + implementation("org.slf4j:slf4j-jdk14:${Versions.SLF4J}") testImplementation("org.mockito:mockito-core:1.9.0-rc1") compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.4") { exclude("com.sk89q.worldedit", "worldedit-bukkit") @@ -122,8 +122,10 @@ dependencies { } tasks.named("processResources") { + val internalVersion = project.ext["internalVersion"] + inputs.property("internalVersion", internalVersion) filesMatching("plugin.yml") { - expand("internalVersion" to project.ext["internalVersion"]) + expand("internalVersion" to internalVersion) } // exclude adapters entirely from this JAR, they should only be in the shadow JAR exclude("**/worldedit-adapters.jar") @@ -149,20 +151,17 @@ tasks.named("shadowJar") { include(dependency("org.slf4j:slf4j-api")) include(dependency("org.apache.logging.log4j:log4j-slf4j-impl")) include(dependency("org.antlr:antlr4-runtime")) - relocate("de.notmyfault", "com.boydti.fawe") { - include(dependency("de.notmyfault:serverlib:1.0.1")) + relocate("org.bstats", "com.sk89q.worldedit.bstats") { + include(dependency("org.bstats:")) } relocate("io.papermc.lib", "com.sk89q.worldedit.bukkit.paperlib") { - include(dependency("io.papermc:paperlib:1.0.6")) + include(dependency("io.papermc:paperlib")) } relocate("it.unimi.dsi.fastutil", "com.sk89q.worldedit.bukkit.fastutil") { include(dependency("it.unimi.dsi:fastutil")) } - relocate("org.bstats", "com.boydti.fawe.metrics") { - include(dependency("org.bstats:bstats-bukkit:2.1.0")) - } - relocate("org.bstats", "com.boydti.fawe.metrics") { - include(dependency("org.bstats:bstats-base:2.1.0")) + relocate("de.notmyfault", "com.boydti.fawe") { + include(dependency("de.notmyfault:serverlib:1.0.1")) } relocate("com.intellectualsites.paster", "com.boydti.fawe.paster") { include(dependency("com.intellectualsites.paster:Paster:1.0.1-SNAPSHOT")) diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts index eb63caafa..970eb34c8 100644 --- a/worldedit-core/build.gradle.kts +++ b/worldedit-core/build.gradle.kts @@ -22,38 +22,38 @@ repositories { applyPlatformAndCoreConfiguration() -configurations { - all { - resolutionStrategy { - force("com.google.guava:guava:21.0") +dependencies { + constraints { + implementation( "org.yaml:snakeyaml") { + version { strictly("1.26") } + because("Bukkit provides SnakeYaml") } } -} -dependencies { api(project(":worldedit-libs:core")) implementation("de.schlichtherle:truezip:6.8.4") - implementation("net.java.truevfs:truevfs-profile-default_2.13:0.12.2") - implementation("org.mozilla:rhino-runtime:1.7.12") - implementation("org.yaml:snakeyaml:1.27") - implementation("com.google.guava:guava:21.0") - implementation("com.google.code.findbugs:jsr305:3.0.2") - implementation("com.google.code.gson:gson:2.8.6") - implementation("org.slf4j:slf4j-api:1.7.26") - implementation("it.unimi.dsi:fastutil:8.4.4") + implementation("net.java.truevfs:truevfs-profile-default_2.13:0.12.1") + implementation("org.mozilla:rhino-runtime:1.7.13") + implementation("org.yaml:snakeyaml") + implementation("com.google.guava:guava") + implementation("com.google.code.findbugs:jsr305:1.3.9") + implementation("com.google.code.gson:gson") + implementation("org.slf4j:slf4j-api:${Versions.SLF4J}") + implementation("it.unimi.dsi:fastutil") - antlr("org.antlr:antlr4:4.7.2") - implementation("org.antlr:antlr4-runtime:4.7.2") + val antlrVersion = "4.9.1" + antlr("org.antlr:antlr4:$antlrVersion") + implementation("org.antlr:antlr4-runtime:$antlrVersion") implementation("com.googlecode.json-simple:json-simple:1.1.1") { isTransitive = false } 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:1.7") - annotationProcessor("com.google.auto.value:auto-value:1.7") - testImplementation("ch.qos.logback:logback-core:1.2.3") - testImplementation("ch.qos.logback:logback-classic:1.2.3") + compileOnly("com.google.auto.value:auto-value-annotations:${Versions.AUTO_VALUE}") + annotationProcessor("com.google.auto.value:auto-value:${Versions.AUTO_VALUE}") + testImplementation("ch.qos.logback:logback-core:${Versions.LOGBACK}") + testImplementation("ch.qos.logback:logback-classic:${Versions.LOGBACK}") implementation("com.github.luben:zstd-jni:1.4.8-2") compileOnly("net.fabiozumbi12:redprotect:1.9.6") api("com.github.intellectualsites.plotsquared:PlotSquared-API:4.514") { isTransitive = false }