Added the PDF 417 blackbox tests to the test-blackbox Ant target.
[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 specifices
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       <batchtest>
120         <fileset dir="test/src">
121           <include name="**/${subdir}/*BlackBox*TestCase.java"/>
122           <exclude name="**/Abstract*.java"/>            
123         </fileset>
124       </batchtest>
125     </junit>
126   </target>
127
128   <target name="test-unit" depends="build-test">
129     <junit printsummary="on" haltonfailure="on" haltonerror="on" fork="true" dir=".">
130       <formatter type="plain" usefile="false"/>
131       <classpath>
132         <pathelement location="core.jar"/>
133         <pathelement location="build-test"/>
134         <pathelement location="../javase/javase.jar"/>
135         <pathelement location="lib/junit.jar"/>
136       </classpath>
137       <assertions>
138         <enable/>
139       </assertions>
140       <batchtest>
141         <fileset dir="test/src">
142           <include name="**/*TestCase.java"/>          
143           <exclude name="**/*BlackBox*TestCase.java"/>
144           <exclude name="**/Abstract*.java"/>
145         </fileset>
146       </batchtest>
147     </junit>
148   </target>
149
150   <target name="test" depends="test-unit,test-blackbox"/>
151
152   <target name="clean">
153     <delete dir="build"/>
154     <delete dir="build-test"/>
155     <delete file="core.jar"/>
156     <delete file="ZXingReader.*"/>
157     <delete file="proguard-dump.txt"/>
158   </target>
159
160 </project>