• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// This Gradle build file illustrates how to process the ReTrace tool.
3// Configuration files for typical applications will be very similar.
4// Usage:
5//     gradle -b retrace.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    // The input jars will be merged in a single output jar.
30    // We'll filter out the Ant and WTK classes.
31
32    injars  '../../lib/retrace.jar'
33    injars  '../../lib/proguard.jar(!META-INF/MANIFEST.MF,'
34                                 !proguard/ant/**,!proguard/wtk/**)
35    outjars 'retrace_out.jar'
36
37    libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
38
39    // If we wanted to reuse the previously obfuscated proguard_out.jar, we could
40    // perform incremental obfuscation based on its mapping file, and only keep the
41    // additional ReTrace files instead of all files.
42
43    //applymapping 'proguard.map'
44    //outjars      'retrace_out.jar', filter: 'proguard/retrace/**'
45
46    // Allow methods with the same signature, except for the return type,
47    // to get the same obfuscation name.
48
49    overloadaggressively
50
51    // Put all obfuscated classes into the nameless root package.
52
53    repackageclasses ''
54
55    // Allow classes and class members to be made public.
56
57    allowaccessmodification
58
59    // The entry point: ReTrace and its main method.
60
61    keep 'public class proguard.retrace.ReTrace { \
62        public static void main(java.lang.String[]); \
63    }'
64}
65