From 54c05d1f9b5a3c1adf8ae8c35c59d8e6a0bfea89 Mon Sep 17 00:00:00 2001 From: Henry Le Grys Date: Tue, 26 Apr 2022 22:42:15 +0100 Subject: [PATCH] Upgrade to Gradle 7 --- build.gradle | 21 +++++------------- creator-tools/build.gradle | 16 ++++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- launcher-bootstrap/build.gradle | 12 ++++++---- launcher-builder/build.gradle | 15 ++++++++----- launcher-fancy/build.gradle | 12 ++++++---- launcher/build.gradle | 28 ++++++++++++++---------- 7 files changed, 59 insertions(+), 47 deletions(-) diff --git a/build.gradle b/build.gradle index ef0c52bca..19a1c131f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,16 +1,5 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - } - - dependencies { - classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1" - } -} - plugins { - id "com.github.johnrengelman.shadow" version "4.0.4" + id "com.github.johnrengelman.shadow" version "7.1.2" id 'io.freefair.lombok' version '5.3.0' } @@ -24,13 +13,15 @@ println """ subprojects { apply plugin: 'java' - apply plugin: 'maven' group = 'com.skcraft' version = '4.6-SNAPSHOT' - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(8)) + } + } repositories { mavenCentral() diff --git a/creator-tools/build.gradle b/creator-tools/build.gradle index 09dada89f..94aa5e712 100644 --- a/creator-tools/build.gradle +++ b/creator-tools/build.gradle @@ -5,15 +5,15 @@ plugins { } version = "2.1.0-SNAPSHOT" -sourceCompatibility = 1.8 -targetCompatibility = 1.8 -mainClassName = "com.skcraft.launcher.creator.Creator" +application { + mainClassName = "com.skcraft.launcher.creator.Creator" +} dependencies { - compile project(':launcher-builder') - compile 'org.eclipse.jetty:jetty-server:9.3.1.v20150714' - compile 'com.jidesoft:jide-oss:3.6.10' + implementation project(':launcher-builder') + implementation 'org.eclipse.jetty:jetty-server:9.3.1.v20150714' + implementation 'com.jidesoft:jide-oss:3.6.18' } processResources { @@ -27,4 +27,6 @@ processResources { shadowJar { } -build.dependsOn(shadowJar) +build { + dependsOn(shadowJar) +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index da9702f9e..aa991fcea 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-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/launcher-bootstrap/build.gradle b/launcher-bootstrap/build.gradle index 6400242fa..c165d7bad 100644 --- a/launcher-bootstrap/build.gradle +++ b/launcher-bootstrap/build.gradle @@ -4,11 +4,13 @@ plugins { id 'io.freefair.lombok' } -mainClassName = "com.skcraft.launcher.Bootstrap" +application { + mainClassName = "com.skcraft.launcher.Bootstrap" +} dependencies { - compile 'com.googlecode.json-simple:json-simple:1.1.1' - compile 'javax.xml.bind:jaxb-api:2.3.0' + implementation 'com.googlecode.json-simple:json-simple:1.1.1' + implementation 'javax.xml.bind:jaxb-api:2.3.0' } processResources { @@ -22,4 +24,6 @@ processResources { shadowJar { } -build.dependsOn(shadowJar) +build { + dependsOn(shadowJar) +} diff --git a/launcher-builder/build.gradle b/launcher-builder/build.gradle index 0d8387c45..91ddff48a 100644 --- a/launcher-builder/build.gradle +++ b/launcher-builder/build.gradle @@ -1,18 +1,23 @@ plugins { id 'application' + id 'java-library' id "com.github.johnrengelman.shadow" id 'io.freefair.lombok' } -mainClassName = "com.skcraft.launcher.builder.PackageBuilder" +application { + mainClassName = "com.skcraft.launcher.builder.PackageBuilder" +} dependencies { - compile project(':launcher') - compile 'org.tukaani:xz:1.0' - compile 'org.apache.commons:commons-compress:1.9' + api project(':launcher') + implementation 'org.tukaani:xz:1.0' + implementation 'org.apache.commons:commons-compress:1.9' } shadowJar { } -build.dependsOn(shadowJar) +build { + dependsOn(shadowJar) +} diff --git a/launcher-fancy/build.gradle b/launcher-fancy/build.gradle index 6cc9891f1..bbd656125 100644 --- a/launcher-fancy/build.gradle +++ b/launcher-fancy/build.gradle @@ -4,7 +4,9 @@ plugins { id 'io.freefair.lombok' } -mainClassName = "com.skcraft.launcher.FancyLauncher" +application { + mainClassName = "com.skcraft.launcher.FancyLauncher" +} repositories { maven { @@ -14,11 +16,13 @@ repositories { } dependencies { - compile project(':launcher') - compile 'io.github.cottonmc.insubstantial:substance:7.3.1-SNAPSHOT' + implementation project(':launcher') + implementation 'io.github.cottonmc.insubstantial:substance:7.3.1-SNAPSHOT' } shadowJar { } -build.dependsOn(shadowJar) +build { + dependsOn(shadowJar) +} diff --git a/launcher/build.gradle b/launcher/build.gradle index 1525face0..8d1cff443 100644 --- a/launcher/build.gradle +++ b/launcher/build.gradle @@ -1,21 +1,25 @@ plugins { id 'application' + id 'java-library' id "com.github.johnrengelman.shadow" id 'io.freefair.lombok' } -mainClassName = "com.skcraft.launcher.Launcher" +application { + mainClassName = "com.skcraft.launcher.Launcher" +} dependencies { - compile 'javax.xml.bind:jaxb-api:2.2.4' - compile 'com.fasterxml.jackson.core:jackson-databind:2.3.0' - compile 'commons-lang:commons-lang:2.6' - compile 'commons-io:commons-io:1.2' - compile 'com.google.guava:guava:15.0' - compile 'com.beust:jcommander:1.32' - compile 'com.miglayout:miglayout:3.7.4' - compile 'com.google.code.findbugs:jsr305:3.0.0' - compile 'com.googlecode.plist:dd-plist:1.23' + api 'javax.xml.bind:jaxb-api:2.2.4' + api 'com.fasterxml.jackson.core:jackson-databind:2.3.0' + api 'commons-lang:commons-lang:2.6' + api 'commons-io:commons-io:1.2' + api 'com.google.guava:guava:15.0' + api 'com.beust:jcommander:1.32' + api 'com.miglayout:miglayout:3.7.4' + api 'com.google.code.findbugs:jsr305:3.0.0' + + implementation 'com.googlecode.plist:dd-plist:1.23' implementation 'net.java.dev.jna:jna-platform:5.10.0' } @@ -31,4 +35,6 @@ processResources { shadowJar { } -build.dependsOn(shadowJar) +build { + dependsOn(shadowJar) +}