From d53bd8d25969646e13c82182245e07e570e1ffc8 Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Mon, 12 Jan 2015 21:46:59 +0000 Subject: [PATCH] Allow the refmapper output file to be specified as an AP arg --- .../tools/obfuscation/AnnotatedMixins.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixins.java b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixins.java index a794f862..bcf8deaa 100644 --- a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixins.java +++ b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixins.java @@ -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) {