2007-10-23 12:12:27 -07:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2007-11-28 09:19:36 -08:00
|
|
|
|
|
|
|
<!--
|
2008-06-19 13:56:24 -07:00
|
|
|
Copyright 2007 ZXing authors
|
2007-11-28 09:19:36 -08:00
|
|
|
|
|
|
|
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.
|
|
|
|
-->
|
|
|
|
|
2007-10-23 12:12:27 -07:00
|
|
|
<project name="core" default="build">
|
|
|
|
|
2007-11-14 07:27:06 -08:00
|
|
|
<property file="../build.properties"/>
|
2007-10-23 12:12:27 -07:00
|
|
|
|
|
|
|
<target name="init">
|
|
|
|
<tstamp/>
|
2007-11-26 12:04:32 -08:00
|
|
|
</target>
|
|
|
|
|
2008-06-20 08:22:45 -07:00
|
|
|
<target name="compile" depends="init">
|
2007-10-23 12:12:27 -07:00
|
|
|
<mkdir dir="build"/>
|
|
|
|
<javac srcdir="src"
|
|
|
|
destdir="build"
|
2007-11-29 11:44:05 -08:00
|
|
|
source="1.2"
|
|
|
|
target="1.2"
|
2007-10-23 12:12:27 -07:00
|
|
|
optimize="true"
|
2008-06-20 08:22:45 -07:00
|
|
|
debug="${generate-debug}"
|
2007-10-23 12:12:27 -07:00
|
|
|
deprecation="true"
|
2008-11-17 14:10:45 -08:00
|
|
|
fork="true"/>
|
2008-06-18 10:40:14 -07:00
|
|
|
<jar jarfile="core.jar" basedir="build">
|
2009-09-15 02:06:45 -07:00
|
|
|
<!-- These entries allow core.jar to function as an OSGi bundle, and also specifies
|
2008-06-16 11:25:56 -07:00
|
|
|
additional attributes for compatibility with BugLabs's BUG platform.
|
|
|
|
Thanks to David Albert for this change. -->
|
|
|
|
<manifest>
|
2008-06-18 10:40:14 -07:00
|
|
|
<attribute name="Bundle-Name" value="ZXing"/>
|
2008-06-16 11:25:56 -07:00
|
|
|
<attribute name="Bundle-Vendor" value="ZXing Project"/>
|
2008-06-18 10:40:14 -07:00
|
|
|
<attribute name="Bundle-SymbolicName" value="ZXing"/>
|
2009-12-20 12:08:32 -08:00
|
|
|
<attribute name="Bundle-Version" value="${version}"/>
|
2008-06-16 11:25:56 -07:00
|
|
|
<attribute name="Export-Package" value="com.google.zxing,com.google.zxing.common,com.google.zxing.client.result"/>
|
|
|
|
<attribute name="Bug-Bundle-Type" value="Application"/>
|
|
|
|
</manifest>
|
|
|
|
</jar>
|
2007-10-23 12:12:27 -07:00
|
|
|
</target>
|
|
|
|
|
2008-06-20 14:50:46 -07:00
|
|
|
<target name="build" depends="clean">
|
2008-06-20 08:22:45 -07:00
|
|
|
<antcall target="compile">
|
|
|
|
<param name="generate-debug" value="true"/>
|
|
|
|
</antcall>
|
|
|
|
</target>
|
|
|
|
|
2008-10-29 12:50:37 -07:00
|
|
|
<!-- This target is needed for building a core.jar which the Android client can use and run
|
|
|
|
ProGuard on successfully, because dx doesn't like debugging info. -->
|
2008-06-20 14:50:46 -07:00
|
|
|
<target name="build-no-debug" depends="clean">
|
2008-06-20 08:22:45 -07:00
|
|
|
<antcall target="compile">
|
|
|
|
<param name="generate-debug" value="false"/>
|
|
|
|
</antcall>
|
|
|
|
</target>
|
|
|
|
|
2009-12-20 12:08:32 -08:00
|
|
|
<!-- 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"/>
|
2010-04-12 01:59:41 -07:00
|
|
|
<java jar="${proguard-jar}" fork="true" failonerror="true">
|
2009-12-20 12:08:32 -08:00
|
|
|
<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. -->
|
2010-09-13 03:58:48 -07:00
|
|
|
<!--<arg value="-libraryjars ${android-home}/platforms/android-3/android.jar"/>-->
|
2009-12-20 12:08:32 -08:00
|
|
|
<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>
|
|
|
|
|
2008-06-12 10:11:07 -07:00
|
|
|
<target name="build-test" depends="init,build">
|
2008-02-12 09:00:55 -08:00
|
|
|
<fail message="Please build 'javase' first">
|
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<available file="../javase/javase.jar" type="file"/>
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
2007-11-14 07:27:06 -08:00
|
|
|
<mkdir dir="build-test"/>
|
|
|
|
<javac srcdir="test/src"
|
|
|
|
destdir="build-test"
|
|
|
|
debug="true"
|
|
|
|
deprecation="true">
|
|
|
|
<classpath>
|
2008-06-12 08:55:42 -07:00
|
|
|
<pathelement location="core.jar"/>
|
2007-11-30 14:24:02 -08:00
|
|
|
<pathelement location="../javase/javase.jar"/>
|
2010-09-30 15:26:48 -07:00
|
|
|
<pathelement location="lib/junit-4.8.2.jar"/>
|
2007-11-14 07:27:06 -08:00
|
|
|
</classpath>
|
|
|
|
</javac>
|
2008-04-18 10:03:04 -07:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test-blackbox" depends="build-test">
|
2008-08-06 13:26:05 -07:00
|
|
|
<parallel failonany="true">
|
|
|
|
<antcall target="test-blackbox-subset">
|
|
|
|
<param name="subdir" value="datamatrix"/>
|
|
|
|
</antcall>
|
|
|
|
<antcall target="test-blackbox-subset">
|
|
|
|
<param name="subdir" value="negative"/>
|
|
|
|
</antcall>
|
|
|
|
<antcall target="test-blackbox-subset">
|
|
|
|
<param name="subdir" value="oned"/>
|
|
|
|
</antcall>
|
2009-06-30 11:51:43 -07:00
|
|
|
<antcall target="test-blackbox-subset">
|
|
|
|
<param name="subdir" value="pdf417"/>
|
|
|
|
</antcall>
|
2008-08-06 13:26:05 -07:00
|
|
|
<antcall target="test-blackbox-subset">
|
|
|
|
<param name="subdir" value="qrcode"/>
|
|
|
|
</antcall>
|
|
|
|
</parallel>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test-blackbox-subset">
|
2008-01-22 11:59:11 -08:00
|
|
|
<junit printsummary="on" haltonfailure="on" haltonerror="on" fork="true" dir=".">
|
2007-11-14 07:27:06 -08:00
|
|
|
<formatter type="plain" usefile="false"/>
|
|
|
|
<classpath>
|
2008-06-12 08:55:42 -07:00
|
|
|
<pathelement location="core.jar"/>
|
2007-11-29 11:44:05 -08:00
|
|
|
<pathelement location="build-test"/>
|
2008-01-16 14:42:02 -08:00
|
|
|
<pathelement location="../javase/javase.jar"/>
|
2010-09-30 15:26:48 -07:00
|
|
|
<pathelement location="lib/junit-4.8.2.jar"/>
|
2007-11-14 07:27:06 -08:00
|
|
|
</classpath>
|
|
|
|
<assertions>
|
|
|
|
<enable/>
|
|
|
|
</assertions>
|
2010-08-13 10:20:42 -07:00
|
|
|
<jvmarg value="-Djava.awt.headless=true"/>
|
2007-11-14 07:27:06 -08:00
|
|
|
<batchtest>
|
|
|
|
<fileset dir="test/src">
|
2008-08-06 13:26:05 -07:00
|
|
|
<include name="**/${subdir}/*BlackBox*TestCase.java"/>
|
2009-12-20 12:08:32 -08:00
|
|
|
<exclude name="**/Abstract*.java"/>
|
2007-11-14 07:27:06 -08:00
|
|
|
</fileset>
|
|
|
|
</batchtest>
|
|
|
|
</junit>
|
|
|
|
</target>
|
|
|
|
|
2008-04-18 10:03:04 -07:00
|
|
|
<target name="test-unit" depends="build-test">
|
|
|
|
<junit printsummary="on" haltonfailure="on" haltonerror="on" fork="true" dir=".">
|
|
|
|
<formatter type="plain" usefile="false"/>
|
|
|
|
<classpath>
|
2008-06-12 08:55:42 -07:00
|
|
|
<pathelement location="core.jar"/>
|
2008-04-18 10:03:04 -07:00
|
|
|
<pathelement location="build-test"/>
|
|
|
|
<pathelement location="../javase/javase.jar"/>
|
2010-09-30 15:26:48 -07:00
|
|
|
<pathelement location="lib/junit-4.8.2.jar"/>
|
2008-04-18 10:03:04 -07:00
|
|
|
</classpath>
|
|
|
|
<assertions>
|
|
|
|
<enable/>
|
|
|
|
</assertions>
|
2010-08-13 10:20:42 -07:00
|
|
|
<jvmarg value="-Djava.awt.headless=true"/>
|
2008-04-18 10:03:04 -07:00
|
|
|
<batchtest>
|
|
|
|
<fileset dir="test/src">
|
2009-12-20 12:08:32 -08:00
|
|
|
<include name="**/*TestCase.java"/>
|
2008-04-18 10:03:04 -07:00
|
|
|
<exclude name="**/*BlackBox*TestCase.java"/>
|
2008-11-15 05:50:18 -08:00
|
|
|
<exclude name="**/Abstract*.java"/>
|
2008-04-18 10:03:04 -07:00
|
|
|
</fileset>
|
|
|
|
</batchtest>
|
|
|
|
</junit>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test" depends="test-unit,test-blackbox"/>
|
|
|
|
|
2007-10-23 12:12:27 -07:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="build"/>
|
2007-11-29 11:44:05 -08:00
|
|
|
<delete dir="build-test"/>
|
2009-12-20 12:08:32 -08:00
|
|
|
<delete dir="optimized"/>
|
2007-10-23 12:12:27 -07:00
|
|
|
<delete file="core.jar"/>
|
2008-07-10 13:25:42 -07:00
|
|
|
<delete file="ZXingReader.*"/>
|
2008-10-29 08:42:22 -07:00
|
|
|
<delete file="proguard-dump.txt"/>
|
2007-10-23 12:12:27 -07:00
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|