mirror of https://github.com/FabricMC/yarn.git
Update to Filament 0.3.0 (#2398)
This commit is contained in:
parent
0d0a71ba96
commit
1b024ab7c1
108
build.gradle
108
build.gradle
|
@ -23,7 +23,7 @@ plugins {
|
|||
id 'maven-publish'
|
||||
id 'java' // for jd gen
|
||||
id 'org.cadixdev.licenser' version '0.5.1'
|
||||
id 'net.fabricmc.filament' version '0.2.0'
|
||||
id 'net.fabricmc.filament' version '0.3.0'
|
||||
}
|
||||
|
||||
def minecraft_version = "21w19a"
|
||||
|
@ -637,99 +637,17 @@ task mapNamedJar(dependsOn: ["mergeV2", "unpickIntermediaryJar"]) {
|
|||
}
|
||||
}
|
||||
|
||||
import daomephsta.unpick.constantmappers.datadriven.parser.v2.UnpickV2Reader
|
||||
import daomephsta.unpick.constantmappers.datadriven.parser.v2.UnpickV2Writer
|
||||
import daomephsta.unpick.constantmappers.datadriven.parser.v2.UnpickV2Remapper
|
||||
import daomephsta.unpick.constantmappers.datadriven.parser.FieldKey
|
||||
import daomephsta.unpick.constantmappers.datadriven.parser.MethodKey
|
||||
import net.fabricmc.mapping.tree.TinyMappingFactory
|
||||
|
||||
// Merge all of the unpick definitions into a single file to be shipped
|
||||
task combineUnpickDefinitions(type : FileOutput) {
|
||||
output = new File(tempDir, "definitions.unpick")
|
||||
outputs.upToDateWhen { false }
|
||||
group "unpick"
|
||||
|
||||
doFirst {
|
||||
output.delete()
|
||||
}
|
||||
|
||||
doLast {
|
||||
def writer = new UnpickV2Writer()
|
||||
|
||||
file("unpick-definitions").eachFile {
|
||||
if (!it.name.endsWith(".unpick")) {
|
||||
return
|
||||
}
|
||||
|
||||
it.withInputStream {
|
||||
new UnpickV2Reader(it).withCloseable {
|
||||
it.accept(writer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output.text = writer.output
|
||||
}
|
||||
combineUnpickDefinitions {
|
||||
group = 'unpick'
|
||||
input = file('unpick-definitions')
|
||||
output = new File(tempDir, 'definitions.unpick')
|
||||
}
|
||||
|
||||
task remapUnpickDefinitionsIntermediary(type : FileOutputInput, dependsOn: [combineUnpickDefinitions, buildYarnTiny]) {
|
||||
output = new File(tempDir, "intermediary-definitions.unpick")
|
||||
input = combineUnpickDefinitions.output
|
||||
File mappingsInput = buildYarnTiny.v2Output
|
||||
|
||||
outputs.upToDateWhen { false }
|
||||
group "unpick"
|
||||
|
||||
doFirst {
|
||||
output.delete()
|
||||
}
|
||||
|
||||
doLast {
|
||||
def classMappings = [:]
|
||||
def methodMappings = [:]
|
||||
def fieldMappings = [:]
|
||||
|
||||
mappingsInput.withReader {reader ->
|
||||
def tinyTree = TinyMappingFactory.loadWithDetection(reader)
|
||||
|
||||
tinyTree.classes.each { classDef ->
|
||||
classMappings.put(
|
||||
classDef.getName("named"),
|
||||
classDef.getName("intermediary")
|
||||
)
|
||||
|
||||
classDef.methods.each { methodDef ->
|
||||
methodMappings.put(
|
||||
new MethodKey(
|
||||
classDef.getName("named"),
|
||||
methodDef.getName("named"),
|
||||
methodDef.getDescriptor("named")
|
||||
),
|
||||
methodDef.getName("intermediary")
|
||||
)
|
||||
}
|
||||
|
||||
classDef.fields.forEach { fieldDef ->
|
||||
fieldMappings.put(
|
||||
new FieldKey(
|
||||
classDef.getName("named"),
|
||||
fieldDef.getName("named")
|
||||
),
|
||||
fieldDef.getName("intermediary")
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input.withInputStream {
|
||||
new UnpickV2Reader(it).withCloseable {reader ->
|
||||
def writer = new UnpickV2Writer()
|
||||
reader.accept(new UnpickV2Remapper(classMappings, methodMappings, fieldMappings, writer))
|
||||
output.text = writer.output
|
||||
}
|
||||
}
|
||||
}
|
||||
remapUnpickDefinitionsIntermediary {
|
||||
dependsOn buildYarnTiny
|
||||
group = 'unpick'
|
||||
output = new File(tempDir, 'intermediary-definitions.unpick')
|
||||
mappings = buildYarnTiny.v2Output
|
||||
}
|
||||
|
||||
task unpickIntermediaryJar(type: JavaExec, dependsOn: [mapIntermediaryJar, "constantsJar", remapUnpickDefinitionsIntermediary]) {
|
||||
|
@ -741,7 +659,7 @@ task unpickIntermediaryJar(type: JavaExec, dependsOn: [mapIntermediaryJar, "cons
|
|||
classpath configurations.unpick
|
||||
|
||||
doFirst {
|
||||
args intermediaryJar.absolutePath, unpickedJar.absolutePath, remapUnpickDefinitionsIntermediary.output.absolutePath, constantsJar.archiveFile.get().asFile.absolutePath
|
||||
args intermediaryJar.absolutePath, unpickedJar.absolutePath, remapUnpickDefinitionsIntermediary.output.get().asFile.absolutePath, constantsJar.archiveFile.get().asFile.absolutePath
|
||||
|
||||
configurations.decompileClasspath.files.each {
|
||||
args it.absolutePath
|
||||
|
@ -853,7 +771,7 @@ task v2UnmergedYarnJar(dependsOn: [insertAutoGeneratedEnumMappings, combineUnpic
|
|||
rename mappings.name, "mappings/mappings.tiny"
|
||||
}
|
||||
from(combineUnpickDefinitions.output) {
|
||||
rename combineUnpickDefinitions.output.name, "extras/definitions.unpick"
|
||||
rename combineUnpickDefinitions.output.get().asFile.name, "extras/definitions.unpick"
|
||||
}
|
||||
from (file(unpickMetaFile)) {
|
||||
expand version: project.unpick_version
|
||||
|
@ -872,7 +790,7 @@ task v2MergedYarnJar(dependsOn: ["mergeV2"], type: Jar) {
|
|||
rename mappings.name, "mappings/mappings.tiny"
|
||||
}
|
||||
from(combineUnpickDefinitions.output) {
|
||||
rename combineUnpickDefinitions.output.name, "extras/definitions.unpick"
|
||||
rename combineUnpickDefinitions.output.get().asFile.name, "extras/definitions.unpick"
|
||||
}
|
||||
from (file(unpickMetaFile)) {
|
||||
expand version: project.unpick_version
|
||||
|
|
Loading…
Reference in New Issue