More updated to build-optimized to work correctly with dex -- now really doesn't generate local var info

git-svn-id: https://zxing.googlecode.com/svn/trunk@458 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-06-20 15:22:45 +00:00
parent 970eea8a8f
commit ce549d76c3

View file

@ -31,7 +31,7 @@
<tstamp/> <tstamp/>
</target> </target>
<target name="build" depends="init"> <target name="compile" depends="init">
<mkdir dir="build"/> <mkdir dir="build"/>
<javac srcdir="src" <javac srcdir="src"
destdir="build" destdir="build"
@ -39,7 +39,7 @@
target="1.2" target="1.2"
bootclasspath="${javame-compile-bootclasspath-path}" bootclasspath="${javame-compile-bootclasspath-path}"
optimize="true" optimize="true"
debug="true" debug="${generate-debug}"
deprecation="true" deprecation="true"
fork="true"/> fork="true"/>
<jar jarfile="core.jar" basedir="build"> <jar jarfile="core.jar" basedir="build">
@ -57,15 +57,29 @@
</jar> </jar>
</target> </target>
<target name="build-optimized" depends="build"> <target name="build">
<antcall target="compile">
<param name="generate-debug" value="true"/>
</antcall>
</target>
<target name="build-no-debug">
<antcall target="compile">
<param name="generate-debug" value="false"/>
</antcall>
</target>
<!-- This target really supports the Android client, where we can't as easily build
an optimized .apk directly, and need an optimized library. We have to strip debug info
above to appease dex -->
<target name="build-optimized" depends="build-no-debug">
<move file="core.jar" tofile="temp.jar"/> <move file="core.jar" tofile="temp.jar"/>
<java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true"> <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
<jvmarg value="-Dmaximum.inlined.code.length=32"/> <jvmarg value="-Dmaximum.inlined.code.length=32"/>
<arg value="-injars temp.jar"/> <arg value="-injars temp.jar"/>
<arg value="-outjars core.jar"/> <arg value="-outjars core.jar"/>
<arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/> <arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/>
<arg value="-renamesourcefileattribute SourceFile"/> <arg value="-keepattributes Exceptions,InnerClasses,Signature,!LocalVariableTable,!LocalVariableTypeTable"/>
<arg value="-keepattributes Exceptions,InnerClasses,Signature,!LocalVariableTable"/>
<arg value="-keep public class com.google.zxing.* { public protected *; }"/> <arg value="-keep public class com.google.zxing.* { public protected *; }"/>
<arg value="-keep public class com.google.zxing.client.result.* { public protected *; }"/> <arg value="-keep public class com.google.zxing.client.result.* { public protected *; }"/>
<arg value="-keep public class com.google.zxing.common.* { public protected *; }"/> <arg value="-keep public class com.google.zxing.common.* { public protected *; }"/>
@ -77,6 +91,17 @@
<delete file="temp.jar"/> <delete file="temp.jar"/>
</target> </target>
<target name="dump">
<java jar="${WTK-home}/bin/proguard.jar" fork="true">
<arg value="-injars core.jar"/>
<arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/>
<arg value="-dontshrink"/>
<arg value="-dontobfuscate"/>
<arg value="-dontoptimize"/>
<arg value="-dump dump.txt"/>
</java>
</target>
<target name="build-test" depends="init,build"> <target name="build-test" depends="init,build">
<fail message="Please build 'javase' first"> <fail message="Please build 'javase' first">
<condition> <condition>