Home | History | Annotate | Download | only in build
      1 <!-- Ant build script for ProGuard. -->
      2 
      3 <project name    = "proguard"
      4          default = "all"
      5          basedir = "..">
      6 
      7   <property file = "build/build.properties"/>
      8   <property name = "src"     value = "src"/>
      9   <property name = "classes" value = "classes"/>
     10   <property name = "lib"     value = "lib"/>
     11 
     12   <property name = "gradle.jar1" value = "${gradle.home}/lib/plugins/gradle-plugins-2.1.jar"/>
     13   <property name = "gradle.jar2" value = "${gradle.home}/lib/gradle-base-services-2.1.jar"/>
     14   <property name = "gradle.jar3" value = "${gradle.home}/lib/gradle-base-services-groovy-2.1.jar"/>
     15   <property name = "gradle.jar4" value = "${gradle.home}/lib/gradle-core-2.1.jar"/>
     16   <property name = "gradle.jar5" value = "${gradle.home}/lib/groovy-all-2.3.6.jar"/>
     17   <property name = "wtk.jar"     value = "${wtk.home}/wtklib/kenv.zip"/>
     18 
     19   <target name = "all"     depends = "basic,options"/>
     20   <target name = "basic"   depends = "proguard,proguardgui,retrace"/>
     21   <target name = "options" depends = "anttask,wtkplugin"/>
     22 
     23   <target name = "proguard" depends = "classes,lib">
     24     <javac nowarn            = "true"
     25            deprecation       = "false"
     26            includeantruntime = "false"
     27            srcdir            = "${src}"
     28            destdir           = "${classes}"
     29            includes          = "proguard/ProGuard.java">
     30       <compilerarg value = "-Xlint:none"/>
     31     </javac>
     32 
     33     <copy todir = "${classes}">
     34       <fileset dir = "${src}">
     35         <include name = "proguard/*.properties"/>
     36         <include name = "proguard/*.png"/>
     37         <include name = "proguard/*.gif"/>
     38         <include name = "proguard/*.pro"/>
     39       </fileset>
     40     </copy>
     41 
     42     <jar jarfile  = "${lib}/proguard.jar"
     43          manifest = "${src}/proguard/MANIFEST.MF"
     44          basedir  = "${classes}"
     45          includes = "proguard/**"/>
     46   </target>
     47 
     48   <target name = "proguardgui" depends = "proguard">
     49     <javac nowarn            = "true"
     50            deprecation       = "false"
     51            includeantruntime = "false"
     52            srcdir            = "${src}"
     53            destdir           = "${classes}"
     54            includes          = "proguard/gui/ProGuardGUI.java">
     55       <compilerarg value = "-Xlint:none"/>
     56     </javac>
     57 
     58     <copy todir = "${classes}">
     59       <fileset dir = "${src}">
     60         <include name = "proguard/gui/*.properties"/>
     61         <include name = "proguard/gui/*.png"/>
     62         <include name = "proguard/gui/*.gif"/>
     63         <include name = "proguard/gui/*.pro"/>
     64       </fileset>
     65     </copy>
     66 
     67     <jar jarfile  = "${lib}/proguardgui.jar"
     68          manifest = "${src}/proguard/gui/MANIFEST.MF"
     69          basedir  = "${classes}"
     70          includes = "proguard/gui/**"/>
     71   </target>
     72 
     73   <target name = "retrace" depends = "classes,lib">
     74     <javac nowarn            = "true"
     75            deprecation       = "false"
     76            includeantruntime = "false"
     77            srcdir            = "${src}"
     78            destdir           = "${classes}"
     79            includes          = "proguard/retrace/ReTrace.java">
     80       <compilerarg value = "-Xlint:none"/>
     81     </javac>
     82 
     83     <copy todir = "${classes}">
     84       <fileset dir = "${src}">
     85         <include name = "proguard/retrace/*.properties"/>
     86         <include name = "proguard/retrace/*.png"/>
     87         <include name = "proguard/retrace/*.gif"/>
     88         <include name = "proguard/retrace/*.pro"/>
     89       </fileset>
     90     </copy>
     91 
     92     <jar jarfile  = "${lib}/retrace.jar"
     93          manifest = "${src}/proguard/retrace/MANIFEST.MF"
     94          basedir  = "${classes}"
     95          includes = "proguard/retrace/**"/>
     96   </target>
     97 
     98   <target name = "anttask" depends = "proguard">
     99     <javac nowarn            = "true"
    100            deprecation       = "false"
    101            includeantruntime = "true"
    102            srcdir            = "${src}"
    103            destdir           = "${classes}"
    104            includes          = "proguard/ant/ProGuardTask.java">
    105       <compilerarg value = "-Xlint:none"/>
    106     </javac>
    107 
    108     <copy todir = "${classes}">
    109       <fileset dir = "${src}">
    110         <include name = "proguard/ant/*.properties"/>
    111         <include name = "proguard/ant/*.png"/>
    112         <include name = "proguard/ant/*.gif"/>
    113         <include name = "proguard/ant/*.pro"/>
    114       </fileset>
    115     </copy>
    116 
    117     <jar jarfile  = "${lib}/proguard.jar"
    118          update   = "true"
    119          basedir  = "${classes}"
    120          includes = "proguard/ant/**"/>
    121   </target>
    122 
    123   <target name = "gradletask" depends = "proguard">
    124     <fail message="Please set the value of the property gradle.home in the file build.properties, if you want to build the optional ProGuard Gradle task.">
    125       <condition>
    126         <not>
    127           <and>
    128             <available file="${gradle.jar1}"/>
    129             <available file="${gradle.jar2}"/>
    130             <available file="${gradle.jar3}"/>
    131             <available file="${gradle.jar4}"/>
    132             <available file="${gradle.jar5}"/>
    133           </and>
    134         </not>
    135       </condition>
    136     </fail>
    137 
    138     <javac nowarn            = "true"
    139            deprecation       = "false"
    140            includeantruntime = "false"
    141            srcdir            = "${src}"
    142            destdir           = "${classes}"
    143            includes          = "proguard/gradle/ProGuardTask.java">
    144       <compilerarg value = "-Xlint:none"/>
    145       <classpath>
    146         <path location="${gradle.jar1}"/>
    147         <path location="${gradle.jar2}"/>
    148         <path location="${gradle.jar3}"/>
    149         <path location="${gradle.jar4}"/>
    150         <path location="${gradle.jar5}"/>
    151       </classpath>
    152     </javac>
    153 
    154     <copy todir = "${classes}">
    155       <fileset dir = "${src}">
    156         <include name = "proguard/gradle/*.properties"/>
    157         <include name = "proguard/gradle/*.png"/>
    158         <include name = "proguard/gradle/*.gif"/>
    159         <include name = "proguard/gradle/*.pro"/>
    160       </fileset>
    161     </copy>
    162 
    163     <jar jarfile  = "${lib}/proguard.jar"
    164          update   = "true"
    165          basedir  = "${classes}"
    166          includes = "proguard/gradle/**"/>
    167   </target>
    168 
    169   <target name = "wtkplugin" depends = "proguard">
    170     <fail message="Please set the value of the property wtk.home in the file build.properties, if you want to build the optional ProGuard WTK plugin.">
    171       <condition>
    172         <not>
    173           <available file="${wtk.jar}"/>
    174         </not>
    175       </condition>
    176     </fail>
    177 
    178     <javac nowarn            = "true"
    179            deprecation       = "false"
    180            includeantruntime = "false"
    181            classpath         = "${wtk.jar}"
    182            srcdir            = "${src}"
    183            destdir           = "${classes}"
    184            includes          = "proguard/wtk/ProGuardObfuscator.java">
    185       <compilerarg value = "-Xlint:none"/>
    186     </javac>
    187 
    188     <copy todir = "${classes}">
    189       <fileset dir = "${src}">
    190         <include name = "proguard/wtk/*.properties"/>
    191         <include name = "proguard/wtk/*.png"/>
    192         <include name = "proguard/wtk/*.gif"/>
    193         <include name = "proguard/wtk/*.pro"/>
    194       </fileset>
    195     </copy>
    196 
    197     <jar jarfile  = "${lib}/proguard.jar"
    198          update   = "true"
    199          basedir  = "${classes}"
    200          includes = "proguard/wtk/**"/>
    201   </target>
    202 
    203   <target name = "classes">
    204     <mkdir dir = "${classes}"/>
    205   </target>
    206 
    207   <target name = "lib">
    208     <mkdir dir = "${lib}"/>
    209   </target>
    210 
    211   <target name = "clean">
    212     <delete>
    213       <fileset dir = "${classes}"/>
    214       <fileset dir = "${lib}"/>
    215     </delete>
    216   </target>
    217 </project>
    218