mirror of
https://github.com/wisplite/crystalline-sky.git
synced 2026-10-30 13:32:18 -05:00
hopefully fix mapping stack IV
gradle-native mappings converter
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
import net.fabricmc.mappingio.adapter.MappingDstNsReorder
|
||||
import net.fabricmc.mappingio.adapter.MappingSourceNsSwitch
|
||||
import net.fabricmc.mappingio.format.tiny.Tiny2FileReader
|
||||
import net.fabricmc.mappingio.format.tiny.Tiny2FileWriter
|
||||
import net.fabricmc.mappingio.tree.MemoryMappingTree
|
||||
import java.io.FileReader
|
||||
import java.io.FileWriter
|
||||
|
||||
architectury.neoForge()
|
||||
|
||||
val inCI = rootProject.extra["inCI"] as Boolean
|
||||
@@ -40,6 +48,36 @@ dependencies {
|
||||
implementation(include(libs.mixinextras.neoforge.get())!!)!!
|
||||
}
|
||||
|
||||
tasks.register("updateStrippedMappings") {
|
||||
group = "other"
|
||||
description = "Convert official->[intermediary, named] custom_mappings.tiny to a intermediary->named version for neoforge"
|
||||
|
||||
val inputFile = rootProject.file("custom_mappings.tiny")
|
||||
val outputFile = rootProject.file("custom_mappings_stripped.tiny")
|
||||
|
||||
inputs.file(inputFile)
|
||||
outputs.file(outputFile)
|
||||
|
||||
doLast {
|
||||
val tree = MemoryMappingTree()
|
||||
val transformer = MappingSourceNsSwitch(
|
||||
MappingDstNsReorder(
|
||||
tree,
|
||||
"named"
|
||||
),
|
||||
"intermediary"
|
||||
)
|
||||
FileReader(inputFile).use { reader ->
|
||||
Tiny2FileReader.read(reader, transformer)
|
||||
}
|
||||
|
||||
outputFile.parentFile.mkdirs()
|
||||
FileWriter(outputFile).use { writer ->
|
||||
tree.accept(Tiny2FileWriter(writer, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
operator fun String.invoke(): String {
|
||||
return rootProject.ext[this] as? String
|
||||
?: throw IllegalStateException("Property $this is not defined")
|
||||
|
||||
Reference in New Issue
Block a user