1b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato#
2b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# This ProGuard configuration file specifies how annotations can be used
3b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# to configure the processing of other code.
4b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# Usage:
5b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato#     java -jar proguard.jar @annotations.pro -libraryjars annotations.jar ...
6b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato#
7b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# Note that the other input/output options still have to be specified.
8b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# If you specify them in a separate file, you can simply include this file:
9b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato#     -include annotations.pro
10b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato#
11b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# You can add any other options that are required. For instance, if you are
12b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# processing a library, you can still include the options from library.pro.
13b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
14b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
15b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# The annotations are defined in the accompanying jar. For now, we'll start
16b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# with these. You can always define your own annotations, if necessary.
17b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-libraryjars annotations.jar
18b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
19b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
20b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# The following annotations can be specified with classes and with class
21b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# members.
22b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
23b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# @Keep specifies not to shrink, optimize, or obfuscate the annotated class
24b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# or class member as an entry point.
25b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
26b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keep @proguard.annotation.Keep class *
27b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
28b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembers class * {
29b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    @proguard.annotation.Keep *;
30b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
31b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
32b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
33b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# @KeepName specifies not to optimize or obfuscate the annotated class or
34b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# class member as an entry point.
35b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
36b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepnames @proguard.annotation.KeepName class *
37b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
38b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembernames class * {
39b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    @proguard.annotation.KeepName *;
40b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
41b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
42b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
43b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# The following annotations can only be specified with classes.
44b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
45b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# @KeepImplementations and @KeepPublicImplementations specify to keep all,
46b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# resp. all public, implementations or extensions of the annotated class as
47b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# entry points. Note the extension of the java-like syntax, adding annotations
48b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# before the (wild-carded) interface name.
49b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
50b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keep        class * implements @proguard.annotation.KeepImplementations       *
51b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keep public class * implements @proguard.annotation.KeepPublicImplementations *
52b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
53b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# @KeepApplication specifies to keep the annotated class as an application,
54b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# together with its main method.
55b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
56b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclasseswithmembers @proguard.annotation.KeepApplication public class * {
57b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public static void main(java.lang.String[]);
58b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
59b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
60b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# @KeepClassMembers, @KeepPublicClassMembers, and
61b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# @KeepPublicProtectedClassMembers specify to keep all, all public, resp.
62b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# all public or protected, class members of the annotated class from being
63b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# shrunk, optimized, or obfuscated as entry points.
64b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
65b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembers @proguard.annotation.KeepClassMembers class * {
66b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    *;
67b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
68b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
69b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembers @proguard.annotation.KeepPublicClassMembers class * {
70b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public *;
71b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
72b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
73b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembers @proguard.annotation.KeepPublicProtectedClassMembers class * {
74b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public protected *;
75b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
76b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
77b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# @KeepClassMemberNames, @KeepPublicClassMemberNames, and
78b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# @KeepPublicProtectedClassMemberNames specify to keep all, all public, resp.
79b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# all public or protected, class members of the annotated class from being
80b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# optimized or obfuscated as entry points.
81b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
82b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembernames @proguard.annotation.KeepClassMemberNames class * {
83b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    *;
84b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
85b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
86b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembernames @proguard.annotation.KeepPublicClassMemberNames class * {
87b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public *;
88b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
89b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
90b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembernames @proguard.annotation.KeepPublicProtectedClassMemberNames class * {
91b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public protected *;
92b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
93b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
94b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# @KeepGettersSetters and @KeepPublicGettersSetters specify to keep all, resp.
95b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# all public, getters and setters of the annotated class from being shrunk,
96b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato# optimized, or obfuscated as entry points.
97b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
98b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembers @proguard.annotation.KeepGettersSetters class * {
99b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    void set*(***);
100b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    void set*(int, ***);
101b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
102b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    boolean is*();
103b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    boolean is*(int);
104b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
105b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    *** get*();
106b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    *** get*(int);
107b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
108b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
109b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato-keepclassmembers @proguard.annotation.KeepPublicGettersSetters class * {
110b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public void set*(***);
111b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public void set*(int, ***);
112b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
113b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public boolean is*();
114b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public boolean is*(int);
115b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato
116b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public *** get*();
117b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato    public *** get*(int);
118b72c5c2e5482cf10117b2b25f642f7616b2326c3Joe Onorato}
119