diff options
-rw-r--r-- | jack/src/com/android/jack/Options.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/jack/src/com/android/jack/Options.java b/jack/src/com/android/jack/Options.java index dc713f4..f1e595a 100644 --- a/jack/src/com/android/jack/Options.java +++ b/jack/src/com/android/jack/Options.java @@ -681,6 +681,10 @@ public class Options { configBuilder.setString(SOURCES, Joiner.on(File.pathSeparator).join(inputSources)); } + if (emitLocalDebugInfo != null) { + configBuilder.set(EMIT_LOCAL_DEBUG_INFO, emitLocalDebugInfo); + } + configBuilder.pushDefaultLocation(new StringLocation("proguard flags")); if (flags != null) { @@ -693,8 +697,12 @@ public class Options { flags.keepAttribute("RuntimeVisibleParameterAnnotations")); configBuilder.set(ParameterAnnotationRemover.EMIT_RUNTIME_INVISIBLE_PARAMETER_ANNOTATION, flags.keepAttribute("RuntimeInvisibleParameterAnnotations")); - configBuilder.set(EMIT_LINE_NUMBER_DEBUG_INFO, - flags.keepAttribute("LineNumberTable")); + + if (flags.obfuscate()) { // do not override debug info config when shrinking + configBuilder.set(EMIT_LINE_NUMBER_DEBUG_INFO, flags.keepAttribute("LineNumberTable")); + configBuilder.set(EMIT_LOCAL_DEBUG_INFO, flags.keepAttribute("LocalVariableTable")); + } + configBuilder.set(Options.FLAGS, flags); configBuilder.set( Options.USE_MIXED_CASE_CLASSNAME, flags.getUseMixedCaseClassName()); @@ -782,9 +790,6 @@ public class Options { configBuilder.popDefaultLocation(); - if (emitLocalDebugInfo != null) { - configBuilder.set(EMIT_LOCAL_DEBUG_INFO, emitLocalDebugInfo); - } if (importedLibraries != null) { configBuilder.setString(IMPORTED_LIBRARIES, Joiner.on(',').join(importedLibraries)); } |