Added a check so that the PDF417 reader can get through the partial blackbox test.
[zxing.git] / core / build.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4  Copyright 2007 ZXing authors
5
6  Licensed under the Apache License, Version 2.0 (the "License");
7  you may not use this file except in compliance with the License.
8  You may obtain a copy of the License at
9
10       http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 -->
18
19 <project name="core" default="build">
20
21   <property file="../build.properties"/>
22
23   <target name="init">
24     <tstamp/>
25   </target>
26
27   <target name="compile" depends="init">
28     <mkdir dir="build"/>
29     <javac srcdir="src"
30            destdir="build"
31            source="1.2"
32            target="1.2"
33            optimize="true"
34            debug="${generate-debug}"
35            deprecation="true"
36            fork="true"/>
37     <jar jarfile="core.jar" basedir="build">
38       <!-- These entries allow core.jar to function as an OSGi bundle, and also specifies
39            additional attributes for compatibility with BugLabs's BUG platform.
40            Thanks to David Albert for this change. -->
41       <manifest>
42         <attribute name="Bundle-Name" value="ZXing"/>
43         <attribute name="Bundle-Vendor" value="ZXing Project"/>
44         <attribute name="Bundle-SymbolicName" value="ZXing"/>
45         <attribute name="Bundle-Version" value="${version}"/>        
46         <attribute name="Export-Package" value="com.google.zxing,com.google.zxing.common,com.google.zxing.client.result"/>
47         <attribute name="Bug-Bundle-Type" value="Application"/>
48       </manifest>
49     </jar>
50   </target>
51
52   <target name="build" depends="clean">
53     <antcall target="compile">
54       <param name="generate-debug" value="true"/>
55     </antcall>
56   </target>
57
58   <!-- This target is needed for building a core.jar which the Android client can use and run
59        ProGuard on successfully, because dx doesn't like debugging info. -->
60   <target name="build-no-debug" depends="clean">
61     <antcall target="compile">
62       <param name="generate-debug" value="false"/>
63     </antcall>
64   </target>
65
66   <target name="build-test" depends="init,build">
67     <fail message="Please build 'javase' first">
68       <condition>
69         <not>
70           <available file="../javase/javase.jar" type="file"/>
71         </not>
72       </condition>
73     </fail>
74     <mkdir dir="build-test"/>
75     <javac srcdir="test/src"
76            destdir="build-test"
77            debug="true"
78            deprecation="true">
79       <classpath>
80         <pathelement location="core.jar"/>
81         <pathelement location="../javase/javase.jar"/>
82         <pathelement location="lib/junit.jar"/>
83       </classpath>
84     </javac>
85   </target>
86
87   <target name="test-blackbox" depends="build-test">
88     <parallel failonany="true">
89       <antcall target="test-blackbox-subset">
90         <param name="subdir" value="datamatrix"/>
91       </antcall>
92       <antcall target="test-blackbox-subset">
93         <param name="subdir" value="negative"/>
94       </antcall>
95       <antcall target="test-blackbox-subset">
96         <param name="subdir" value="oned"/>
97       </antcall>
98       <antcall target="test-blackbox-subset">
99         <param name="subdir" value="pdf417"/>
100       </antcall>
101       <antcall target="test-blackbox-subset">
102         <param name="subdir" value="qrcode"/>
103       </antcall>
104     </parallel>
105   </target>
106
107   <target name="test-blackbox-subset">
108     <junit printsummary="on" haltonfailure="on" haltonerror="on" fork="true" dir=".">
109       <formatter type="plain" usefile="false"/>
110       <classpath>
111         <pathelement location="core.jar"/>
112         <pathelement location="build-test"/>
113         <pathelement location="../javase/javase.jar"/>
114         <pathelement location="lib/junit.jar"/>
115       </classpath>
116       <assertions>
117         <enable/>
118       </assertions>
119       <jvmarg value="-Xint"/> <!-- works around weird JIT bug in Java 6 -->
120       <batchtest>
121         <fileset dir="test/src">
122           <include name="**/${subdir}/*BlackBox*TestCase.java"/>
123           <exclude name="**/Abstract*.java"/>            
124         </fileset>
125       </batchtest>
126     </junit>
127   </target>
128
129   <target name="test-unit" depends="build-test">
130     <junit printsummary="on" haltonfailure="on" haltonerror="on" fork="true" dir=".">
131       <formatter type="plain" usefile="false"/>
132       <classpath>
133         <pathelement location="core.jar"/>
134         <pathelement location="build-test"/>
135         <pathelement location="../javase/javase.jar"/>
136         <pathelement location="lib/junit.jar"/>
137       </classpath>
138       <assertions>
139         <enable/>
140       </assertions>
141       <jvmarg value="-Xint"/> <!-- works around weird JIT bug in Java 6 -->
142       <batchtest>
143         <fileset dir="test/src">
144           <include name="**/*TestCase.java"/>          
145           <exclude name="**/*BlackBox*TestCase.java"/>
146           <exclude name="**/Abstract*.java"/>
147         </fileset>
148       </batchtest>
149     </junit>
150   </target>
151
152   <target name="test" depends="test-unit,test-blackbox"/>
153
154   <target name="clean">
155     <delete dir="build"/>
156     <delete dir="build-test"/>
157     <delete file="core.jar"/>
158     <delete file="ZXingReader.*"/>
159     <delete file="proguard-dump.txt"/>
160   </target>
161
162 </project>