From b5cbe3ea70f1143cd563f247c06793c572f1619c Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 27 Jun 2020 16:47:16 +0100 Subject: [PATCH] Add class for tracking dependencies between modules Signed-off-by: Graham --- .../main/java/dev/openrs2/deob/util/Module.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 deob-util/src/main/java/dev/openrs2/deob/util/Module.kt diff --git a/deob-util/src/main/java/dev/openrs2/deob/util/Module.kt b/deob-util/src/main/java/dev/openrs2/deob/util/Module.kt new file mode 100644 index 0000000000..c8c96d122f --- /dev/null +++ b/deob-util/src/main/java/dev/openrs2/deob/util/Module.kt @@ -0,0 +1,21 @@ +package dev.openrs2.deob.util + +import java.nio.file.Path +import java.nio.file.Paths + +class Module(val name: String, val dependencies: Set = emptySet()) { + val jar: Path = Paths.get("nonfree/var/cache/deob").resolve("$name.jar") + val sources: Path = Paths.get("nonfree").resolve(name).resolve("src/main/java") + val transitiveDependencies: Set = dependencies.plus(dependencies.flatMap { it.transitiveDependencies }) + + companion object { + private val gl = Module("gl") + private val signlink = Module("signlink") + private val unpack = Module("unpack") + private val client = Module("client", setOf(gl, signlink)) + private val loader = Module("loader", setOf(signlink, unpack)) + private val unpackClass = Module("unpackclass", setOf(unpack)) + + val all = setOf(client, gl, loader, signlink, unpack, unpackClass) + } +}