From d1aa6253976b0a5224ecf5008b52ba33f46bde5e Mon Sep 17 00:00:00 2001 From: Graham Date: Fri, 8 May 2020 17:29:42 +0100 Subject: [PATCH] Move build.gradle.kts files out of the nonfree repository This allows users to compile and run the deobfuscator's output without access to the nonfree repository. It will be particularly useful when the deobfuscator can make use of the deob-map files. Signed-off-by: Graham --- build.gradle.kts | 75 +++++++++++++++++++++++++++++++++++++++++++++ settings.gradle.kts | 21 +++++-------- 2 files changed, 82 insertions(+), 14 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a510b88f..b1724ae2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -306,3 +306,78 @@ tasks.dokka { tasks.wrapper { distributionType = Wrapper.DistributionType.ALL } + +configure(project(":nonfree").subprojects) { + plugins.withType { + dependencies { + val annotationProcessor by configurations + annotationProcessor(project(":deob-processor")) + + val compileOnly by configurations + compileOnly(project(":deob-annotations")) + } + + tasks.named("compileJava") { + options.compilerArgs = listOf("-Amap=${project.rootDir}/share/deob-map/${project.name}.yaml") + } + } +} + +project(":nonfree") { + apply(plugin = "base") +} + +project(":nonfree:client") { + apply(plugin = "application") + + configure { + mainClassName = "client" + } + + tasks.named("run") { + args("1", "live", "en", "game0") + } + + plugins.withType { + dependencies { + val implementation by configurations + implementation(project(":nonfree:gl")) + implementation(project(":nonfree:signlink")) + } + } +} + +project(":nonfree:gl") { + apply(plugin = "java-library") +} + +project(":nonfree:loader") { + apply(plugin = "java") + + plugins.withType { + dependencies { + val implementation by configurations + implementation(project(":nonfree:signlink")) + implementation(project(":nonfree:unpack")) + } + } +} + +project(":nonfree:signlink") { + apply(plugin = "java-library") +} + +project(":nonfree:unpack") { + apply(plugin = "java-library") +} + +project(":nonfree:unpackclass") { + apply(plugin = "java-library") + + plugins.withType { + dependencies { + val implementation by configurations + implementation(project(":nonfree:unpack")) + } + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 11032624..a75bb57e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,3 @@ -import java.nio.file.Files - rootProject.name = "openrs2" include( @@ -19,18 +17,13 @@ include( "deob-map", "deob-processor", "game", + "nonfree", + "nonfree:client", + "nonfree:gl", + "nonfree:loader", + "nonfree:signlink", + "nonfree:unpack", + "nonfree:unpackclass", "util", "yaml" ) - -if (Files.exists(rootProject.projectDir.toPath().resolve("nonfree/build.gradle.kts"))) { - include( - "nonfree", - "nonfree:client", - "nonfree:gl", - "nonfree:loader", - "nonfree:signlink", - "nonfree:unpack", - "nonfree:unpackclass" - ) -}