From eccbad92e8b2312b02023f28dc5f00f2ac97c066 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Wed, 10 Jul 2019 13:13:41 -0700 Subject: [PATCH] Move away from deprecation, move dependencies towards buildSrc --- build.gradle | 7 +++--- buildSrc/build.gradle.kts | 32 ++++++++++++++++++++++++ worldedit-core/build.gradle | 12 ++++----- worldedit-core/doctools/build.gradle.kts | 2 +- worldedit-fabric/build.gradle | 8 +++--- worldedit-sponge/build.gradle | 11 +------- 6 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 buildSrc/build.gradle.kts diff --git a/build.gradle b/build.gradle index c3e908d37..b39e4ebb3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,7 @@ plugins { - id 'net.minecrell.licenser' version '0.4.1' apply false - id "org.ajoberstar.grgit" version "3.1.1" - id "com.github.johnrengelman.shadow" version "5.1.0" - id "com.jfrog.artifactory" version "4.9.7" + id "org.ajoberstar.grgit" + id "com.github.johnrengelman.shadow" + id "com.jfrog.artifactory" } println """ diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 000000000..658143d8d --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,32 @@ +plugins { + `kotlin-dsl` + kotlin("jvm") version embeddedKotlinVersion +} + +repositories { + jcenter() + gradlePluginPortal() + maven { + name = "Forge Maven" + url = uri("https://files.minecraftforge.net/maven") + } +} + +configurations.all { + resolutionStrategy { + // Fabric needs this. + force("commons-io:commons-io:2.5", "org.ow2.asm:asm:7.1") + } +} + +dependencies { + implementation(gradleApi()) + implementation("gradle.plugin.net.minecrell:licenser:0.4.1") + implementation("org.ajoberstar.grgit:grgit-gradle:3.1.1") + implementation("com.github.jengelman.gradle.plugins:shadow:5.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") + implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.9.7") + implementation("gradle.plugin.org.spongepowered:spongegradle:0.9.0") + implementation("net.minecraftforge.gradle:ForgeGradle:3.0.130") +} diff --git a/worldedit-core/build.gradle b/worldedit-core/build.gradle index 182702290..41efbff01 100644 --- a/worldedit-core/build.gradle +++ b/worldedit-core/build.gradle @@ -1,13 +1,11 @@ plugins { - id("net.ltgt.apt") version "0.21" apply false + id("java-library") + id("eclipse") + id("idea") + id("net.ltgt.apt-eclipse") + id("net.ltgt.apt-idea") } -apply plugin: 'java-library' -apply plugin: 'eclipse' -apply plugin: 'idea' -apply plugin: 'net.ltgt.apt-eclipse' -apply plugin: 'net.ltgt.apt-idea' - configurations.all { Configuration it -> it.resolutionStrategy { ResolutionStrategy rs -> rs.force("com.google.guava:guava:21.0") diff --git a/worldedit-core/doctools/build.gradle.kts b/worldedit-core/doctools/build.gradle.kts index 002f367bd..75a347ece 100644 --- a/worldedit-core/doctools/build.gradle.kts +++ b/worldedit-core/doctools/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - kotlin("jvm") version "1.3.31" + kotlin("jvm") version "1.3.41" } tasks.withType { diff --git a/worldedit-fabric/build.gradle b/worldedit-fabric/build.gradle index b27289bf9..6eee60e9e 100644 --- a/worldedit-fabric/build.gradle +++ b/worldedit-fabric/build.gradle @@ -77,7 +77,7 @@ jar { } shadowJar { - classifier = 'dist-dev' + archiveClassifier.set("dist-dev") dependencies { relocate "org.slf4j", "com.sk89q.worldedit.slf4j" relocate "org.apache.logging.slf4j", "com.sk89q.worldedit.log4jbridge" @@ -89,7 +89,7 @@ shadowJar { task deobfJar(type: Jar) { from sourceSets.main.output - classifier = 'dev' + archiveClassifier.set("dev") } artifacts { @@ -97,8 +97,8 @@ artifacts { } task shadowJarRemap(type: RemapJarTask) { - input shadowJar.archivePath - output new File(shadowJar.archivePath.getAbsolutePath().replaceFirst('-dev\\.jar$', ".jar")) + input shadowJar.archiveFile + output new File(shadowJar.archiveFile.get().asFile.getAbsolutePath().replaceFirst('-dev\\.jar$', ".jar")) } shadowJarRemap.dependsOn(shadowJar) diff --git a/worldedit-sponge/build.gradle b/worldedit-sponge/build.gradle index a745869b6..8d6633de2 100644 --- a/worldedit-sponge/build.gradle +++ b/worldedit-sponge/build.gradle @@ -1,14 +1,5 @@ -buildscript { - repositories { - mavenCentral() - maven { url = "https://files.minecraftforge.net/maven" } - maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" } - jcenter() - } -} - plugins { - id 'org.spongepowered.plugin' version '0.9.0' + id("org.spongepowered.plugin") } repositories {