2008-03-28 09:54:29 -07:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2008-02-14 12:21:33 -08:00
|
|
|
<!--
|
|
|
|
Copyright (C) 2008 Google Inc.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<!-- This is a mildly hacked version of the auto-generated project
|
|
|
|
build.xml file. -->
|
2008-03-31 13:55:38 -07:00
|
|
|
<project name="BarcodeReaderM5" default="package">
|
2008-02-14 12:21:33 -08:00
|
|
|
<property file="../build.properties"/>
|
|
|
|
<property name="sdk-folder" value="${android-home}"/>
|
|
|
|
<property name="android-tools" value="${sdk-folder}/tools"/>
|
2008-03-28 09:54:29 -07:00
|
|
|
<property name="android-framework" value="${android-tools}/lib/framework.aidl"/>
|
2008-02-14 12:21:33 -08:00
|
|
|
|
|
|
|
<!-- The intermediates directory -->
|
|
|
|
<!-- Eclipse uses "bin" for its own output, so we do the same. -->
|
|
|
|
<property name="outdir" value="bin"/>
|
|
|
|
|
|
|
|
<!-- No user servicable parts below. -->
|
|
|
|
|
|
|
|
<!-- Input directories -->
|
|
|
|
<property name="resource-dir" value="res"/>
|
|
|
|
<property name="asset-dir" value="assets"/>
|
|
|
|
<property name="srcdir" value="src"/>
|
|
|
|
|
|
|
|
<!-- Output directories -->
|
|
|
|
<property name="outdir-classes" value="${outdir}/classes"/>
|
|
|
|
|
|
|
|
<!-- Create R.java in the source directory -->
|
|
|
|
<property name="outdir-r" value="src"/>
|
|
|
|
|
|
|
|
<!-- Intermediate files -->
|
|
|
|
<property name="dex-file" value="classes.dex"/>
|
2008-04-15 17:34:13 -07:00
|
|
|
<property name="intermediate-dex" location="${outdir}/${dex-file}"/>
|
2008-02-14 12:21:33 -08:00
|
|
|
|
|
|
|
<!-- The final package file to generate -->
|
2008-03-31 13:55:38 -07:00
|
|
|
<property name="out-package" value="${outdir}/BarcodeReader.apk"/>
|
2008-02-14 12:21:33 -08:00
|
|
|
|
|
|
|
<!-- Tools -->
|
|
|
|
<property name="aapt" value="${android-tools}/aapt"/>
|
|
|
|
<property name="aidl" value="${android-tools}/aidl"/>
|
2008-04-15 17:34:13 -07:00
|
|
|
<!-- dx is a special case as it is a .bat file on Windows -->
|
|
|
|
<condition property="dx" value="${android-tools}/dx.bat" else="${android-tools}/dx">
|
|
|
|
<os family="windows"/>
|
|
|
|
</condition>
|
2008-03-28 09:54:29 -07:00
|
|
|
<property name="adb" value="${android-tools}/adb" />
|
|
|
|
<property name="android-jar" value="${sdk-folder}/android.jar" />
|
2008-02-14 12:21:33 -08:00
|
|
|
<property name="zip" value="zip"/>
|
|
|
|
|
|
|
|
<!-- Rules -->
|
|
|
|
|
|
|
|
<target name="init">
|
|
|
|
<tstamp/>
|
2008-04-21 16:16:48 -07:00
|
|
|
<fail message="Please set 'android-home' in build.properties">
|
2008-02-14 12:21:33 -08:00
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<available file="${android-home}" type="dir"/>
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
2008-02-14 12:25:54 -08:00
|
|
|
<fail message="Please build 'core' first">
|
2008-02-14 12:21:33 -08:00
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<available file="../core/core.jar" type="file"/>
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
2008-02-22 10:13:00 -08:00
|
|
|
<fail message="Please put proguard.jar in 'bin' under the WTK install directory">
|
|
|
|
<condition>
|
|
|
|
<and>
|
|
|
|
<not>
|
|
|
|
<isset property="debug"/>
|
|
|
|
</not>
|
|
|
|
<not>
|
|
|
|
<available file="${WTK-home}/bin/proguard.jar" type="file"/>
|
|
|
|
</not>
|
|
|
|
</and>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
2008-02-14 12:21:33 -08:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Create the output directories if they don't exist yet. -->
|
|
|
|
<target name="dirs">
|
|
|
|
<mkdir dir="${outdir}"/>
|
|
|
|
<mkdir dir="${outdir-classes}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Generate the R.java file for this project's resources. -->
|
|
|
|
<target name="resource-src" depends="dirs">
|
2008-03-19 13:23:10 -07:00
|
|
|
|
|
|
|
<copy file="strings.xml.template" tofile="res/values/strings.xml" overwrite="true">
|
|
|
|
<filterset>
|
|
|
|
<filter token="VERSION" value="${version}"/>
|
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
|
2008-02-14 12:21:33 -08:00
|
|
|
<echo>Generating R.java...</echo>
|
|
|
|
<exec executable="${aapt}" failonerror="true">
|
|
|
|
<arg value="compile"/>
|
|
|
|
<arg value="-m"/>
|
|
|
|
<arg value="-J"/>
|
|
|
|
<arg value="${outdir-r}"/>
|
|
|
|
<arg value="-M"/>
|
|
|
|
<arg value="AndroidManifest.xml"/>
|
|
|
|
<arg value="-S"/>
|
|
|
|
<arg value="${resource-dir}"/>
|
|
|
|
<arg value="-I"/>
|
|
|
|
<arg value="${android-jar}"/>
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Generate java classes from .aidl files. -->
|
|
|
|
<target name="aidl" depends="dirs">
|
|
|
|
<apply executable="${aidl}" failonerror="true">
|
2008-03-28 09:54:29 -07:00
|
|
|
<arg value="-p${android-framework}"/>
|
|
|
|
<arg value="-I${srcdir}"/>
|
2008-02-14 12:21:33 -08:00
|
|
|
<fileset dir="${srcdir}">
|
|
|
|
<include name="**/*.aidl"/>
|
|
|
|
</fileset>
|
|
|
|
</apply>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Compile this project's .java files into .class files. -->
|
2008-02-22 11:32:35 -08:00
|
|
|
<target name="compile" depends="init, clean, dirs, resource-src, aidl">
|
2008-02-22 10:13:00 -08:00
|
|
|
<javac encoding="ascii" target="1.5" debug="true" optimize="true" extdirs=""
|
2008-02-14 12:21:33 -08:00
|
|
|
srcdir="."
|
|
|
|
destdir="${outdir-classes}"
|
|
|
|
bootclasspath="${android-jar}">
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="../core/core.jar"/>
|
|
|
|
</classpath>
|
|
|
|
</javac>
|
|
|
|
<unzip src="../core/core.jar" dest="${outdir-classes}"/>
|
|
|
|
</target>
|
|
|
|
|
2008-02-22 10:13:00 -08:00
|
|
|
<target name="optimize" depends="compile" unless="debug">
|
2008-02-21 08:36:27 -08:00
|
|
|
<jar basedir="${outdir-classes}" destfile="temp.jar"/>
|
|
|
|
<java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
|
Merged revisions 321,327,330,332,334,342-343,352-353,355-358,361-363,365,372 via svnmerge from
https://zxing.googlecode.com/svn/trunk/android-m3
........
r321 | srowen | 2008-03-28 09:57:55 -0700 (Fri, 28 Mar 2008) | 1 line
Updates for 0.6; set aside a different android-m3-home variable for android-m3 build
........
r327 | srowen | 2008-03-31 12:04:38 -0700 (Mon, 31 Mar 2008) | 1 line
Made the RGB to luminance approximation/optimization a little faster -- one less shift
........
r330 | dswitkin | 2008-03-31 13:55:38 -0700 (Mon, 31 Mar 2008) | 1 line
Changed the project names for the two Android clients to disambiguate them.
........
r332 | dswitkin | 2008-04-01 09:11:36 -0700 (Tue, 01 Apr 2008) | 1 line
Added some debugging features to the M3 Android client. You can now press 'C' to capture a photo, 'U' to decode only UPC/1D barcodes, and 'Q' to decode only QR Codes.
........
r334 | dswitkin | 2008-04-01 12:23:05 -0700 (Tue, 01 Apr 2008) | 1 line
Added latency measurement in milliseconds to the Android client.
........
r342 | dswitkin | 2008-04-03 14:13:50 -0700 (Thu, 03 Apr 2008) | 1 line
Improved the Android M3 viewfinder display, by making the framing box larger and zooming in. Also fixed a bug when restarting the activity where the camera params were stale. Fixed handling of geo and tel URIs.
........
r343 | srowen | 2008-04-03 15:18:16 -0700 (Thu, 03 Apr 2008) | 1 line
Moved the "geo:" fix to the 'right' place
........
r352 | dswitkin | 2008-04-08 08:25:13 -0700 (Tue, 08 Apr 2008) | 1 line
Rewrote the Android M3 client to do continuous decoding, which means you no longer have to push the shutter button. Now you can just place the barcode in the viewfinder and it will display the contents as soon as it decodes them. That also means you no longer get "barcode not found" error dialogs which is a big improvement. Also made sure that capturing debug JPEGs uses unique filenames.
........
r353 | dswitkin | 2008-04-08 09:06:13 -0700 (Tue, 08 Apr 2008) | 1 line
Improved the CameraThread state machine, and fixed a bug where preview would not continue after capture.
........
r355 | dswitkin | 2008-04-10 13:57:37 -0700 (Thu, 10 Apr 2008) | 1 line
Made sure the BitmapSource subclasses do not reuse a BitArray which is too small.
........
r356 | dswitkin | 2008-04-11 12:30:54 -0700 (Fri, 11 Apr 2008) | 1 line
Changed ProGuard settings so it will inline methods which use private members. This eliminates tens of thousands of function calls to BitArray.get() on a typical decode, and lots of other work as well. Overall we're roughly 20% faster by using ProGuard than turning it off.
........
r357 | dswitkin | 2008-04-11 13:25:09 -0700 (Fri, 11 Apr 2008) | 1 line
Made the worker threads shut down synchronously to fix a race condition where the CameraManager could close the camera driver too soon.
........
r358 | dswitkin | 2008-04-11 14:16:08 -0700 (Fri, 11 Apr 2008) | 1 line
Added 'T' as a shortcut to toggle debug method tracing using android.os.Debug and traceview for analysis. The traces are written to /sdcard, which means the SD Card must not be mounted as a volume by USB at the time. Tracing can slow down decoding by a factor of 5 or more but gives very useful insights into where the time is going.
........
r361 | dswitkin | 2008-04-15 15:34:49 -0700 (Tue, 15 Apr 2008) | 1 line
A couple small improvements to the CameraManager.
........
r362 | srowen | 2008-04-15 17:27:36 -0700 (Tue, 15 Apr 2008) | 1 line
Small simplification of build file condition properties using else attribute
........
r363 | srowen | 2008-04-15 17:34:13 -0700 (Tue, 15 Apr 2008) | 1 line
Fix Issue 50, not building on Windows, by adding some small workarounds for Windows paths in build files for Android
........
r365 | dswitkin | 2008-04-17 13:09:17 -0700 (Thu, 17 Apr 2008) | 1 line
Converted the Android client to use a status bar on the bottom of the screen instead of dialogs for a much better, less interrupting user experience.
........
r372 | dswitkin | 2008-04-21 11:11:02 -0700 (Mon, 21 Apr 2008) | 1 line
Added some simple sharpening for 1D decoding which allowed a couple more blackbox images to pass. There were a few cases where the format or content is now misdetected, but since the net gain was positive I decided to make those non-fatal errors. In real world use the sharpening seems to help, and I think we can do even better with a better algorithm.
........
git-svn-id: https://zxing.googlecode.com/svn/trunk@374 59b500cc-1b3d-0410-9834-0bbf25fbcc57
2008-04-21 15:44:40 -07:00
|
|
|
<jvmarg value="-Dmaximum.inlined.code.length=32"/>
|
|
|
|
<arg value="-injars temp.jar"/>
|
|
|
|
<arg value="-outjars optimized.jar"/>
|
|
|
|
<arg value="-libraryjars ${android-jar}"/>
|
|
|
|
<arg value="-dontpreverify"/>
|
|
|
|
<arg value="-dontobfuscate"/>
|
|
|
|
<!-- Temporary workaround to keep important stuff in the client, while inlining core. -->
|
|
|
|
<arg value="-keep class com.google.zxing.client.android.BarcodeReaderCaptureActivity { *; }"/>
|
|
|
|
<arg value="-keep class com.google.zxing.client.android.CameraManager { *; }"/>
|
|
|
|
<arg value="-keep class com.google.zxing.client.android.CameraThread { *; }"/>
|
|
|
|
<arg value="-optimizationpasses 7"/>
|
|
|
|
<arg value="-overloadaggressively"/>
|
|
|
|
<arg value="-verbose"/>
|
|
|
|
<!-- Needed to allow getters which refer to private members to be inlined. -->
|
|
|
|
<arg value="-allowaccessmodification"/>
|
|
|
|
</java>
|
|
|
|
<delete file="temp.jar"/>
|
|
|
|
<delete dir="${outdir-classes}"/>
|
|
|
|
<mkdir dir="${outdir-classes}"/>
|
|
|
|
<unzip src="optimized.jar" dest="${outdir-classes}"/>
|
|
|
|
<delete file="optimized.jar"/>
|
2008-02-21 08:36:27 -08:00
|
|
|
</target>
|
|
|
|
|
2008-02-14 12:21:33 -08:00
|
|
|
<!-- Convert this project's .class files into .dex files. -->
|
2008-02-21 08:36:27 -08:00
|
|
|
<target name="dex" depends="compile, optimize">
|
2008-02-22 10:13:00 -08:00
|
|
|
|
2008-04-15 17:27:36 -07:00
|
|
|
<condition property="locals" value="full" else="none">
|
2008-02-22 10:13:00 -08:00
|
|
|
<isset property="debug"/>
|
|
|
|
</condition>
|
2008-04-15 17:27:36 -07:00
|
|
|
<condition property="positions" value="lines" else="none">
|
2008-02-22 10:13:00 -08:00
|
|
|
<isset property="debug"/>
|
|
|
|
</condition>
|
|
|
|
|
2008-02-14 12:21:33 -08:00
|
|
|
<exec executable="${dx}" failonerror="true">
|
|
|
|
<arg value="--dex"/>
|
|
|
|
<arg value="--output=${intermediate-dex}"/>
|
2008-02-22 10:13:00 -08:00
|
|
|
<arg value="--locals=${locals}"/>
|
|
|
|
<arg value="--positions=${positions}"/>
|
2008-03-28 09:54:29 -07:00
|
|
|
<arg path="${basedir}/${outdir-classes}"/>
|
2008-02-14 12:21:33 -08:00
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Put the project's resources into the output package file. -->
|
|
|
|
<target name="package-res-and-assets">
|
|
|
|
<echo>Packaging resources and assets...</echo>
|
|
|
|
<exec executable="${aapt}" failonerror="true">
|
|
|
|
<arg value="package"/>
|
|
|
|
<arg value="-f"/>
|
|
|
|
<arg value="-c"/>
|
|
|
|
<arg value="-M"/>
|
|
|
|
<arg value="AndroidManifest.xml"/>
|
|
|
|
<arg value="-S"/>
|
|
|
|
<arg value="${resource-dir}"/>
|
|
|
|
<arg value="-A"/>
|
|
|
|
<arg value="${asset-dir}"/>
|
|
|
|
<arg value="-I"/>
|
|
|
|
<arg value="${android-jar}"/>
|
|
|
|
<arg value="${out-package}"/>
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Same as package-res-and-assets, but without "-A ${asset-dir}" -->
|
|
|
|
<target name="package-res-no-assets">
|
|
|
|
<echo>Packaging resources...</echo>
|
|
|
|
<exec executable="${aapt}" failonerror="true">
|
|
|
|
<arg value="package"/>
|
|
|
|
<arg value="-f"/>
|
|
|
|
<arg value="-c"/>
|
|
|
|
<arg value="-M"/>
|
|
|
|
<arg value="AndroidManifest.xml"/>
|
|
|
|
<arg value="-S"/>
|
|
|
|
<arg value="${resource-dir}"/>
|
|
|
|
<!-- No assets directory -->
|
|
|
|
<arg value="-I"/>
|
|
|
|
<arg value="${android-jar}"/>
|
|
|
|
<arg value="${out-package}"/>
|
|
|
|
</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. -->
|
|
|
|
<target name="package-res">
|
|
|
|
<available file="${asset-dir}" type="dir"
|
|
|
|
property="res-target" value="and-assets"/>
|
|
|
|
<property name="res-target" value="no-assets"/>
|
|
|
|
<antcall target="package-res-${res-target}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Put the project's .class files into the output package file. -->
|
|
|
|
<target name="package-java" depends="compile, package-res">
|
|
|
|
<echo>Packaging java...</echo>
|
|
|
|
<jar destfile="${out-package}"
|
|
|
|
basedir="${outdir-classes}"
|
|
|
|
update="true"/>
|
|
|
|
</target>
|
|
|
|
|
2008-03-28 09:54:29 -07:00
|
|
|
<!-- Put the project's .dex files into the output package file.
|
|
|
|
Use the "zip" command, available on most un*x/Linux/MacOS systems,
|
|
|
|
to create the new package (Ant 1.7 has an internal 'zip' command,
|
|
|
|
however Ant 1.6.5 lacks it and is still widely installed.)
|
|
|
|
-->
|
2008-02-14 12:21:33 -08:00
|
|
|
<target name="package-dex" depends="dex, package-res">
|
|
|
|
<echo>Packaging dex...</echo>
|
|
|
|
<exec executable="${zip}" failonerror="true">
|
|
|
|
<arg value="-qj"/>
|
|
|
|
<arg value="${out-package}"/>
|
|
|
|
<arg value="${intermediate-dex}"/>
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Create the package file for this project from the sources. -->
|
|
|
|
<target name="package" depends="package-dex"/>
|
2008-02-14 13:06:57 -08:00
|
|
|
|
2008-03-28 09:54:29 -07:00
|
|
|
<!-- Install package on the default emulator -->
|
|
|
|
<target name="install">
|
|
|
|
<echo>Sending package to default emulator...</echo>
|
|
|
|
<exec executable="${adb}" failonerror="true">
|
|
|
|
<arg value="install" />
|
|
|
|
<arg value="${out-package}" />
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
2008-02-14 13:06:57 -08:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="${outdir}"/>
|
|
|
|
</target>
|
|
|
|
|
2008-02-14 12:21:33 -08:00
|
|
|
</project>
|