+ <target name="compile-release" depends="clean, dirs, resource-src, aidl">
+ <javac encoding="ascii" target="1.5" debug="off" extdirs=""
+ srcdir="."
+ destdir="${outdir-classes}"
+ bootclasspath="${android-jar}">
+ <classpath>
+ <fileset dir="${external-libs}" includes="*.jar"/>
+ </classpath>
+ </javac>
+ </target>
+
+ <!--
+ Getting an error like this?
+
+ [apply] UNEXPECTED TOP-LEVEL EXCEPTION:
+ [apply] com.android.dx.cf.code.SimException: local variable type
+ mismatch: attempt to set or access a value of type int using a local
+ variable of type com.google.zxing.qrcode.decoder.Version. This is
+ symptomatic of .class transformation tools that ignore local variable
+ information.
+
+ Build core/ with the 'build-no-debug' target. It's a long story.
+ -->
+
+ <target name="optimize" depends="compile-release">
+ <fail message="Please put proguard.jar in 'bin' under the WTK install directory">
+ <condition>
+ <not>
+ <available file="${WTK-home}/bin/proguard.jar" type="file"/>
+ </not>
+ </condition>
+ </fail>
+ <unzip src="../core/core.jar" dest="${outdir-classes}" overwrite="true"/>
+ <jar jarfile="temp.jar" basedir="${outdir-classes}"/>
+ <delete dir="${outdir-classes}"/>
+ <mkdir dir="${outdir-classes}"/>
+ <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
+ <jvmarg value="-Dmaximum.inlined.code.length=32"/>
+ <arg value="-injars temp.jar"/>
+ <arg value="-outjars temp-optimized.jar"/>
+ <arg value="-libraryjars ${android-jar}"/>
+ <arg value="-keep class com.google.zxing.client.android.*Activity"/>
+ <arg value="-keep class com.google.zxing.client.android.ViewfinderView { public * ; }"/>
+ <arg value="-keep class com.google.zxing.client.android.SearchBookContents* { public * ; }"/>
+ <arg value="-target 5"/>
+ <arg value="-optimizationpasses 7"/>
+ <arg value="-dontshrink"/>
+ <arg value="-dontobfuscate"/>
+ <arg value="-dontskipnonpubliclibraryclasses"/>
+ <arg value="-verbose"/>
+ <arg value="-dump proguard-dump.txt"/>
+ </java>
+ <delete file="temp.jar"/>
+ <unzip src="temp-optimized.jar" dest="${outdir-classes}" overwrite="true"/>
+ <delete file="temp-optimized.jar"/>
+ </target>
+