Remove RM 2.6+ for MC 1.7.10 from versions.json
This commit is contained in:
@@ -68,6 +68,12 @@ fun command(vararg cmd: Any): List<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun generateVersionsJson(): Map<String, Any> {
|
fun generateVersionsJson(): Map<String, Any> {
|
||||||
|
val versionComparator = compareBy<String>(
|
||||||
|
{ (it.split(".").getOrNull(0) ?: "0").toInt() },
|
||||||
|
{ (it.split(".").getOrNull(1) ?: "0").toInt() },
|
||||||
|
{ (it.split(".").getOrNull(2) ?: "0").toInt() }
|
||||||
|
)
|
||||||
|
|
||||||
// Find all tag-style releases by listing all tags
|
// Find all tag-style releases by listing all tags
|
||||||
val tagVersions = command("git", "for-each-ref", "--sort=taggerdate", "--format=%(refname:short)", "refs/tags")
|
val tagVersions = command("git", "for-each-ref", "--sort=taggerdate", "--format=%(refname:short)", "refs/tags")
|
||||||
|
|
||||||
@@ -85,6 +91,9 @@ fun generateVersionsJson(): Map<String, Any> {
|
|||||||
.filter { it != "core" }
|
.filter { it != "core" }
|
||||||
// Internal project used to automatically remap from Forge 1.12.2 to Fabric 1.14.4
|
// Internal project used to automatically remap from Forge 1.12.2 to Fabric 1.14.4
|
||||||
.filter { it != "1.14.4-forge" }
|
.filter { it != "1.14.4-forge" }
|
||||||
|
// We dropped 1.7.10 with the Gradle 7 update but still kept its source in case someone
|
||||||
|
// volunteers to update FG 1.2 to Gradle 7.
|
||||||
|
.filterNot { it == "1.7.10" && versionComparator.compare(version, "2.6.0") >= 0 }
|
||||||
mcVersions.map { "$it-$version" }
|
mcVersions.map { "$it-$version" }
|
||||||
}.flatten()
|
}.flatten()
|
||||||
|
|
||||||
@@ -92,11 +101,7 @@ fun generateVersionsJson(): Map<String, Any> {
|
|||||||
val mcVersions = versions
|
val mcVersions = versions
|
||||||
.map {it.substring(0, it.indexOf("-"))}
|
.map {it.substring(0, it.indexOf("-"))}
|
||||||
.distinct()
|
.distinct()
|
||||||
.sortedWith(compareBy(
|
.sortedWith(versionComparator)
|
||||||
{ (it.split(".").getOrNull(0) ?: "0").toInt() },
|
|
||||||
{ (it.split(".").getOrNull(1) ?: "0").toInt() },
|
|
||||||
{ (it.split(".").getOrNull(2) ?: "0").toInt() }
|
|
||||||
))
|
|
||||||
|
|
||||||
val promos = mutableMapOf<String, String>()
|
val promos = mutableMapOf<String, String>()
|
||||||
val root = mutableMapOf<String, Any>(
|
val root = mutableMapOf<String, Any>(
|
||||||
@@ -126,6 +131,14 @@ fun generateVersionsJson(): Map<String, Any> {
|
|||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val writeVersionsJson by tasks.registering {
|
||||||
|
doLast {
|
||||||
|
val versionsRoot = generateVersionsJson()
|
||||||
|
val versionsJson = JsonOutput.prettyPrint(JsonOutput.toJson(versionsRoot))
|
||||||
|
File("versions.json").writeText(versionsJson)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val doRelease by tasks.registering {
|
val doRelease by tasks.registering {
|
||||||
doLast {
|
doLast {
|
||||||
// Parse version
|
// Parse version
|
||||||
|
|||||||
Reference in New Issue
Block a user