diff options
author | Stephan Herhut <herhut@google.com> | 2017-07-18 10:29:45 +0200 |
---|---|---|
committer | Stephan Herhut <herhut@google.com> | 2017-07-18 10:29:45 +0200 |
commit | 5444bfd16c283f13eee719e3f9589500b1089c31 (patch) | |
tree | 25ff89c1dec82fe2b67b995e8473d52e05517cc2 /src/main/java/com/android/tools/r8/utils/InternalOptions.java | |
parent | ac1a386701f11d3c85f02d86fc848b5043cd6f14 (diff) | |
download | r8-5444bfd16c283f13eee719e3f9589500b1089c31.tar.gz |
Support to keep nesting structure of class names.
The minifier now produces names with $ separators for nested classes
to keep the nesting structure in the names. This is needed for
signature annotations, as they rely on the nesting structure to
encode type paramemeters to the outer and inner class.
R=yroussel@google.com
Bug:
Change-Id: I270608bc4124fc4b7a4d5aebfb2ea618a72115ce
Diffstat (limited to 'src/main/java/com/android/tools/r8/utils/InternalOptions.java')
-rw-r--r-- | src/main/java/com/android/tools/r8/utils/InternalOptions.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/com/android/tools/r8/utils/InternalOptions.java b/src/main/java/com/android/tools/r8/utils/InternalOptions.java index 9d6cfa5ea..72f5fbc4e 100644 --- a/src/main/java/com/android/tools/r8/utils/InternalOptions.java +++ b/src/main/java/com/android/tools/r8/utils/InternalOptions.java @@ -251,15 +251,18 @@ public class InternalOptions { public void ensureValid(boolean isMinifying) { if (innerClasses && !enclosingMethod) { - throw new CompilationError("Attribute InnerClasses implies EnclosingMethod attribute. " + - "Check -keepattributes directive."); + throw new CompilationError("Attribute InnerClasses requires EnclosingMethod attribute. " + + "Check -keepattributes directive."); } else if (!innerClasses && enclosingMethod) { - throw new CompilationError("Attribute EnclosingMethod requires InnerClasses attribute. " + - "Check -keepattributes directive."); + throw new CompilationError("Attribute EnclosingMethod requires InnerClasses attribute. " + + "Check -keepattributes directive."); + } else if (signature && !innerClasses) { + throw new CompilationError("Attribute Signature requires InnerClasses attribute. Check " + + "-keepattributes directive."); } else if (signature && isMinifying) { // TODO(38188583): Allow this once we can minify signatures. - throw new CompilationError("Attribute Signature cannot be kept when minifying. " + - "Check -keepattributes directive."); + throw new CompilationError("Attribute Signature cannot be kept when minifying. " + + "Check -keepattributes directive."); } } } |