WTK-home=/usr/local/WTK2.5.2
#WTK-home=C:\\WTK2.5.2
-# Set this to a location where the platform classes included with Java version 1.4 (not later)
-# have been installed. If you installed a full JDK, this is typically at 'jre/lib/rt.jar'
-# under the JDK installation directory. If you just installed a JRE, it is typically at
-# 'lib/rt.jar' under the JRE installation directory.
-#
-# Windows users: typically Java will be installed in a subdirectory of C:\Program Files\Java
-#
-# Linux users: installation directory varies, but is typically under /usr/local or /usr/lib
-#
-# Mac users, the Java 1.4 classes are at:
-# /System/Library/Frameworks/JavaVM.framework/Versions/1.4/Classes/classes.jar
-JDK1.4-classes=/usr/lib/jvm/j2sdk1.4.2_16/jre/lib/rt.jar
-#JDK1.4-classes=C:\\Program Files\\Java\\j2re1.4.2_16\\lib\\rt.jar
-#JDK1.4-classes=/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Classes/classes.jar
-
# 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
# build by obtaining a copy of net_rim_api.jar and rapc.jar from a Windows installation,
# and simply pointing to the directory containing them both here:
-BB-JDK-home=.
\ No newline at end of file
+BB-JDK-home=.
<property file="../build.properties"/>
+ <path id="javame-compile-bootclasspath">
+ <fileset dir="${WTK-home}/lib">
+ <include name="cldcapi11.jar"/>
+ <include name="midpapi20.jar"/>
+ </fileset>
+ </path>
+ <property name="javame-compile-bootclasspath-path" refid="javame-compile-bootclasspath"/>
+
<target name="init">
<tstamp/>
- <fail message="Please set 'JDK1.4-classes' in build.properties">
- <condition>
- <not>
- <available file="${JDK1.4-classes}" type="file"/>
- </not>
- </condition>
- </fail>
</target>
<target name="build" depends="init">
<mkdir dir="build"/>
<javac srcdir="src"
destdir="build"
- source="1.4"
- target="1.4"
- bootclasspath="${JDK1.4-classes}"
+ source="1.2"
+ target="1.2"
+ bootclasspath="${javame-compile-bootclasspath-path}"
optimize="true"
debug="true"
deprecation="true"
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement location="build"/>
- <pathelement location="build-test"/>
+ <pathelement location="build-test"/>
</classpath>
<assertions>
<enable/>
<target name="clean">
<delete dir="build"/>
- <delete dir="build-test"/>
+ <delete dir="build-test"/>
<delete file="core.jar"/>
</target>
</fileset>
<pathelement location="../core/core.jar"/>
</path>
+ <property name="preverify-classpath" refid="wtk-build-path"/>
+
+ <path id="javame-compile-bootclasspath">
+ <fileset dir="${WTK-home}/lib">
+ <include name="cldcapi11.jar"/>
+ <include name="midpapi20.jar"/>
+ </fileset>
+ </path>
+ <property name="javame-compile-bootclasspath-path" refid="javame-compile-bootclasspath"/>
<target name="init">
<tstamp/>
- <fail message="Please set 'JDK1.4-classes' in build.properties">
+ <fail message="Please set 'WTK-home' in build.properties">
<condition>
<not>
- <available file="${JDK1.4-classes}" type="file"/>
+ <available file="${WTK-home}" type="dir"/>
</not>
</condition>
</fail>
- <fail message="Please set 'WTK-home' in build.properties">
+ <fail message="Please put proguard.jar in 'bin' under the WTK install directory">
<condition>
<not>
- <available file="${WTK-home}" type="dir"/>
+ <available file="${WTK-home}/bin/proguard.jar" type="file"/>
</not>
</condition>
</fail>
<mkdir dir="build"/>
<javac srcdir="src"
destdir="build"
- source="1.4"
- target="1.4"
- bootclasspath="${JDK1.4-classes}"
+ source="1.2"
+ target="1.2"
+ bootclasspath="${javame-compile-bootclasspath-path}"
optimize="true"
debug="true"
deprecation="true"
src/com/google/zxing/client/j2me/AdvancedMultimediaManager.java -->
<javac srcdir="src-basic"
destdir="build"
- source="1.4"
- target="1.4"
- bootclasspath="${JDK1.4-classes}"
+ source="1.2"
+ target="1.2"
+ bootclasspath="${javame-compile-bootclasspath-path}"
optimize="true"
debug="true"
deprecation="true"
</javac>
<javac srcdir="src"
destdir="build"
- source="1.4"
- target="1.4"
- bootclasspath="${JDK1.4-classes}"
+ source="1.2"
+ target="1.2"
+ bootclasspath="${javame-compile-bootclasspath-path}"
optimize="true"
debug="true"
deprecation="true"
<unzip src="../core/core.jar" dest="build"/>
<mkdir dir="build-j2me"/>
- <property name="preverify-classpath" refid="wtk-build-path"/>
<exec executable="${WTK-home}/bin/preverify1.1">
<arg line="-classpath ${preverify-classpath} -d build-j2me build"/>
</exec>
<copy file="src/com/google/zxing/client/j2me/MANIFEST.MF.template" tofile="src/com/google/zxing/client/j2me/MANIFEST.MF" overwrite="true">
<filterset>
<filter token="APP_NAME" value="${jar-name}"/>
- <filter token="VERSION" value="${version}"/>
+ <filter token="VERSION" value="${version}"/>
</filterset>
</copy>
<jar jarfile="${jar-name}.jar" basedir="build-j2me" manifest="src/com/google/zxing/client/j2me/MANIFEST.MF" level="9"/>
+ <move file="${jar-name}.jar" tofile="temp.jar"/>
+ <java jar="${WTK-home}/bin/proguard.jar" fork="true">
+ <arg value="-injars temp.jar"/>
+ <arg value="-outjars ${jar-name}.jar"/>
+ <arg value="-libraryjars ${preverify-classpath}"/>
+ <arg value="-microedition"/>
+ <arg value="-keep public class com.google.zxing.client.j2me.ZXingMIDlet"/>
+ <arg value="-keep public class com.google.zxing.qrcode.deteor.DefaultGridSampler"/>
+ <arg value="-keep public class com.google.zxing.qrcode.detector.GridSampler"/>
+ <arg value="-optimizationpasses 5"/>
+ <arg value="-verbose"/>
+ </java>
+ <delete file="temp.jar"/>
+
<!-- get .jar size to include it in the .jad file -->
<length file="${jar-name}.jar" property="jar-size"/>