Update Forge mods.toml automatically

This commit is contained in:
shedaniel
2022-06-16 18:44:13 +08:00
parent a22b7fc18d
commit 17735f090b
3 changed files with 42 additions and 2 deletions

View File

@@ -149,3 +149,14 @@ unifiedPublishing {
}
}
}
// Update mods.toml with the new versions automatically
// Not using processResources because it is easier to do this manually, and see it reflected immediately
afterEvaluate {
file("src/main/resources/META-INF/mods.toml").withOutputStream {
it << file("mods.toml").text
.replaceAll("@LOADER_MAJOR@", rootProject.forge_version.split("\\.")[0])
.replaceAll("@MINECRAFT_VERSION@", rootProject.architectury.minecraft)
.replaceAll("@FORGE_VERSION@", rootProject.forge_version)
}
}

29
forge/mods.toml Normal file
View File

@@ -0,0 +1,29 @@
modLoader = "javafml"
loaderVersion = "[@LOADER_MAJOR@,)"
issueTrackerURL = "https://github.com/shedaniel/architectury/issues"
license = "GNU LGPLv3"
[[mods]]
modId = "architectury"
version = "${version}"
displayName = "Architectury"
authors = "shedaniel"
description = '''
A intermediary api aimed to ease developing multiplatform mods.
'''
logoFile = "icon.png"
license = "LGPL-3"
[[dependencies.architectury]]
modId = "minecraft"
mandatory = true
versionRange = "[@MINECRAFT_VERSION@,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.architectury]]
modId = "forge"
mandatory = true
versionRange = "[@FORGE_VERSION@,)"
ordering = "NONE"
side = "BOTH"

View File

@@ -1,5 +1,5 @@
modLoader = "javafml"
loaderVersion = "[38,)"
loaderVersion = "[40,)"
issueTrackerURL = "https://github.com/shedaniel/architectury/issues"
license = "GNU LGPLv3"
@@ -24,6 +24,6 @@ side = "BOTH"
[[dependencies.architectury]]
modId = "forge"
mandatory = true
versionRange = "[38.0.17,)"
versionRange = "[40.1.14,)"
ordering = "NONE"
side = "BOTH"