Allow the refmapper output file to be specified as an AP arg

This commit is contained in:
Mumfrey committed 2015-01-12 21:46:59 +00:00
1 parent e28affdc5b
commit d53bd8d259
1 file changed
+10 -2
@@ -76,6 +76,11 @@ class AnnotatedMixins {
*/
private final String outSrgFileName;
/**
* Name of the resource to write remapped refs to
*/
private final String outRefMapFileName;
/**
* File containing the reobfd srgs
*/
@@ -101,7 +106,10 @@ class AnnotatedMixins {
*/
private AnnotatedMixins(ProcessingEnvironment processingEnv) {
String outSrgFileName = processingEnv.getOptions().get("outSrgFile");
this.outSrgFileName = (outSrgFileName != null) ? outSrgFileName : "mixins.srg";
this.outSrgFileName = (outSrgFileName != null) ? outSrgFileName : "mixins.srg";
String outRefMapFileName = processingEnv.getOptions().get("outRefMapFile");
this.outRefMapFileName = (outRefMapFileName != null) ? outRefMapFileName : ReferenceMapper.DEFAULT_RESOURCE;
String reobfSrgFileName = processingEnv.getOptions().get("reobfSrgFile");
if (reobfSrgFileName == null) {
@@ -192,7 +200,7 @@ class AnnotatedMixins {
try {
Filer filer = this.processingEnv.getFiler();
FileObject outSrg = filer.createResource(StandardLocation.CLASS_OUTPUT, "", ReferenceMapper.DEFAULT_RESOURCE);
FileObject outSrg = filer.createResource(StandardLocation.CLASS_OUTPUT, "", this.outRefMapFileName);
writer = new PrintWriter(outSrg.openWriter());
this.refMapper.write(writer);
} catch (IOException ex) {