Skip to content

Commit

Permalink
Move to name-proposal and update enigma/cfr (#2708)
Browse files Browse the repository at this point in the history
* Move to name-proposal and update enigma/cfr

* Update name-proposal

* Update name-proposal
  • Loading branch information
modmuss50 authored Sep 28, 2021
1 parent 2cecd75 commit 6637409
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 38 deletions.
42 changes: 10 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -731,22 +711,20 @@ 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 }

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()
)
}
}

Expand Down
6 changes: 3 additions & 3 deletions enigma_profile.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6637409

Please sign in to comment.