Skip to content

Commit

Permalink
update mio, qloader, vf, cfr, proguard
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed Jul 17, 2024
1 parent b979396 commit 71fe7aa
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.fabricmc.mappingio.MappedElementKind;
import net.fabricmc.mappingio.MappingVisitor;
import net.fabricmc.mappingio.adapter.ForwardingMappingVisitor;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.util.Arrays;
Expand Down Expand Up @@ -112,10 +113,10 @@ public boolean visitMethodArg(int argPosition, int lvIndex, String srcName) thro
}

@Override
public boolean visitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, String srcName) throws IOException {
public boolean visitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, int endOpIdx, @Nullable String srcName) throws IOException {
this.srcName = srcName;

return super.visitMethodVar(lvtRowIndex, lvIndex, startOpIdx, srcName);
return super.visitMethodVar(lvtRowIndex, lvIndex, startOpIdx, endOpIdx, srcName);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.fabricmc.mappingio.MappedElementKind;
import net.fabricmc.mappingio.MappingVisitor;
import net.fabricmc.mappingio.adapter.ForwardingMappingVisitor;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.util.Arrays;
Expand Down Expand Up @@ -119,10 +120,10 @@ public boolean visitMethodArg(int argPosition, int lvIndex, String srcName) thro
}

@Override
public boolean visitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, String srcName) throws IOException {
public boolean visitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, int endOpIdx, @Nullable String srcName) throws IOException {
this.srcName = srcName;

return super.visitMethodVar(lvtRowIndex, lvIndex, startOpIdx, srcName);
return super.visitMethodVar(lvtRowIndex, lvIndex, startOpIdx, endOpIdx, srcName);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import net.fabricmc.mappingio.adapter.MappingNsCompleter;
import net.fabricmc.mappingio.adapter.MappingSourceNsSwitch;
import net.fabricmc.mappingio.format.MappingFormat;
import net.fabricmc.mappingio.format.Tiny2Writer;
import net.fabricmc.mappingio.format.tiny.Tiny2FileWriter;
import net.fabricmc.mappingio.tree.MemoryMappingTree;

public abstract class AbstractTinyMergeTask extends DefaultMappingsTask {
Expand Down Expand Up @@ -68,9 +68,9 @@ public static void mergeMappings(Path mappingsTinyInput, Path mergeTinyInput, Pa
Function<MappingVisitor, MappingVisitor> firstVisitor,
Function<MappingVisitor, MappingVisitor> preWriteVisitor) throws IOException {
MemoryMappingTree tree = new MemoryMappingTree(false); // hashed is the src namespace
MappingReader.read(mergeTinyInput, MappingFormat.TINY_2, tree);
MappingReader.read(mappingsTinyInput, MappingFormat.TINY_2, tree);
try (Tiny2Writer w = new Tiny2Writer(Files.newBufferedWriter(outputMappings), false)) {
MappingReader.read(mergeTinyInput, MappingFormat.TINY_2_FILE, tree);
MappingReader.read(mappingsTinyInput, MappingFormat.TINY_2_FILE, tree);
try (Tiny2FileWriter w = new Tiny2FileWriter(Files.newBufferedWriter(outputMappings), false)) {
tree.accept(firstVisitor.apply(
new CompleteInitializersVisitor(
new MappingSourceNsSwitch(preWriteVisitor.apply(w), "official", /*Drop methods not in hashed*/ true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import net.fabricmc.mappingio.MappingWriter;
import net.fabricmc.mappingio.adapter.MappingDstNsReorder;
import net.fabricmc.mappingio.format.MappingFormat;
import net.fabricmc.mappingio.format.Tiny2Reader;
import net.fabricmc.mappingio.format.tiny.Tiny2FileReader;
import net.fabricmc.mappingio.tree.MemoryMappingTree;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.InputFile;
Expand Down Expand Up @@ -79,7 +79,7 @@ public static void addProposedMappings(Path input, Path output, Path tempDir, Pa

List<String> namespaces;
try (Reader reader = Files.newBufferedReader(input, StandardCharsets.UTF_8)) {
namespaces = Tiny2Reader.getNamespaces(reader);
namespaces = Tiny2FileReader.getNamespaces(reader);
}

if (!namespaces.contains("named")) {
Expand All @@ -104,7 +104,7 @@ public static void addProposedMappings(Path input, Path output, Path tempDir, Pa

if (extraProcessing) {
MemoryMappingTree outputTree = postProcessTree(input, processedMappings);
try (MappingWriter writer = MappingWriter.create(output, MappingFormat.TINY_2)) {
try (MappingWriter writer = MappingWriter.create(output, MappingFormat.TINY_2_FILE)) {
outputTree.accept(writer);
}
}
Expand Down Expand Up @@ -154,7 +154,7 @@ private static void runCommands(Path jar, Path input, Path output, Path profileP
private static boolean preprocessFile(Path inputMappings, Path output) throws Exception {
MemoryMappingTree inputTree = new MemoryMappingTree();
try (Reader reader = Files.newBufferedReader(inputMappings, StandardCharsets.UTF_8)) {
Tiny2Reader.read(reader, inputTree);
Tiny2FileReader.read(reader, inputTree);
}

// Reorder destination namespaces to put the named namespace first
Expand All @@ -166,7 +166,7 @@ private static boolean preprocessFile(Path inputMappings, Path output) throws Ex
dstNamespaces.set(0, "named");
inputTree.accept(new MappingDstNsReorder(outputTree, dstNamespaces));

try (MappingWriter mappingWriter = MappingWriter.create(output, MappingFormat.TINY_2)) {
try (MappingWriter mappingWriter = MappingWriter.create(output, MappingFormat.TINY_2_FILE)) {
outputTree.accept(mappingWriter);
}

Expand All @@ -180,12 +180,12 @@ private static boolean preprocessFile(Path inputMappings, Path output) throws Ex
private static MemoryMappingTree postProcessTree(Path inputMappings, Path processedMappings) throws Exception {
MemoryMappingTree inputTree = new MemoryMappingTree();
try (Reader reader = Files.newBufferedReader(inputMappings, StandardCharsets.UTF_8)) {
Tiny2Reader.read(reader, inputTree);
Tiny2FileReader.read(reader, inputTree);
}

MemoryMappingTree processedTree = new MemoryMappingTree();
try (Reader reader = Files.newBufferedReader(processedMappings, StandardCharsets.UTF_8)) {
Tiny2Reader.read(reader, processedTree);
Tiny2FileReader.read(reader, processedTree);
}

// Merge trees
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import net.fabricmc.mappingio.adapter.MappingDstNsReorder;
import net.fabricmc.mappingio.adapter.MappingSourceNsSwitch;
import net.fabricmc.mappingio.format.MappingFormat;
import net.fabricmc.mappingio.format.Tiny2Writer;
import net.fabricmc.mappingio.format.tiny.Tiny2FileWriter;
import net.fabricmc.mappingio.tree.MemoryMappingTree;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.tasks.InputFile;
Expand Down Expand Up @@ -54,8 +54,8 @@ public void removeIntermediary() throws Exception {
@VisibleForTesting
public static void removeIntermediary(Path mappingsTinyInput, Path output) throws IOException {
MemoryMappingTree tree = new MemoryMappingTree(false);
MappingReader.read(mappingsTinyInput, MappingFormat.TINY_2, tree);
try (Tiny2Writer w = new Tiny2Writer(Files.newBufferedWriter(output), false)) {
MappingReader.read(mappingsTinyInput, MappingFormat.TINY_2_FILE, tree);
try (Tiny2FileWriter w = new Tiny2FileWriter(Files.newBufferedWriter(output), false)) {
tree.accept(
new MappingSourceNsSwitch(
new MappingDstNsReorder(w, Collections.singletonList("named")), // Remove official namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import quilt.internal.tasks.DefaultMappingsTask;
import quilt.internal.util.UnpickUtil;

import net.fabricmc.mappingio.format.Tiny2Reader;
import net.fabricmc.mappingio.format.tiny.Tiny2FileReader;
import net.fabricmc.mappingio.tree.MappingTree;
import net.fabricmc.mappingio.tree.MemoryMappingTree;

Expand Down Expand Up @@ -96,7 +96,7 @@ public static void remapUnpickDefinitions(Path input, Path mappings, Path output
// Use target namespace as fallback to source namespace
// Removes the need to add all the mappings to the file
MappingVisitor visitor = new MappingNsCompleter(mappingTree, Collections.singletonMap(fromM, toM));
Tiny2Reader.read(reader, visitor);
Tiny2FileReader.read(reader, visitor);

for (MappingTree.ClassMapping classMapping : mappingTree.getClasses()) {
classMappings.put(classMapping.getName(fromM), classMapping.getName(toM));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package quilt.internal.util;

import net.fabricmc.mappingio.format.Tiny2Reader;
import net.fabricmc.mappingio.format.tiny.Tiny2FileReader;
import net.fabricmc.mappingio.tree.MappingTree;
import net.fabricmc.mappingio.tree.MemoryMappingTree;
import quilt.internal.decompile.javadoc.ClassJavadocProvider;
Expand All @@ -18,7 +18,7 @@ public class MappingsJavadocProvider implements ClassJavadocProvider, FieldJavad

public MappingsJavadocProvider(File mappingsFile, String namespace) throws IOException {
try (Reader reader = Files.newBufferedReader(mappingsFile.toPath())) {
Tiny2Reader.read(reader, tree);
Tiny2FileReader.read(reader, tree);
}
namespaceId = tree.getNamespaceId(namespace);
}
Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ enigma_plugin = "2.2.2"
tiny_remapper = "0.7.2"
stitch = "0.6.1"
unpick = "3.0.8"
mapping_io = "0.3.0"
mapping_io = "0.6.1"
javadoc_draftsman = "1.2.3"

quilt_loader = "0.23.0"
quilt_loader = "0.26.1"
jetbrains_annotations = "23.0.0"
jsr305 = "3.0.2"
gson = "2.9.1"
netty = "4.1"

vineflower = "1.10.0"
cfr = "0.2.0"
vineflower = "1.10.1"
cfr = "0.2.2"

junit = "5.9.1"
proguard = "7.3.0"
proguard = "7.5.0"

[libraries]
commons_io = { module = "commons-io:commons-io", version.ref = "commons_io" }
Expand Down

0 comments on commit 71fe7aa

Please sign in to comment.