Add to result the raw, but parsed, bytes of byte segments in 2D barcodes
[zxing.git] / core / build.xml
index ef39f63..633d81b 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <!--
- Copyright 2007 Google Inc.
+ Copyright 2007 ZXing authors
 
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@
     <tstamp/>
   </target>
 
-  <target name="build" depends="init">
+  <target name="compile" depends="init">
     <mkdir dir="build"/>
     <javac srcdir="src"
            destdir="build"
            target="1.2"
            bootclasspath="${javame-compile-bootclasspath-path}"
            optimize="true"
-           debug="true"
+           debug="${generate-debug}"
            deprecation="true"
-           fork="true"/>
+           fork="true">
+      <!-- TODO re-add this package -->
+      <exclude name="com/google/zxing/qrcode/encoder/**"/>
+    </javac>
     <jar jarfile="core.jar" basedir="build">
       <!-- These entries allow core.jar to function as an OSGi bundle, and also specifices
            additional attributes for compatibility with BugLabs's BUG platform.
     </jar>
   </target>
 
-  <target name="build-optimized" depends="build">
-    <move file="core.jar" tofile="temp.jar"/>
-    <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
-      <jvmarg value="-Dmaximum.inlined.code.length=32"/>
-      <arg value="-injars temp.jar"/>
-      <arg value="-outjars core.jar"/>
-      <arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/>
-      <arg value="-renamesourcefileattribute SourceFile"/>
-      <arg value="-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod"/>
-      <arg value="-keep public class com.google.zxing.* { public protected *; }"/>
-      <arg value="-keep public class com.google.zxing.client.result.* { public protected *; }"/>
-      <arg value="-keep public class com.google.zxing.common.* { public protected *; }"/>
-      <arg value="-optimizationpasses 7"/>
-      <arg value="-overloadaggressively"/>
-      <arg value="-allowaccessmodification"/>
-      <arg value="-verbose"/>
-    </java>
-    <delete file="temp.jar"/>
+  <target name="build" depends="clean">
+    <antcall target="compile">
+      <param name="generate-debug" value="true"/>
+    </antcall>
+  </target>
+
+  <!-- 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. -->
+  <target name="build-no-debug" depends="clean">
+    <antcall target="compile">
+      <param name="generate-debug" value="false"/>
+    </antcall>
   </target>
 
   <target name="build-test" depends="init,build">
   </target>
 
   <target name="test-blackbox" depends="build-test">
+    <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>
+      <antcall target="test-blackbox-subset">
+        <param name="subdir" value="qrcode"/>
+      </antcall>
+    </parallel>
+  </target>
+
+  <target name="test-blackbox-subset">
     <junit printsummary="on" haltonfailure="on" haltonerror="on" fork="true" dir=".">
       <formatter type="plain" usefile="false"/>
       <classpath>
       </assertions>
       <batchtest>
         <fileset dir="test/src">
-          <include name="**/*BlackBox*TestCase.java"/>
-          <exclude name="com/google/zxing/common/AbstractBlackBoxTestCase.java"/>
+          <include name="**/${subdir}/*BlackBox*TestCase.java"/>
+          <exclude name="**/Abstract*.java"/>            
         </fileset>
       </batchtest>
     </junit>
       </assertions>
       <batchtest>
         <fileset dir="test/src">
+          <include name="**/*TestCase.java"/>          
           <exclude name="**/*BlackBox*TestCase.java"/>
+          <exclude name="**/Abstract*.java"/>
         </fileset>
       </batchtest>
     </junit>
     <delete dir="build"/>
     <delete dir="build-test"/>
     <delete file="core.jar"/>
+    <delete file="ZXingReader.*"/>
+    <delete file="proguard-dump.txt"/>
   </target>
 
 </project>