JarRemapper can now be configured to "generate an API", as part of
the remapping process. The output classes will only have the symbol names
(remapped, of course), but no executable code. Useful for projects to
build against this generated API.
Adds support for interpreting "CL: xxx/* yyy/*" in .srg for remapping
all class names beginning with xxx/ to yyy/. Previously this functionality
was only programmatically accessible when SpecialSource was used as a
library, but now you can use it from .srg mappings as well.
May be replaced with "PK: xxx yyy" support in .srg files later,
but needs to be first thoroughly tested for full compatibility,
to ensure identical semantics as in MCP (e.g. remapping ".").
Adding CL: /* class name prefix remapping for now, separate from PK:,
which simply remaps class names matching the given prefix substring.
Remaps constant literals passed to Class.forName(""), similar to
the existing class.getDeclaredField("") remapping in RemapperPreprocessor.
Both reflection remappings use the jarMapping, if one is passed in.
Adds new APIs to enable/disable the respective reflection remaps.
If the superclasses cannot be read in ClassLoaderProvider for any reason,
we ignore it and move on. This was the case before but the exception catch
was changed to only include IOError during the 1.5 refactor. This uncovered
an issue where on Java 8 inheritance traversal was hitting the Java 8 classes
in the JRE and throwing IllegalArgumentExceptions from ASM 4.1 since it does
not yet support the 52.0 classfile format.
To restore the previous behavior we change from catching IOException to Throwable,
including IllegalArgumentException. This will prevent correct inheritance trees
to be built on Java 8 classes however this is no worse than before and could be
fixed separately by an ASM 5 or 4.1.1 update once/if it is available.
For background see:
https://github.com/MinecraftPortCentral/MCPC-Plus/issues/841
The interface uses the generic Collection type but the implementation
an ArrayList. Fix by creating an ArrayList from the Collection. Resolves
this crash observed when updating MCPC+'s plugin loader:
https://gist.github.com/agaricusb/5471423
We now use a modified version of RemappingMethodAdaptor that bpasses the superclass LocalVariablesSorter
In addition I added a few more command line options, Most notibly:
kill-source: Removes the 'SourceFile' attribute
kill-lvt: Removes any LocalVariableTable attributes
kill-generics: Remvoes any LocalVariableTypeTable and Signature attributes
identifier: Tags each class with the specified UTF8 string in the constant pool. This is useful for loaders such as FML to know if the class has been obfusicated to SRG names or not.
File.separator is the separator used in subdirectory paths ('/'), whereas
File.pathSeparator is used in $PATH for separating multiple paths (':').
Using the wrong separator worked on OS X since the /var/folders subdir
could be created (":ss-cache") but failed on (Linux?) ci.md-5.net since
/tmp:ss-cache cannot be created (nor it should it be). With this change,
the path should be /tmp/ss-cache, as expected.
Useful since the files can be stored in non-obvious locations (on OS X,
temporary directory is in /var/folders with per-user random subdir) and
may need to be manually removed for testing. Could consider multiple
logging levels instead of always logging these messages.. but they're
more useful to show than most of the other 'verbose' log messages.
File.createTempFile() creates a temporary file, so we instead get
the java.io.tmpdir property and use File mkdirs().
There is a Files.createTempDirectory() method in JDK 7, and
Files.createTempDir() in Guava, could possibly use but for caching
its important to use a consistent path (also the path must be unique,
so the full URI is used, since it could refer to specific commit,
where the path disambiguates the resource, beyond the base filename).
Fixes 'no such file or directory' error building MCPC+ via SpecialSourceMP.