diff options
Diffstat (limited to 'java/dex.go')
-rw-r--r-- | java/dex.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/java/dex.go b/java/dex.go index 7b99549d4..4a7e9dcc4 100644 --- a/java/dex.go +++ b/java/dex.go @@ -49,6 +49,16 @@ type DexProperties struct { // Whether to continue building even if warnings are emitted. Defaults to true. Ignore_warnings *bool + // Whether runtime invisible annotations should be kept by R8. Defaults to false. + // This is equivalent to: + // -keepattributes RuntimeInvisibleAnnotations, + // RuntimeInvisibleParameterAnnotations, + // RuntimeInvisibleTypeAnnotations + // This is only applicable when RELEASE_R8_ONLY_RUNTIME_VISIBLE_ANNOTATIONS is + // enabled and will be used to migrate away from keeping runtime invisible + // annotations (b/387958004). + Keep_runtime_invisible_annotations *bool + // If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode. // Defaults to false for apps and tests, true for libraries. Proguard_compatibility *bool @@ -364,6 +374,10 @@ func (d *dexer) r8Flags(ctx android.ModuleContext, dexParams *compileDexParams, r8Flags = append(r8Flags, "--ignore-library-extends-program") } + if BoolDefault(opt.Keep_runtime_invisible_annotations, false) { + r8Flags = append(r8Flags, "--keep-runtime-invisible-annotations") + } + if BoolDefault(opt.Proguard_compatibility, true) { r8Flags = append(r8Flags, "--force-proguard-compatibility") } |