I have simple java project which refers to two (2) library jar files. Want to integrate ProGuard.
Here's my current build.xml:
<?xml version="1.0" ?>
<project name="Samples" default="dist" basedir=".">
<!-- generate JAR START -->
<description>Samples Library</description>
<!-- Setting global properties for this build -->
<property name="src" location="src" />
<property name="bin" location="bin" />
<target name="dist">
<jar destfile="Samples.jar" basedir="bin/">
<!-- Use ** to include the directory recursively -->
<include name="com/samples/**" />
</jar>
</target>
</project>
The ProGuard distribution contains a manual page for the Ant task and also a few complete sample build files in the directory
examples/ant
. You can specify any number of library jars.Your follow-up answer suggests that you're working on an Android application. You should then have a look at the Android example.
I found several ways to integrate it but this is the simplest way to do it.
Here's the proguard.cfg: