From 5316e8da17c67247a08db6d00be962b2b80329e0 Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Mon, 5 Aug 2024 19:43:31 +0200 Subject: [PATCH] Minimize build setup --- build.gradle | 18 ++++++++++++------ gradle.properties | 1 - viaforge-mc1122/build.gradle | 4 ---- viaforge-mc1122/gradle.properties | 3 +-- viaforge-mc1165/build.gradle | 7 ------- viaforge-mc1165/gradle.properties | 3 +-- viaforge-mc1171/build.gradle | 7 ------- viaforge-mc1171/gradle.properties | 3 +-- viaforge-mc1182/build.gradle | 7 ------- viaforge-mc1182/gradle.properties | 3 +-- viaforge-mc1192/build.gradle | 7 ------- viaforge-mc1192/gradle.properties | 3 +-- viaforge-mc1194/build.gradle | 7 ------- viaforge-mc1194/gradle.properties | 3 +-- viaforge-mc1204/build.gradle | 7 ------- viaforge-mc1204/gradle.properties | 3 +-- 16 files changed, 19 insertions(+), 67 deletions(-) delete mode 100644 viaforge-mc1165/build.gradle delete mode 100644 viaforge-mc1171/build.gradle delete mode 100644 viaforge-mc1182/build.gradle delete mode 100644 viaforge-mc1192/build.gradle delete mode 100644 viaforge-mc1194/build.gradle delete mode 100644 viaforge-mc1204/build.gradle diff --git a/build.gradle b/build.gradle index 7657edf7..4dc52212 100644 --- a/build.gradle +++ b/build.gradle @@ -83,16 +83,21 @@ subprojects { // Define the jar output attributes for all platforms base { group = project.maven_group - archivesName = project.maven_name + archivesName = project.name version = project.maven_version } + def mcVersion = project.forge_version.split("-")[0] + // Used to execute code only for specific submodules - def versionId = Integer.parseInt(project.mc_version.replace(".", "")) + def versionId = Integer.parseInt(mcVersion.replace(".", "")) compileJava.options.encoding = "UTF-8" minecraft { + if (versionId >= 1_16_5) { + mappings channel: "official", version: mcVersion + } runs { client { workingDirectory project.file("run") @@ -104,11 +109,11 @@ subprojects { property "mixin.debug.export", "true" property "mixin.hotSwap", "true" property "fml.coreMods.load", "de.florianmichael.viaforge.mixin.MixinLoader" // Only required for MC 1.12, but modern Forges skips this anyway - args "-mixin.config=" + "mixins." + project.getProperty('maven_name') + ".json" + args "-mixin.config=" + "mixins." + project.getProperty('name') + ".json" // source set mods { - "${project.maven_name}" { + "${project.name}" { source sourceSets.main } } @@ -121,6 +126,7 @@ subprojects { } dependencies { + minecraft "net.minecraftforge:forge:${forge_version}" if (versionId >= 1_17_1) { // Minecraft 1.17+ already includes slf4j, so we don't need to include it compileOnly "org.slf4j:slf4j-api:${slf4j_version}" @@ -135,7 +141,7 @@ subprojects { } mixin { - add sourceSets.main, "mixins.${project.maven_name}.refmap.json" + add sourceSets.main, "mixins.${project.name}.refmap.json" } jar { @@ -151,7 +157,7 @@ subprojects { "TweakOrder": "0", "FMLCorePluginContainsFMLMod": "true", // Only required for MC 1.12, but modern Forges skips this anyway "FMLCorePlugin": "de.florianmichael.viaforge.mixin.MixinLoader", // Counterpart to the above - "MixinConfigs": "mixins.${project.maven_name}.json", + "MixinConfigs": "mixins.${project.name}.json", "ForceLoadAsMod": "true" ) enabled = false diff --git a/gradle.properties b/gradle.properties index 24504037..58d25570 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,5 @@ org.gradle.daemon=false maven_group=de.florianmichael maven_version=3.7.1-SNAPSHOT -# Should be ignored by dependabot slf4j_version=2.0.7 mixin_version=0.8.3 diff --git a/viaforge-mc1122/build.gradle b/viaforge-mc1122/build.gradle index 8d86795a..7c35047a 100644 --- a/viaforge-mc1122/build.gradle +++ b/viaforge-mc1122/build.gradle @@ -1,7 +1,3 @@ minecraft { mappings channel: "stable", version: "39-1.12" } - -dependencies { - minecraft "net.minecraftforge:forge:1.12.2-14.23.5.2859" -} diff --git a/viaforge-mc1122/gradle.properties b/viaforge-mc1122/gradle.properties index 94fdc34d..b3e34325 100644 --- a/viaforge-mc1122/gradle.properties +++ b/viaforge-mc1122/gradle.properties @@ -1,2 +1 @@ -maven_name=viaforge-mc1122 -mc_version=1.12.2 +forge_version=1.12.2-14.23.5.2859 \ No newline at end of file diff --git a/viaforge-mc1165/build.gradle b/viaforge-mc1165/build.gradle deleted file mode 100644 index bbba2246..00000000 --- a/viaforge-mc1165/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -minecraft { - mappings channel: "official", version: "1.16.5" -} - -dependencies { - minecraft "net.minecraftforge:forge:1.16.5-36.2.39" -} diff --git a/viaforge-mc1165/gradle.properties b/viaforge-mc1165/gradle.properties index 09ac20d4..3a3bd181 100644 --- a/viaforge-mc1165/gradle.properties +++ b/viaforge-mc1165/gradle.properties @@ -1,2 +1 @@ -maven_name=viaforge-mc1165 -mc_version=1.16.5 +forge_version=1.16.5-36.2.39 \ No newline at end of file diff --git a/viaforge-mc1171/build.gradle b/viaforge-mc1171/build.gradle deleted file mode 100644 index 2ed7ce9a..00000000 --- a/viaforge-mc1171/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -minecraft { - mappings channel: "official", version: "1.17.1" -} - -dependencies { - minecraft "net.minecraftforge:forge:1.17.1-37.1.1" -} diff --git a/viaforge-mc1171/gradle.properties b/viaforge-mc1171/gradle.properties index 7e58d075..94025068 100644 --- a/viaforge-mc1171/gradle.properties +++ b/viaforge-mc1171/gradle.properties @@ -1,2 +1 @@ -maven_name=viaforge-mc1171 -mc_version=1.17.1 +forge_version=1.17.1-37.1.1 \ No newline at end of file diff --git a/viaforge-mc1182/build.gradle b/viaforge-mc1182/build.gradle deleted file mode 100644 index 7ac4a6b8..00000000 --- a/viaforge-mc1182/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -minecraft { - mappings channel: "official", version: "1.18.2" -} - -dependencies { - minecraft "net.minecraftforge:forge:1.18.2-40.2.0" -} diff --git a/viaforge-mc1182/gradle.properties b/viaforge-mc1182/gradle.properties index 49502c15..2d6587c4 100644 --- a/viaforge-mc1182/gradle.properties +++ b/viaforge-mc1182/gradle.properties @@ -1,2 +1 @@ -maven_name=viaforge-mc1182 -mc_version=1.18.2 +forge_version=1.18.2-40.2.0 \ No newline at end of file diff --git a/viaforge-mc1192/build.gradle b/viaforge-mc1192/build.gradle deleted file mode 100644 index 3b1614fa..00000000 --- a/viaforge-mc1192/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -minecraft { - mappings channel: "official", version: "1.19.2" -} - -dependencies { - minecraft "net.minecraftforge:forge:1.19.2-43.4.2" -} diff --git a/viaforge-mc1192/gradle.properties b/viaforge-mc1192/gradle.properties index 59bb8340..b59a32b6 100644 --- a/viaforge-mc1192/gradle.properties +++ b/viaforge-mc1192/gradle.properties @@ -1,2 +1 @@ -maven_name=viaforge-mc1192 -mc_version=1.19.2 +forge_version=1.19.2-43.4.2 \ No newline at end of file diff --git a/viaforge-mc1194/build.gradle b/viaforge-mc1194/build.gradle deleted file mode 100644 index c33c9229..00000000 --- a/viaforge-mc1194/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -minecraft { - mappings channel: "official", version: "1.19.4" -} - -dependencies { - minecraft "net.minecraftforge:forge:1.19.4-45.2.0" -} diff --git a/viaforge-mc1194/gradle.properties b/viaforge-mc1194/gradle.properties index d3628093..0b339e59 100644 --- a/viaforge-mc1194/gradle.properties +++ b/viaforge-mc1194/gradle.properties @@ -1,2 +1 @@ -maven_name=viaforge-mc1194 -mc_version=1.19.4 +forge_version=1.19.4-45.2.0 \ No newline at end of file diff --git a/viaforge-mc1204/build.gradle b/viaforge-mc1204/build.gradle deleted file mode 100644 index 200b3f9b..00000000 --- a/viaforge-mc1204/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -minecraft { - mappings channel: "official", version: "1.20.4" -} - -dependencies { - minecraft "net.minecraftforge:forge:1.20.4-49.0.13" -} diff --git a/viaforge-mc1204/gradle.properties b/viaforge-mc1204/gradle.properties index 88106405..5b522361 100644 --- a/viaforge-mc1204/gradle.properties +++ b/viaforge-mc1204/gradle.properties @@ -1,2 +1 @@ -maven_name=viaforge-mc1204 -mc_version=1.20.4 +forge_version=1.20.4-49.0.13 \ No newline at end of file