Fix small compile error in javame/, update for Java ME SDK 3.x layout, finally disent...
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 12 Apr 2010 08:59:41 +0000 (08:59 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 12 Apr 2010 08:59:41 +0000 (08:59 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@1302 59b500cc-1b3d-0410-9834-0bbf25fbcc57

android/build.xml
androidtest/build.xml
build.properties
build.xml
core/build.xml
javame/build.xml
javame/src/com/google/zxing/client/j2me/Menu.java
javame/src/com/google/zxing/client/j2me/ZXingMIDlet.java

index 1ee9a12..d2f7b74 100644 (file)
@@ -194,7 +194,7 @@ limitations under the License.
   <target name="optimize" unless="no-optimize">
     <mkdir dir="optimized"/>
     <property name="libraryjars.path" refid="android.target.classpath"/>
-    <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
+    <java jar="${proguard-jar}" fork="true" failonerror="true">
       <jvmarg value="-Dmaximum.inlined.code.length=48"/>
       <arg value="-injars ${out-classes}"/>
       <arg value="-outjars optimized"/>
index 82c1a68..e165ff6 100644 (file)
@@ -192,7 +192,7 @@ limitations under the License.
   <target name="optimize" unless="no-optimize">
     <mkdir dir="optimized"/>
     <property name="libraryjars.path" refid="android.target.classpath"/>
-    <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
+    <java jar="${proguard-jar}" fork="true" failonerror="true">
       <jvmarg value="-Dmaximum.inlined.code.length=48"/>
       <arg value="-injars ${out-classes}"/>
       <arg value="-outjars optimized"/>
index c159d50..130cabb 100644 (file)
@@ -1,20 +1,16 @@
-version=1.5
+version=1.6
+
+# Set to the location where ProGuard's proguard.jar file can be found
+#proguard-jar=
 
 # If you are building the J2ME client:
 #
-# Set this to a location where Sun's Wireless Toolkit, version 2.5.2 or later, has been installed
-# Location on Linux varies but is typically under /usr/local or /usr/lib
-# On Windows the default install directory is C:\WTK2.5.2
-# Mac users: there is no WTK for Mac at the moment. The installer for Linux may work on Intel-based
-# Macs (haven't tried it) but I believe the preverify binary will not run.
-#
-# If you are buildling the Android client or optimized Java client:
-# Just create a 'WTK' directory wherever you like and add its location here. Proguard's
-# proguard.jar will still be expected at this location as bin/proguard.jar for historical reasons.
+# Set this to a location where Sun's Java ME SDK, version 3.0 or later, has been installed.
+# You can use version 2.5.2 or perhaps earlier, but will need to modify javame/build.xml to
+# use different .jar paths.
 
 # Uncomment or set appropriately:
-#WTK-home=C:\\WTK2.5.2
-WTK-home=/usr/local/WTK2.5.2
+#WTK-home=/Applications/Java_ME_SDK_3.0.app/Contents/Resources
 
 # Set this to the location where you have installed RIM's BlackBerry JDE in order to
 # create the 'rim' client. There is no Mac or Linux version, but, these platforms can still
@@ -28,16 +24,16 @@ WTK-home=/usr/local/WTK2.5.2
 
 # Uncomment and set appropriately
 #BB-JDK-home=C:\\Program Files\\Research In Motion\\Blackberry JDE 4.3.0
-BB-JDK-home=/usr/local/bb-home
+#BB-JDK-home=/usr/local/bb-home
 
 # Set this to the location where you installed the Android SDK.
 #android-home=C:\\Program Files\\android-sdk-windows
-android-home=/usr/local/android
+#android-home=/usr/local/android
 
 # Set this to the location of a Tomcat installation if you want to compile and run the zxing.org
 # web site and web application
 #tomcat-home=C:\\tomcat
-tomcat-home=/usr/local/tomcat
+#tomcat-home=/usr/local/tomcat
 
 # Uncomment and set this variable if building the zxing.appspot.com subdirectory. It points to the
 # location of the Google Web Toolkit (GWT) which can be downloaded here:
index e8bff87..a5dc6ce 100644 (file)
--- a/build.xml
+++ b/build.xml
         <pathelement location="zxingorg/src"/>
       </sourcepath>
       <classpath>
+        <!-- These are used with WTK 2.5.x -->
+        <!--
         <pathelement location="${WTK-home}/lib/cldcapi11.jar"/>
         <pathelement location="${WTK-home}/lib/midpapi20.jar"/>
         <pathelement location="${WTK-home}/lib/mmapi.jar"/>
         <pathelement location="${WTK-home}/lib/jsr234.jar"/>
+        -->
+        <pathelement location="${WTK-home}/lib/cldc_1.1.jar"/>
+        <pathelement location="${WTK-home}/lib/midp_2.0.jar"/>
+        <pathelement location="${WTK-home}/lib/jsr135_1.2.jar"/>
+        <pathelement location="${WTK-home}/lib/jsr234_1.0.jar"/>
         <pathelement location="${android-home}/platforms/android-1.5/android.jar"/>
         <pathelement location="${tomcat-home}/lib/servlet-api.jar"/>
         <fileset dir="zxingorg/web/WEB-INF/lib">
index f02fcb6..05e43d7 100644 (file)
@@ -72,7 +72,7 @@
 
     <delete file="core.jar"/>
     <mkdir dir="optimized"/>
-    <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
+    <java jar="${proguard-jar}" fork="true" failonerror="true">
       <jvmarg value="-Dmaximum.inlined.code.length=48"/>
       <arg value="-injars build"/>
       <arg value="-outjars optimized"/>
index 8ec9f24..aefb989 100644 (file)
 
   <path id="wtk-build-path">
     <fileset dir="${WTK-home}/lib">
+      <!-- These are used with WTK 2.5.x -->
+      <!--
       <include name="cldcapi11.jar"/>
       <include name="midpapi20.jar"/>
       <include name="mmapi.jar"/>
       <include name="jsr234.jar"/>
       <include name="satsa-apdu.jar"/>
+      -->
+      <include name="cldc_1.1.jar"/>
+      <include name="midp_2.0.jar"/>
+      <include name="jsr135_1.2.jar"/>
+      <include name="jsr234_1.0.jar"/>
     </fileset>
     <pathelement location="../core/core.jar"/>
   </path>
 
   <path id="javame-compile-bootclasspath">
     <fileset dir="${WTK-home}/lib">
+      <!-- These are used with WTK 2.5.x -->
+      <!--
       <include name="cldcapi11.jar"/>
       <include name="midpapi20.jar"/>
+      -->
+      <include name="cldc_1.1.jar"/>
+      <include name="midp_2.0.jar"/>
     </fileset>
   </path>
   <property name="javame-compile-bootclasspath-path" refid="javame-compile-bootclasspath"/>
         </not>
       </condition>
     </fail>
-    <fail message="Please put proguard.jar in 'bin' under the WTK install directory">
+    <fail message="Please set 'proguard.jar' in build.properties">
       <condition>
         <not>
-          <available file="${WTK-home}/bin/proguard.jar" type="file"/>
+          <available file="${proguard-jar}" type="file"/>
         </not>
       </condition>
     </fail>
     <jar jarfile="BarcodeReader.jar" basedir="build-j2me" manifest="src/com/google/zxing/client/j2me/MANIFEST.MF"/>
 
     <move file="BarcodeReader.jar" tofile="temp.jar"/>
-    <java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
+    <java jar="${proguard-jar}" fork="true" failonerror="true">
       <jvmarg value="-Dmaximum.inlined.code.length=32"/>
       <arg value="-injars temp.jar"/>
       <arg value="-outjars BarcodeReader.jar"/>
+      <!-- These are used with WTK 2.5.x -->
+      <!--
       <arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/>
       <arg value="-libraryjars ${WTK-home}/lib/midpapi20.jar"/>
       <arg value="-libraryjars ${WTK-home}/lib/mmapi.jar"/>
       <arg value="-libraryjars ${WTK-home}/lib/jsr234.jar"/>
+      -->
+      <arg value="-libraryjars ${WTK-home}/lib/cldc_1.1.jar"/>
+      <arg value="-libraryjars ${WTK-home}/lib/midp_2.0.jar"/>
+      <arg value="-libraryjars ${WTK-home}/lib/jsr135_1.2.jar"/>
+      <arg value="-libraryjars ${WTK-home}/lib/jsr234_1.0.jar"/>
       <arg value="-microedition"/>
       <arg value="-keep public class com.google.zxing.client.j2me.ZXingMIDlet"/>
       <arg value="-keep class com.google.zxing.client.j2me.AdvancedMultimediaManager"/>
       <arg value="-keep class com.google.zxing.client.j2me.DefaultMultimediaManager"/>
       <arg value="-keep class com.google.zxing.client.j2me.MultimediaManager"/>      
-      <arg value="-optimizationpasses 7"/>
+      <arg value="-optimizationpasses 5"/>
       <arg value="-overloadaggressively"/>
       <arg value="-allowaccessmodification"/>
       <arg value="-verbose"/>
   </target>
 
   <target name="dump">
-    <java jar="${WTK-home}/bin/proguard.jar" fork="true">
+    <java jar="${proguard-jar}" fork="true">
       <arg value="-injars BarcodeReader.jar"/>
+      <!-- These are used with WTK 2.5.x -->
+      <!--
       <arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/>
       <arg value="-libraryjars ${WTK-home}/lib/midpapi20.jar"/>
       <arg value="-libraryjars ${WTK-home}/lib/mmapi.jar"/>
       <arg value="-libraryjars ${WTK-home}/lib/jsr234.jar"/>
+      -->
+      <arg value="-libraryjars ${WTK-home}/lib/cldc_1.1.jar"/>
+      <arg value="-libraryjars ${WTK-home}/lib/midp_2.0.jar"/>
+      <arg value="-libraryjars ${WTK-home}/lib/jsr135_1.2.jar"/>
+      <arg value="-libraryjars ${WTK-home}/lib/jsr234_1.0.jar"/>
       <arg value="-dontshrink"/>
       <arg value="-dontobfuscate"/>
       <arg value="-dontoptimize"/>
index 544ee2f..dda4711 100644 (file)
@@ -31,8 +31,8 @@ import javax.microedition.lcdui.List;
 final class Menu extends List implements CommandListener {\r
 \r
   private final ZXingMIDlet zXingMIDlet;\r
-  private Command cancelCommand;\r
-  private Command barcodeCommand;\r
+  private final Command cancelCommand;\r
+  private final Command barcodeCommand;\r
 \r
   /**\r
    * Creates a new Search List and initialises all components.\r
index f1bb635..382200f 100644 (file)
@@ -254,7 +254,7 @@ public final class ZXingMIDlet extends MIDlet {
       showOpenURL("Compose E-mail?", emailResult.getEmailAddress(), emailResult.getMailtoURI());\r
     } else if (type.equals(ParsedResultType.SMS)) {\r
       SMSParsedResult smsResult = (SMSParsedResult) result;\r
-      showOpenURL("Compose SMS?", smsResult.getNumber(), smsResult.getSMSURI());\r
+      showOpenURL("Compose SMS?", smsResult.getNumbers()[0], smsResult.getSMSURI());\r
     } else if (type.equals(ParsedResultType.PRODUCT)) {\r
       ProductParsedResult productResult = (ProductParsedResult) result;\r
       String uri = "http://www.upcdatabase.com/item.asp?upc=" + productResult.getNormalizedProductID();\r