1//
2// This Gradle build file illustrates how to process ProGuard itself.
3// Configuration files for typical applications will be very similar.
4// Usage:
5//     gradle -b proguard.gradle proguard
6//
7
8// Tell Gradle where to find the ProGuard task.
9
10buildscript {
11    repositories {
12        flatDir dirs: '../../lib'
13    }
14    dependencies {
15        classpath ':proguard'
16    }
17}
18
19// Define a ProGuard task.
20
21task proguard(type: proguard.gradle.ProGuardTask) {
22
23    // You should probably import a more compact ProGuard-style configuration
24    // file for all static settings, but we're specifying them all here, for
25    // the sake of the example.
26    //configuration 'configuration.pro'
27
28    // Specify the input jars, output jars, and library jars.
29    // We'll filter out the Ant classes, Gradle classes, and WTK classes, keeping
30    // everything else.
31
32    injars  '../../lib/proguard.jar', filter: '!proguard/ant/**,!proguard/gradle/**,!proguard/wtk/**'
33    outjars 'proguard_out.jar'
34
35    libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
36
37    // Write out an obfuscation mapping file, for de-obfuscating any stack traces
38    // later on, or for incremental obfuscation of extensions.
39
40    printmapping 'proguard.map'
41
42    // Allow methods with the same signature, except for the return type,
43    // to get the same obfuscation name.
44
45    overloadaggressively
46
47    // Put all obfuscated classes into the nameless root package.
48
49    repackageclasses ''
50
51    // Allow classes and class members to be made public.
52
53    allowaccessmodification
54
55    // The entry point: ProGuard and its main method.
56
57    keep 'public class proguard.ProGuard { \
58        public static void main(java.lang.String[]); \
59    }'
60
61    // If you want to preserve the Ant task as well, you'll have to specify the
62    // main ant.jar.
63
64    //libraryjars '/usr/local/java/ant/lib/ant.jar'
65    //adaptresourcefilecontents 'proguard/ant/task.properties'
66    //
67    //keep allowobfuscation: true, 'class proguard.ant.*'
68    //keepclassmembers 'public class proguard.ant.* { \
69    //    <init>(org.apache.tools.ant.Project); \
70    //    public void set*(***); \
71    //    public void add*(***); \
72    //}'
73
74    // If you want to preserve the Gradle task, you'll have to specify the Gradle
75    // jars.
76
77    //libraryjars '/usr/local/java/gradle-1.3/lib/plugins/gradle-plugins-1.3.jar'
78    //libraryjars '/usr/local/java/gradle-1.3/lib/gradle-base-services-1.3.jar'
79    //libraryjars '/usr/local/java/gradle-1.3/lib/gradle-core-1.3.jar'
80    //libraryjars '/usr/local/java/gradle-1.3/lib/groovy-all-1.8.6.jar'
81
82    //keep 'public class proguard.gradle.* { \
83    //    public *; \
84    //}'
85
86    // If you want to preserve the WTK obfuscation plug-in, you'll have to specify
87    // the kenv.zip file.
88
89    //libraryjars '/usr/local/java/wtk2.5.2/wtklib/kenv.zip'
90    //keep 'public class proguard.wtk.ProGuardObfuscator'
91}
92