From e76b3561bf60f62afcf4a4d667492beb85f35f85 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:45:08 +0200 Subject: Revert "Backend: Add unimined build system (#1456)" This reverts commit 40309bc8acb7afb37bbc99d7a758c24ffd962b4c. --- buildSrc/build.gradle.kts | 18 -------------- buildSrc/src/AutoMixinDiscovery.kt | 50 -------------------------------------- buildSrc/src/EnvFile.kt | 12 --------- 3 files changed, 80 deletions(-) delete mode 100644 buildSrc/build.gradle.kts delete mode 100644 buildSrc/src/AutoMixinDiscovery.kt delete mode 100644 buildSrc/src/EnvFile.kt (limited to 'buildSrc') diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index 15870b3ce..000000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,18 +0,0 @@ - -plugins { - `kotlin-dsl` - kotlin("jvm")version "1.8.10" -} -repositories { - mavenCentral() -} - -dependencies { - implementation("com.google.code.gson:gson:2.10.1") -} - -sourceSets.main { - kotlin { - srcDir(file("src")) - } -} diff --git a/buildSrc/src/AutoMixinDiscovery.kt b/buildSrc/src/AutoMixinDiscovery.kt deleted file mode 100644 index f66229030..000000000 --- a/buildSrc/src/AutoMixinDiscovery.kt +++ /dev/null @@ -1,50 +0,0 @@ -import com.google.gson.GsonBuilder -import com.google.gson.JsonArray -import com.google.gson.JsonObject -import com.google.gson.JsonPrimitive -import org.apache.tools.ant.filters.BaseParamFilterReader -import org.gradle.api.file.FileCopyDetails -import org.gradle.api.tasks.SourceSet -import java.io.File -import java.io.Reader -import java.io.StringReader - -class MixinFilterReader(reader: Reader) : BaseParamFilterReader() { - lateinit var sourceRoots: Collection - val gson = GsonBuilder().setPrettyPrinting().create() - val betterReader: StringReader by lazy { - StringReader(run { - val json = gson.fromJson(reader.readText(), JsonObject::class.java) - val mixinPackage = (json["package"] as JsonPrimitive).asString - val allMixins = (json["mixins"] as JsonArray?)?.map { it.asString }?.toMutableSet() ?: mutableSetOf() - sourceRoots - .forEach { base -> - base.walk() - .filter { it.isFile } - .forEach { - val relativeString = it.toRelativeString(base).replace("\\", "/") - if (relativeString.startsWith(mixinPackage.replace(".", "/") + "/") - && relativeString.endsWith(".java") - && it.readText().contains("@Mixin") - ) - allMixins.add( - relativeString.replace("/", ".").dropLast(5).drop(mixinPackage.length + 1) - ) - } - } - json.add("mixins", JsonArray().also { jsonAllMixins -> - allMixins.forEach { jsonAllMixins.add(it) } - }) - gson.toJson(json) - }) - - } - - override fun read(): Int { - return betterReader.read() - } -} - -fun FileCopyDetails.autoDiscoverMixins(sourceSet: SourceSet) { - filter(mapOf("sourceRoots" to sourceSet.allSource.srcDirs), MixinFilterReader::class.java) -} diff --git a/buildSrc/src/EnvFile.kt b/buildSrc/src/EnvFile.kt deleted file mode 100644 index 76d6fa959..000000000 --- a/buildSrc/src/EnvFile.kt +++ /dev/null @@ -1,12 +0,0 @@ -import java.io.File - -fun parseEnvFile(file: File): Map { - if (!file.exists()) return mapOf() - val map = mutableMapOf() - for (line in file.readText().lines()) { - if (line.isEmpty() || line.startsWith("#")) continue - val parts = line.split("=", limit = 2) - map[parts[0]] = parts.getOrNull(1) ?: "" - } - return map -} -- cgit