Now can use "-Ddebug=true" on the command line to build a non-optimized build with...
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Fri, 22 Feb 2008 18:13:00 +0000 (18:13 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Fri, 22 Feb 2008 18:13:00 +0000 (18:13 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@222 59b500cc-1b3d-0410-9834-0bbf25fbcc57

android/build.xml

index f19d5f4..fa69b0c 100644 (file)
         </not>
       </condition>
     </fail>
+    <fail message="Please put proguard.jar in 'bin' under the WTK install directory">
+      <condition>
+        <and>
+          <not>
+            <isset property="debug"/>
+          </not>
+          <not>
+            <available file="${WTK-home}/bin/proguard.jar" type="file"/>
+          </not>
+        </and>
+      </condition>
+    </fail>
   </target>
 
   <!-- Create the output directories if they don't exist yet. -->
 
   <!-- Compile this project's .java files into .class files. -->
   <target name="compile" depends="init, dirs, resource-src, aidl">
-    <javac encoding="ascii" target="1.5" debug="false" optimize="true" extdirs=""
+    <javac encoding="ascii" target="1.5" debug="true" optimize="true" extdirs=""
            srcdir="."
            destdir="${outdir-classes}"
            bootclasspath="${android-jar}">
     <unzip src="../core/core.jar" dest="${outdir-classes}"/>
   </target>
 
-  <target name="optimize" depends="compile">
+  <target name="optimize" depends="compile" unless="debug">
     <jar basedir="${outdir-classes}" destfile="temp.jar"/>
     <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
      <arg value="-injars temp.jar"/>
 
   <!-- Convert this project's .class files into .dex files. -->
   <target name="dex" depends="compile, optimize">
+
+    <condition property="locals" value="full">
+      <isset property="debug"/>
+    </condition>
+    <condition property="locals" value="none">
+      <not>
+        <isset property="debug"/>
+      </not>
+    </condition>
+    <condition property="positions" value="lines">
+      <isset property="debug"/>
+    </condition>
+    <condition property="positions" value="none">
+      <not>
+        <isset property="debug"/>
+      </not>
+    </condition>
+
     <exec executable="${dx}" failonerror="true">
       <arg value="-JXmx384M"/>
       <arg value="--dex"/>
       <arg value="--output=${intermediate-dex}"/>
-      <arg value="--locals=none"/>
-      <arg value="--positions=none"/>
+      <arg value="--locals=${locals}"/>
+      <arg value="--positions=${positions}"/>
       <arg path="${outdir-classes}"/>
     </exec>
   </target>