From 9aa25ce109c73c90aaf41141dee76965a235ea7a Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 14 May 2021 10:31:32 +0200 Subject: [PATCH] Update Upstream 876108f Prepare for Gradle 7, but due to FG only get to 6.9 Touches #1020 --- buildSrc/build.gradle.kts | 3 --- buildSrc/src/main/kotlin/CommonConfig.kt | 12 ++++++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- worldedit-core/build.gradle.kts | 14 ++++++-------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 618f271fa..71c5142f7 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -22,9 +22,6 @@ val properties = Properties().also { props -> dependencies { implementation(gradleApi()) - implementation("gradle.plugin.org.cadixdev.gradle:licenser:0.5.0") implementation("org.ajoberstar.grgit:grgit-gradle:4.1.0") implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") - 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") } diff --git a/buildSrc/src/main/kotlin/CommonConfig.kt b/buildSrc/src/main/kotlin/CommonConfig.kt index 06174b3ee..4b3562904 100644 --- a/buildSrc/src/main/kotlin/CommonConfig.kt +++ b/buildSrc/src/main/kotlin/CommonConfig.kt @@ -56,16 +56,20 @@ fun Project.applyCommonConfiguration() { dependencies { constraints { - for (conf in configurations.names) { - add(conf, "com.google.guava:guava") { + for (conf in configurations) { + if (conf.isCanBeConsumed || conf.isCanBeResolved) { + // dependencies don't get declared in these + continue + } + add(conf.name, "com.google.guava:guava") { version { strictly(Versions.GUAVA) } because("Mojang provides Guava") } - add(conf, "com.google.code.gson:gson") { + add(conf.name, "com.google.code.gson:gson") { version { strictly(Versions.GSON) } because("Mojang provides Gson") } - add(conf, "it.unimi.dsi:fastutil") { + add(conf.name, "it.unimi.dsi:fastutil") { version { strictly(Versions.FAST_UTIL) } because("Mojang provides FastUtil") } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7665b0fa9..549d84424 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.9-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts index 785aaa6b4..4252300d1 100644 --- a/worldedit-core/build.gradle.kts +++ b/worldedit-core/build.gradle.kts @@ -2,10 +2,8 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import org.gradle.plugins.ide.idea.model.IdeaModel plugins { - id("java-library") - id("net.ltgt.apt-eclipse") - id("net.ltgt.apt-idea") - id("antlr") + `java-library` + antlr } repositories { @@ -74,6 +72,10 @@ tasks.named("generateGrammarSource").configure { ) } +tasks.named("sourcesJar") { + mustRunAfter("generateGrammarSource") +} + // Give intellij info about where ANTLR code comes from plugins.withId("idea") { configure { @@ -87,12 +89,8 @@ plugins.withId("idea") { sourceSets.named("main") { java { - srcDir("src/main/java") srcDir("src/legacy/java") } - resources { - srcDir("src/main/resources") - } } tasks.named("processResources") {