Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@
/.classpath
/.project
/.idea/
/.gradle
/.gradle
mapping-io-extras/.classpath
mapping-io-extras/.project
mapping-io-extras/.settings/org.eclipse.buildship.core.prefs
mapping-io-extras/.settings/org.eclipse.jdt.core.prefs
mapping-io-extras/bin/
6 changes: 6 additions & 0 deletions src/main/java/net/fabricmc/mappingio/MappingReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import net.fabricmc.mappingio.format.enigma.EnigmaFileReader;
import net.fabricmc.mappingio.format.intellij.MigrationMapFileReader;
import net.fabricmc.mappingio.format.jobf.JobfFileReader;
import net.fabricmc.mappingio.format.pdme.PDMEFileReader;
import net.fabricmc.mappingio.format.proguard.ProGuardFileReader;
import net.fabricmc.mappingio.format.simple.RecafSimpleFileReader;
import net.fabricmc.mappingio.format.srg.JamFileReader;
Expand Down Expand Up @@ -137,6 +138,8 @@ private static MappingFormat detectFormat(Reader reader, @Nullable String fileEx
return MappingFormat.PROGUARD_FILE;
} else if (headerStr.contains("\n\t")) {
return MappingFormat.TSRG_FILE;
} else if (headerStr.contains("\u00B6")) {
return MappingFormat.PDME_FILE;
}

if (fileExt != null) {
Expand Down Expand Up @@ -323,6 +326,9 @@ public static void read(Reader reader, MappingFormat format, MappingVisitor visi
case RECAF_SIMPLE_FILE:
RecafSimpleFileReader.read(reader, visitor);
break;
case PDME_FILE:
PDMEFileReader.read(reader, visitor);
break;
case JOBF_FILE:
JobfFileReader.read(reader, visitor);
break;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/fabricmc/mappingio/MappingWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import net.fabricmc.mappingio.format.enigma.EnigmaFileWriter;
import net.fabricmc.mappingio.format.intellij.MigrationMapFileWriter;
import net.fabricmc.mappingio.format.jobf.JobfFileWriter;
import net.fabricmc.mappingio.format.pdme.PDMEFileWriter;
import net.fabricmc.mappingio.format.proguard.ProGuardFileWriter;
import net.fabricmc.mappingio.format.simple.RecafSimpleFileWriter;
import net.fabricmc.mappingio.format.srg.CsrgFileWriter;
Expand Down Expand Up @@ -68,6 +69,7 @@ static MappingWriter create(Writer writer, MappingFormat format) throws IOExcept
case PROGUARD_FILE: return new ProGuardFileWriter(writer);
case INTELLIJ_MIGRATION_MAP_FILE: return new MigrationMapFileWriter(writer);
case RECAF_SIMPLE_FILE: return new RecafSimpleFileWriter(writer);
case PDME_FILE: return new PDMEFileWriter(writer);
case JOBF_FILE: return new JobfFileWriter(writer);
default: return null;
}
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/net/fabricmc/mappingio/format/MappingFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,38 @@ public enum MappingFormat {
.withSrcDescs(FeaturePresence.REQUIRED))
.withFileComments(true)),

/**
* The {@code Paragraph Delimited Mapping Extended} mapping format, as specified <a href="https://pagure.io/FeatureCreep/MappingExFormat">here</a>.
* @implNote This implementation does not support the Include/Incluir or AccessFlag/BanderaDeAcceso types.
*/
PDME_FILE("Paragraph Delimited Mapping Extended", "pdme", true,
FeatureSetBuilder.create()
.withNamespaces(false)
.withElementMetadata(MetadataSupport.ARBITRARY)
.withClasses(c -> c
.withSrcNames(FeaturePresence.REQUIRED)
.withDstNames(FeaturePresence.REQUIRED)
.withRepackaging(true))
.withFields(f -> f
.withSrcNames(FeaturePresence.REQUIRED)
.withSrcDescs(FeaturePresence.REQUIRED)
.withDstNames(FeaturePresence.REQUIRED))
.withMethods(m -> m
.withSrcNames(FeaturePresence.REQUIRED)
.withDstNames(FeaturePresence.REQUIRED)
.withSrcDescs(FeaturePresence.REQUIRED))
.withArgs(a -> a
.withLvIndices(FeaturePresence.REQUIRED)
.withSrcNames(FeaturePresence.OPTIONAL)
.withDstNames(FeaturePresence.REQUIRED))
.withVars(v -> v
.withLvIndices(FeaturePresence.OPTIONAL)
.withLvtRowIndices(FeaturePresence.OPTIONAL)
.withStartOpIndices(FeaturePresence.OPTIONAL)
.withSrcNames(FeaturePresence.OPTIONAL)
.withDstNames(FeaturePresence.REQUIRED))
.withFileComments(true)),

/**
* The {@code JOBF} mapping format, as implemented <a href="https://github.com/skylot/jadx/blob/2d5c0fda4a0c5d16207a5f48edb72e6efa7d5bbd/jadx-core/src/main/java/jadx/core/deobf/DeobfPresets.java">here</a>.
*
Expand Down
Loading