From f63899a666c4f42d0e457a61fdf141644f3c13fe Mon Sep 17 00:00:00 2001 From: Pazaz Date: Wed, 3 Jan 2024 08:29:46 -0500 Subject: [PATCH] chore: Rewrote gradle scripts for KTS and prep for 9.0 --- build.gradle | 0 client/build.gradle | 31 ------------------- client/build.gradle.kts | 24 ++++++++++++++ deob-annotations/build.gradle | 10 ------ deob-annotations/build.gradle.kts | 12 +++++++ loader/build.gradle | 26 ---------------- loader/build.gradle.kts | 15 +++++++++ settings.gradle | 17 ---------- settings.gradle.kts | 8 +++++ tools/build.gradle | 18 ----------- tools/build.gradle.kts | 14 +++++++++ .../main/java/lostcity/tools/LoaderSig.java | 1 + 12 files changed, 74 insertions(+), 102 deletions(-) delete mode 100644 build.gradle delete mode 100644 client/build.gradle create mode 100644 client/build.gradle.kts delete mode 100644 deob-annotations/build.gradle create mode 100644 deob-annotations/build.gradle.kts delete mode 100644 loader/build.gradle create mode 100644 loader/build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts delete mode 100644 tools/build.gradle create mode 100644 tools/build.gradle.kts diff --git a/build.gradle b/build.gradle deleted file mode 100644 index e69de29b..00000000 diff --git a/client/build.gradle b/client/build.gradle deleted file mode 100644 index 478c4e80..00000000 --- a/client/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -plugins { - id 'java' - id 'application' -} - -mainClassName = 'client' - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' - sourceCompatibility = '1.5' - targetCompatibility = '1.5' -} - -tasks.withType(JavaExec) { - workingDir = rootProject.projectDir -} - -tasks.withType(Jar) { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE -} - -dependencies { - compileOnly project(':deob-annotations') -} - -jar { - manifest { - attributes 'Main-Class': "$mainClassName" - } -// from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } -} diff --git a/client/build.gradle.kts b/client/build.gradle.kts new file mode 100644 index 00000000..df579a97 --- /dev/null +++ b/client/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + java + application +} + +dependencies { + compileOnly(project(":deob-annotations")) +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_5 +} + +application { + mainClass = "client" +} + +tasks.withType { + options.encoding = "UTF-8" +} + +tasks.withType { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE +} diff --git a/deob-annotations/build.gradle b/deob-annotations/build.gradle deleted file mode 100644 index a0974650..00000000 --- a/deob-annotations/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -plugins { - id 'java' - id 'java-library' -} - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' - sourceCompatibility = '1.5' - targetCompatibility = '1.5' -} diff --git a/deob-annotations/build.gradle.kts b/deob-annotations/build.gradle.kts new file mode 100644 index 00000000..60df4869 --- /dev/null +++ b/deob-annotations/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + java + id("java-library") +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_5 +} + +tasks.withType { + options.encoding = "UTF-8" +} diff --git a/loader/build.gradle b/loader/build.gradle deleted file mode 100644 index 76143fd9..00000000 --- a/loader/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -plugins { - id 'java' - id 'application' -} - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' - sourceCompatibility = '1.5' - targetCompatibility = '1.5' -} - -tasks.withType(JavaExec) { - workingDir = rootProject.projectDir -} - -tasks.withType(Jar) { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE -} - -dependencies { - compileOnly project(':deob-annotations') -} - -jar { -// from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } -} diff --git a/loader/build.gradle.kts b/loader/build.gradle.kts new file mode 100644 index 00000000..50cd0d8c --- /dev/null +++ b/loader/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + java +} + +dependencies { + compileOnly(project(":deob-annotations")) +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_5 +} + +tasks.withType { + options.encoding = "UTF-8" +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 8fa2e7b3..00000000 --- a/settings.gradle +++ /dev/null @@ -1,17 +0,0 @@ -rootProject.name = "rs2" - -dependencyResolutionManagement { - repositories { - mavenCentral() - flatDir { - dirs 'lib' - } - } -} - -include( - "deob-annotations", - "client", - "loader", - "tools" -) diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..f4125a93 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,8 @@ +rootProject.name = "rs2" + +include( + "deob-annotations", + "client", + "loader", + "tools" +) diff --git a/tools/build.gradle b/tools/build.gradle deleted file mode 100644 index 09642380..00000000 --- a/tools/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id 'java' - id 'application' -} - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} - -tasks.withType(JavaExec) { - workingDir = rootProject.projectDir -} - -tasks.register('sig', JavaExec) { - classpath = sourceSets.main.runtimeClasspath - main = 'lostcity.tools.LoaderSig' - args = ['client/build/libs/client.jar'] -} diff --git a/tools/build.gradle.kts b/tools/build.gradle.kts new file mode 100644 index 00000000..3eb76642 --- /dev/null +++ b/tools/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + java +} + +tasks.withType { + options.encoding = "UTF-8" +} + +tasks.register("sig", JavaExec::class) { + mainClass = "lostcity.tools.LoaderSig" + classpath = sourceSets["main"].runtimeClasspath + workingDir = rootProject.projectDir + args = listOf("client/build/libs/client.jar") +} diff --git a/tools/src/main/java/lostcity/tools/LoaderSig.java b/tools/src/main/java/lostcity/tools/LoaderSig.java index aa8628e0..8a88b2dd 100644 --- a/tools/src/main/java/lostcity/tools/LoaderSig.java +++ b/tools/src/main/java/lostcity/tools/LoaderSig.java @@ -42,6 +42,7 @@ public static void main(String[] args) { Files.write(Paths.get("loader/build/libs/runescape" + uriSha + ".jar"), src); } catch (Exception ex) { ex.printStackTrace(); + System.exit(1); } } } \ No newline at end of file