See the License for the specific language governing permissions and
limitations under the License.
-->
-<project name="BarcodeScanner" default="debug">
+<project name="BarcodeScanner" default="debug-optimized">
<!-- SDK Locations -->
<property file="../build.properties"/>
<property name="sdk-folder" value="${android-home}"/>
</target>
<!-- Compile this project's .java files into .class files. -->
- <target name="compile" depends="dirs, resource-src, aidl">
+ <target name="compile" depends="clean, dirs, resource-src, aidl">
<javac encoding="ascii" target="1.5" debug="true" extdirs=""
srcdir="."
destdir="${outdir-classes}"
</javac>
</target>
- <target name="compile-release" depends="dirs, resource-src, aidl">
+ <target name="compile-release" depends="clean, dirs, resource-src, aidl">
<javac encoding="ascii" target="1.5" debug="off" extdirs=""
srcdir="."
destdir="${outdir-classes}"
</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>
<arg value="-injars temp.jar"/>
<arg value="-outjars temp-optimized.jar"/>
<arg value="-libraryjars ${android-jar}"/>
- <arg value="-keepattributes Exceptions,InnerClasses,Signature,!LocalVariableTable,!LocalVariableTypeTable"/>
<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="-allowaccessmodification"/>
<arg value="-dontshrink"/>
<arg value="-dontobfuscate"/>
<arg value="-dontskipnonpubliclibraryclasses"/>
<!-- Convert this project's .class files into .dex files. -->
<target name="dex" depends="compile">
<echo>Converting compiled files and external libraries into ${outdir}/${dex-file}...</echo>
+ <echo>NOTE: This will fail unless you built core with build-no-debug.</echo>
<apply executable="${dx}" failonerror="true" parallel="true">
<arg value="--dex" />
<arg value="--output=${intermediate-dex-ospath}" />
<target name="dex-optimized" depends="compile-release,optimize">
<echo>Converting compiled files and external libraries into ${outdir}/${dex-file}...</echo>
+ <echo>NOTE: This will fail unless you built core with build-no-debug.</echo>
<apply executable="${dx}" failonerror="true" parallel="true">
<arg value="--dex" />
<arg value="--output=${intermediate-dex-ospath}" />
</exec>
</target>
- <!-- Invoke the proper target depending on whether or not
-an assets directory is present. -->
- <!-- TODO: find a nicer way to include the "-A ${asset-dir}" argument
-only when the assets dir exists. -->
+ <!-- Invoke the proper target depending on whether or not an assets directory is present. -->
<target name="package-res">
<available file="${asset-dir}" type="dir"
property="res-target" value="and-assets" />
</target>
<!-- Install the package on the default emulator -->
- <target name="install" depends="debug">
+ <target name="install">
<echo>Installing ${out-debug-package} onto default emulator...</echo>
<exec executable="${adb}" failonerror="true">
<arg value="install" />
</exec>
</target>
- <target name="reinstall" depends="debug">
+ <target name="reinstall">
<echo>Installing ${out-debug-package} onto default emulator...</echo>
<exec executable="${adb}" failonerror="true">
<arg value="install" />