From 66374095feeac0c898c9d1bc7eee2c7490ccb21e Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Tue, 28 Sep 2021 16:17:36 +0100 Subject: [PATCH] Move to name-proposal and update enigma/cfr (#2708) * Move to name-proposal and update enigma/cfr * Update name-proposal * Update name-proposal --- build.gradle | 42 ++++++++++-------------------------------- enigma_profile.json | 6 +++--- gradle.properties | 7 ++++--- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/build.gradle b/build.gradle index 2e58e16522..4b8ec931ed 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,7 @@ buildscript { classpath 'net.fabricmc:tiny-remapper:0.6.0' classpath "net.fabricmc.unpick:unpick:${project.unpick_version}" classpath "net.fabricmc.unpick:unpick-format-utils:${project.unpick_version}" + classpath "net.fabricmc:name-proposal:${project.name_proposal_version}" } } @@ -73,7 +74,7 @@ def unpickMetaFile = file("unpick-definitions/unpick.json") dependencies { enigmaRuntime "cuchaz:enigma-swing:${project.enigma_version}:all" - enigmaRuntime "net.fabricmc:stitch:${project.stitch_version}" + enigmaRuntime "net.fabricmc:name-proposal:${project.name_proposal_version}" javadocClasspath "net.fabricmc:fabric-loader:${project.fabric_loader_version}" javadocClasspath "org.jetbrains:annotations:${project.jetbrains_annotations_version}" javadocClasspath "com.google.code.findbugs:jsr305:3.0.2" // for some other jsr annotations @@ -108,16 +109,15 @@ import cuchaz.enigma.command.MapSpecializedMethodsCommand import groovy.io.FileType import groovy.json.JsonSlurper import net.fabricmc.stitch.commands.CommandMergeTiny -import net.fabricmc.stitch.commands.CommandProposeFieldNames import net.fabricmc.stitch.commands.CommandReorderTiny import net.fabricmc.stitch.commands.CommandRewriteIntermediary import net.fabricmc.stitch.commands.tinyv2.CommandMergeTinyV2 -import net.fabricmc.stitch.commands.tinyv2.CommandProposeV2FieldNames import net.fabricmc.stitch.commands.tinyv2.CommandReorderTinyV2 import net.fabricmc.stitch.merge.JarMerger import net.fabricmc.tinyremapper.OutputConsumerPath import net.fabricmc.tinyremapper.TinyRemapper import net.fabricmc.tinyremapper.TinyUtils +import net.fabricmc.nameproposal.MappingNameCompleter import org.apache.commons.io.FileUtils import org.objectweb.asm.ClassVisitor import org.objectweb.asm.FieldVisitor @@ -618,26 +618,6 @@ task importMappingsOfficial(dependsOn: invertIntermediary) { } } -task buildTinyWithEnum(dependsOn: "mergeTiny", type: FileOutput) { - group = buildMappingGroup - def noEnum = mergeTiny.output - output = new File(tempDir, "named-with-enum.tiny") - - outputs.file(output) - outputs.upToDateWhen { false } - - doLast { - logger.lifecycle(":seeking auto-mappable fields") - String[] argsPropose = [ - mergedFile.getAbsolutePath(), // must use official jar - noEnum.getAbsolutePath(), - output.getAbsolutePath() - ] - - new CommandProposeFieldNames().run(argsPropose) - } -} - task mapNamedJar(dependsOn: ["mergeV2", "unpickIntermediaryJar"]) { group = mapJarGroup inputs.files downloadMcLibs.outputs.files.files @@ -731,7 +711,7 @@ build.dependsOn constantsJar task insertAutoGeneratedEnumMappings(dependsOn : [buildYarnTiny,mapIntermediaryJar], type : FileOutput){ group = buildMappingGroup - def noEnumV2 = buildYarnTiny.v2Output + File noEnumV2 = buildYarnTiny.v2Output output = new File(tempDir, "unmerged-named-v2-with-enum.tiny") outputs.upToDateWhen { false } @@ -739,14 +719,12 @@ task insertAutoGeneratedEnumMappings(dependsOn : [buildYarnTiny,mapIntermediaryJ doLast { logger.lifecycle(":seeking auto-mappable fields for unmerged mappings") - String[] argsProposeV2 = [ - intermediaryJar.getAbsolutePath(), // must use intermediary jar - noEnumV2.getAbsolutePath(), - output.getAbsolutePath(), - "false" // don't replace existing names right now - ] - - new CommandProposeV2FieldNames().run(argsProposeV2) + MappingNameCompleter.completeNames( + intermediaryJar.toPath(), + noEnumV2.toPath(), + downloadIntermediary.dest.toPath(), + output.toPath() + ) } } diff --git a/enigma_profile.json b/enigma_profile.json index 65c8901871..fb9a5b26aa 100644 --- a/enigma_profile.json +++ b/enigma_profile.json @@ -1,13 +1,13 @@ { "services" : { "name_proposal": { - "id": "stitch:name_proposal" + "id": "nameproposal:name_proposal" }, "jar_indexer": { - "id": "stitch:jar_indexer" + "id": "nameproposal:jar_indexer" }, "obfuscation_test": { - "id": "stitch:intermediary_obfuscation_test", + "id": "nameproposal:intermediary_obfuscation_test", "args": {} } } diff --git a/gradle.properties b/gradle.properties index 1b8f8a4d3b..703ac396b8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,13 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G -enigma_version=1.4.2 +enigma_version=1.4.5 stitch_version=0.6.1 unpick_version=2.2.0 -cfr_version=0.0.6 +cfr_version=0.0.7 +name_proposal_version=0.1.2 # Javadoc generation/linking fabric_loader_version=0.11.6 -jetbrains_annotations_version=21.0.1 +jetbrains_annotations_version=22.0.0 mappingpoet_version=0.2.10