Reverted inadvertent Detector changes that broke unit tests. Fixed test target to...
[zxing.git] / core / build.xml
index 9396a83..03146b0 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"
@@ -39,7 +39,7 @@
            target="1.2"
            bootclasspath="${javame-compile-bootclasspath-path}"
            optimize="true"
-           debug="true"
+           debug="${generate-debug}"
            deprecation="true"
            fork="true"/>
     <jar jarfile="core.jar" basedir="build">
     </jar>
   </target>
 
-  <target name="build-optimized" depends="build">
+  <target name="build" depends="clean">
+    <antcall target="compile">
+      <param name="generate-debug" value="true"/>
+    </antcall>
+  </target>
+
+  <target name="build-no-debug" depends="clean">
+    <antcall target="compile">
+      <param name="generate-debug" value="false"/>
+    </antcall>
+  </target>
+
+  <!-- This target really supports the Android client, where we can't as easily build
+       an optimized .apk directly, and need an optimized library. We have to strip debug info
+       above to appease dex -->
+  <target name="build-optimized" depends="build-no-debug">
     <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,!LocalVariableTable"/>
+      <arg value="-keepattributes Exceptions,InnerClasses,Signature,!LocalVariableTable,!LocalVariableTypeTable"/>
       <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 *; }"/>
     <delete file="temp.jar"/>
   </target>
 
+  <target name="dump">
+    <java jar="${WTK-home}/bin/proguard.jar" fork="true">
+      <arg value="-injars core.jar"/>
+      <arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/>
+      <arg value="-dontshrink"/>
+      <arg value="-dontobfuscate"/>
+      <arg value="-dontoptimize"/>
+      <arg value="-dump dump.txt"/>
+    </java>
+  </target>
+
   <target name="build-test" depends="init,build">
     <fail message="Please build 'javase' first">
       <condition>
         <fileset dir="test/src">
           <include name="**/*BlackBox*TestCase.java"/>
           <exclude name="com/google/zxing/common/AbstractBlackBoxTestCase.java"/>
+          <exclude name="com/google/zxing/common/AbstractNegativeBlackBoxTestCase.java"/>
         </fileset>
       </batchtest>
     </junit>
       </assertions>
       <batchtest>
         <fileset dir="test/src">
+          <include name="**/*TestCase.java"/>          
           <exclude name="**/*BlackBox*TestCase.java"/>
         </fileset>
       </batchtest>
     <delete dir="build"/>
     <delete dir="build-test"/>
     <delete file="core.jar"/>
+    <delete file="ZXingReader.*"/>
   </target>
 
 </project>