Minimize build setup

This commit is contained in:
FlorianMichael 2024-08-05 19:43:31 +02:00
parent 1bc0f9f646
commit 5316e8da17
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
16 changed files with 19 additions and 67 deletions

View File

@ -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

View File

@ -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

View File

@ -1,7 +1,3 @@
minecraft {
mappings channel: "stable", version: "39-1.12"
}
dependencies {
minecraft "net.minecraftforge:forge:1.12.2-14.23.5.2859"
}

View File

@ -1,2 +1 @@
maven_name=viaforge-mc1122
mc_version=1.12.2
forge_version=1.12.2-14.23.5.2859

View File

@ -1,7 +0,0 @@
minecraft {
mappings channel: "official", version: "1.16.5"
}
dependencies {
minecraft "net.minecraftforge:forge:1.16.5-36.2.39"
}

View File

@ -1,2 +1 @@
maven_name=viaforge-mc1165
mc_version=1.16.5
forge_version=1.16.5-36.2.39

View File

@ -1,7 +0,0 @@
minecraft {
mappings channel: "official", version: "1.17.1"
}
dependencies {
minecraft "net.minecraftforge:forge:1.17.1-37.1.1"
}

View File

@ -1,2 +1 @@
maven_name=viaforge-mc1171
mc_version=1.17.1
forge_version=1.17.1-37.1.1

View File

@ -1,7 +0,0 @@
minecraft {
mappings channel: "official", version: "1.18.2"
}
dependencies {
minecraft "net.minecraftforge:forge:1.18.2-40.2.0"
}

View File

@ -1,2 +1 @@
maven_name=viaforge-mc1182
mc_version=1.18.2
forge_version=1.18.2-40.2.0

View File

@ -1,7 +0,0 @@
minecraft {
mappings channel: "official", version: "1.19.2"
}
dependencies {
minecraft "net.minecraftforge:forge:1.19.2-43.4.2"
}

View File

@ -1,2 +1 @@
maven_name=viaforge-mc1192
mc_version=1.19.2
forge_version=1.19.2-43.4.2

View File

@ -1,7 +0,0 @@
minecraft {
mappings channel: "official", version: "1.19.4"
}
dependencies {
minecraft "net.minecraftforge:forge:1.19.4-45.2.0"
}

View File

@ -1,2 +1 @@
maven_name=viaforge-mc1194
mc_version=1.19.4
forge_version=1.19.4-45.2.0

View File

@ -1,7 +0,0 @@
minecraft {
mappings channel: "official", version: "1.20.4"
}
dependencies {
minecraft "net.minecraftforge:forge:1.20.4-49.0.13"
}

View File

@ -1,2 +1 @@
maven_name=viaforge-mc1204
mc_version=1.20.4
forge_version=1.20.4-49.0.13