From bc7ecce61cc3e55ff8934ffb9f9496877a0e2fff Mon Sep 17 00:00:00 2001 From: Pazaz Date: Wed, 20 Apr 2022 21:50:21 -0400 Subject: [PATCH] New gradle scripts to modularize the build process --- .gitignore | 1 + build.gradle | 50 ----------------------------------- client/build.gradle | 42 +++++++++++++++++++++++++++++ deob-annotations/build.gradle | 9 +++++++ settings.gradle | 16 +++++++++++ signlink/build.gradle | 14 ++++++++++ start.bat | 3 --- start.sh | 3 --- 8 files changed, 82 insertions(+), 56 deletions(-) create mode 100644 client/build.gradle create mode 100644 deob-annotations/build.gradle create mode 100644 settings.gradle create mode 100644 signlink/build.gradle delete mode 100644 start.bat delete mode 100644 start.sh diff --git a/.gitignore b/.gitignore index ba2c16c..2a2b3df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea/ .gradle/ +.vscode/ bin/ build/ diff --git a/build.gradle b/build.gradle index 01bf979..e69de29 100644 --- a/build.gradle +++ b/build.gradle @@ -1,50 +0,0 @@ -plugins { - id 'java' - id 'application' -} - -mainClassName = 'client' -version = '1.0.0' - -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - -repositories { - mavenCentral() - flatDir { - dirs 'lib' - } -} - -sourceSets { - main { - java { - srcDirs 'client' - srcDirs 'deob-annotations' - srcDirs 'signlink' - } - } -} - -compileJava.options.encoding = 'UTF-8' - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} - -dependencies { - implementation files( - 'lib/gluegen-rt.jar', 'lib/gluegen-rt-natives-windows-i586.jar', 'lib/gluegen-rt-natives-windows-amd64.jar', 'lib/gluegen-rt-natives-macosx-universal.jar', 'lib/gluegen-rt-natives-linux-i586.jar', 'lib/gluegen-rt-natives-linux-amd64.jar' - ) - - implementation files( - 'lib/jogl-all.jar', 'lib/jogl-all-natives-windows-i586.jar', 'lib/jogl-all-natives-windows-amd64.jar', 'lib/jogl-all-natives-macosx-universal.jar', 'lib/jogl-all-natives-linux-i586.jar', 'lib/jogl-all-natives-linux-amd64.jar' - ) -} - -jar { - manifest { - attributes 'Main-Class': 'client' - } - from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } -} diff --git a/client/build.gradle b/client/build.gradle new file mode 100644 index 0000000..2ae8153 --- /dev/null +++ b/client/build.gradle @@ -0,0 +1,42 @@ +plugins { + id 'java' + id 'application' +} + +mainClassName = 'client' +version = '1.0.0' + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +compileJava.options.encoding = 'UTF-8' + +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' +} + +dependencies { + compileOnly project(':deob-annotations') + implementation project(':signlink') + + implementation 'lib:gluegen-rt' + implementation 'lib:gluegen-rt-natives-windows-amd64' + implementation 'lib:gluegen-rt-natives-windows-i586' + implementation 'lib:gluegen-rt-natives-linux-amd64' + implementation 'lib:gluegen-rt-natives-linux-i586' + implementation 'lib:gluegen-rt-natives-macosx-universal' + + implementation 'lib:jogl-all' + implementation 'lib:jogl-all-natives-windows-amd64' + implementation 'lib:jogl-all-natives-windows-i586' + implementation 'lib:jogl-all-natives-linux-amd64' + implementation 'lib:jogl-all-natives-linux-i586' + implementation 'lib:jogl-all-natives-macosx-universal' +} + +jar { + manifest { + attributes 'Main-Class': "$mainClassName" + } + from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } +} diff --git a/deob-annotations/build.gradle b/deob-annotations/build.gradle new file mode 100644 index 0000000..534092f --- /dev/null +++ b/deob-annotations/build.gradle @@ -0,0 +1,9 @@ +plugins { + id 'java' + id 'java-library' +} + +version = '0.1.0' + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..0a48c52 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,16 @@ +rootProject.name = "rt4-client" + +dependencyResolutionManagement { + repositories { + mavenCentral() + flatDir { + dirs 'lib' + } + } +} + +include( + "deob-annotations", + "signlink", + "client" +) diff --git a/signlink/build.gradle b/signlink/build.gradle new file mode 100644 index 0000000..8f68f52 --- /dev/null +++ b/signlink/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'java-library' +} + +version = '1.0.0' + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +dependencies { + compileOnly project(':deob-annotations') + compileOnly 'lib:jogl-all' +} diff --git a/start.bat b/start.bat deleted file mode 100644 index 69a639a..0000000 --- a/start.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -call .\gradlew.bat build -java -jar .\build\libs\RT4-Client-1.0.0.jar 1 live english game0 diff --git a/start.sh b/start.sh deleted file mode 100644 index ecdccd0..0000000 --- a/start.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -./gradlew build -java -jar ./build/libs/RT4-Client-1.0.0.jar 1 live english game0