+ <!-- This target builds an optimized core.jar using ProGuard. It is not intended for our Android
+ client - use build-no-debug intead, then build the client which runs ProGuard on everything. -->
+ <target name="build-optimized" depends="clean">
+ <antcall target="compile">
+ <param name="generate-debug" value="false"/>
+ </antcall>
+
+ <delete file="core.jar"/>
+ <mkdir dir="optimized"/>
+ <java jar="${proguard-jar}" fork="true" failonerror="true">
+ <jvmarg value="-Dmaximum.inlined.code.length=48"/>
+ <arg value="-injars build"/>
+ <arg value="-outjars optimized"/>
+ <!-- Needed for Mac OS. -->
+ <!--<arg value="-libraryjars ${java.home}/../Classes/classes.jar"/>-->
+ <!-- Needed for other Android apps besides Barcode Scanner. -->
+ <!--<arg value="-libraryjars ${android-home}/platforms/android-1.6/android.jar"/>-->
+ <arg value="-keep class com.google.zxing.* {public protected *;}"/>
+ <arg value="-keep class com.google.zxing.common.*Binarizer {public protected *;}"/>
+ <!-- Remove this line is you only use the Result base object and want the smallest jar. -->
+ <arg value="-keep class com.google.zxing.client.result.* {public protected *;}"/>
+ <!-- Contains a useful UPC-E to UPC-A method. -->
+ <arg value="-keep class com.google.zxing.oned.UPCEReader {public *;}"/>
+ <arg value="-target 1.2"/>
+ <arg value="-optimizationpasses 4"/>
+ <arg value="-dontobfuscate"/>
+ <arg value="-dontskipnonpubliclibraryclasses"/>
+ <arg value="-verbose"/>
+ </java>
+ <jar jarfile="core.jar" basedir="optimized"/>
+ </target>
+