Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: base/android/base_proguard_config.flags

Issue 2150533005: Annotated functions/classes more cleanly kept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: keeping all native functions Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « android_webview/system_webview_apk_tmpl.gni ('k') | chrome/android/chrome_public_apk_tmpl.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Keep line number information, useful for stack traces.
2 -keepattributes SourceFile,LineNumberTable
3
4 # Keep all runtime visible annotations
5 -keepattributes RuntimeVisibleAnnotations
6
7 # Keep the annotations, because if we don't, the ProGuard rules that use them
8 # will not be respected. These classes then show up in our final dex, which we
9 # do not want - see crbug.com/628226.
10 -keep @interface org.chromium.base.annotations.AccessedByNative
11 -keep @interface org.chromium.base.annotations.CalledByNative
12 -keep @interface org.chromium.base.annotations.CalledByNativeUnchecked
13 -keep @interface org.chromium.base.annotations.RemovableInRelease
14 -keep @interface org.chromium.base.annotations.UsedByReflection
15
16 # Keeps for class level annotations.
17 -keep @org.chromium.base.annotations.UsedByReflection class *
18
19 # Keeps for method level annotations.
20 -keepclasseswithmembers class * {
21 @android.webkit.JavascriptInterface <methods>;
22 }
23 -keepclasseswithmembers class * {
24 @org.chromium.base.annotations.AccessedByNative <fields>;
25 }
26 -keepclasseswithmembers,includedescriptorclasses class * {
27 @org.chromium.base.annotations.CalledByNative <methods>;
28 }
29 -keepclasseswithmembers,includedescriptorclasses class * {
30 @org.chromium.base.annotations.CalledByNativeUnchecked <methods>;
31 }
32 -keepclasseswithmembers class * {
33 @org.chromium.base.annotations.UsedByReflection <methods>;
34 }
35 -keepclasseswithmembers,includedescriptorclasses class * {
36 native <methods>;
37 }
38
39 # Remove methods annotated with this if their return value is unused
40 -assumenosideeffects class ** {
41 @org.chromium.base.annotations.RemovableInRelease <methods>;
42 }
43
44 # Allows Proguard freedom in removing these log related calls. We ask for debug
45 # and verbose logs to be stripped out in base.Log, so we are just ensuring we
46 # get rid of all other debug/verbose logs.
47 -assumenosideeffects class android.util.Log {
48 static *** d(...);
49 static *** v(...);
50 static *** isLoggable(...);
51 }
52
53 # Class merging provides negligible .dex size reduction and method count
54 # reduction (about 0.3% improvement on method count, and 0.1% savings on size),
55 # and it messes up stack traces if the classes are optimized. Thus, it is in our
56 # best interests to turn it off. See crbug.com/620323
57 -optimizations !class/merging/*
58
59 # Allowing Proguard to change modifiers. This change shrinks the .dex size by
60 # ~1.1%, and reduces the method count by ~4.3%.
61 -allowaccessmodification
62
63 # Keep all enum values and valueOf methods. See
64 # http://proguard.sourceforge.net/index.html#manual/examples.html
65 # for the reason for this. Also, see http://crbug.com/248037.
66 -keepclassmembers enum * {
67 public static **[] values();
68 public static ** valueOf(java.lang.String);
69 }
OLDNEW
« no previous file with comments | « android_webview/system_webview_apk_tmpl.gni ('k') | chrome/android/chrome_public_apk_tmpl.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698