2007-10-23 12:12:27 -07:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2007-11-28 09:19:36 -08:00
|
|
|
|
|
|
|
<!--
|
2008-06-19 13:56:24 -07:00
|
|
|
Copyright 2007 ZXing authors
|
2007-11-28 09:19:36 -08:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
|
2007-10-23 12:12:27 -07:00
|
|
|
<project name="javame" default="build">
|
|
|
|
|
2007-11-14 07:27:06 -08:00
|
|
|
<property file="../build.properties"/>
|
2007-10-23 12:12:27 -07:00
|
|
|
|
2007-11-21 19:52:30 -08:00
|
|
|
<path id="wtk-build-path">
|
|
|
|
<fileset dir="${WTK-home}/lib">
|
|
|
|
<include name="cldcapi11.jar"/>
|
|
|
|
<include name="midpapi20.jar"/>
|
|
|
|
<include name="mmapi.jar"/>
|
|
|
|
<include name="jsr234.jar"/>
|
|
|
|
<include name="satsa-apdu.jar"/>
|
|
|
|
</fileset>
|
|
|
|
<pathelement location="../core/core.jar"/>
|
|
|
|
</path>
|
2007-11-29 11:44:05 -08:00
|
|
|
<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"/>
|
2007-11-21 19:52:30 -08:00
|
|
|
|
2007-10-23 12:12:27 -07:00
|
|
|
<target name="init">
|
|
|
|
<tstamp/>
|
2007-11-29 11:44:05 -08:00
|
|
|
<fail message="Please set 'WTK-home' in build.properties">
|
2007-11-26 08:21:57 -08:00
|
|
|
<condition>
|
|
|
|
<not>
|
2007-11-29 11:44:05 -08:00
|
|
|
<available file="${WTK-home}" type="dir"/>
|
2007-11-26 08:21:57 -08:00
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
2007-11-29 11:44:05 -08:00
|
|
|
<fail message="Please put proguard.jar in 'bin' under the WTK install directory">
|
2007-11-26 08:21:57 -08:00
|
|
|
<condition>
|
|
|
|
<not>
|
2007-11-29 11:44:05 -08:00
|
|
|
<available file="${WTK-home}/bin/proguard.jar" type="file"/>
|
2007-11-26 08:21:57 -08:00
|
|
|
</not>
|
|
|
|
</condition>
|
2008-01-30 08:12:56 -08:00
|
|
|
</fail>
|
2008-02-14 12:25:54 -08:00
|
|
|
<fail message="Please build 'core' first">
|
2008-01-30 08:12:56 -08:00
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<available file="../core/core.jar" type="file"/>
|
|
|
|
</not>
|
|
|
|
</condition>
|
2007-11-26 08:21:57 -08:00
|
|
|
</fail>
|
2007-11-26 12:04:32 -08:00
|
|
|
</target>
|
|
|
|
|
2008-06-26 08:35:39 -07:00
|
|
|
<target name="build" depends="init">
|
2007-11-26 12:04:32 -08:00
|
|
|
<mkdir dir="build"/>
|
|
|
|
<javac srcdir="src"
|
|
|
|
destdir="build"
|
2007-11-29 11:44:05 -08:00
|
|
|
source="1.2"
|
|
|
|
target="1.2"
|
|
|
|
bootclasspath="${javame-compile-bootclasspath-path}"
|
2007-11-26 12:04:32 -08:00
|
|
|
optimize="true"
|
|
|
|
debug="true"
|
|
|
|
deprecation="true"
|
|
|
|
fork="true">
|
|
|
|
<classpath refid="wtk-build-path"/>
|
|
|
|
</javac>
|
2008-06-18 10:40:14 -07:00
|
|
|
<jar jarfile="javame.jar" basedir="build"/>
|
2007-11-26 08:21:57 -08:00
|
|
|
|
2007-11-07 13:56:22 -08:00
|
|
|
<unzip src="../core/core.jar" dest="build"/>
|
|
|
|
|
2009-10-26 13:27:35 -07:00
|
|
|
<!--
|
2007-10-23 12:12:27 -07:00
|
|
|
<mkdir dir="build-j2me"/>
|
2008-02-15 07:15:57 -08:00
|
|
|
<exec executable="${WTK-home}/bin/preverify1.1" failonerror="true">
|
2008-03-06 13:48:34 -08:00
|
|
|
<arg line="-classpath '${preverify-classpath}' -d build-j2me build"/>
|
2007-10-23 12:12:27 -07:00
|
|
|
</exec>
|
2009-10-26 13:27:35 -07:00
|
|
|
-->
|
|
|
|
<copy todir="build-j2me">
|
|
|
|
<fileset dir="build"/>
|
|
|
|
</copy>
|
2007-10-23 12:12:27 -07:00
|
|
|
|
2007-11-07 15:02:50 -08:00
|
|
|
<copy todir="build-j2me">
|
|
|
|
<fileset dir=".">
|
|
|
|
<include name="res/**"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
|
2008-02-14 12:25:54 -08:00
|
|
|
<copy file="src/com/google/zxing/client/j2me/MANIFEST.MF.template"
|
|
|
|
tofile="src/com/google/zxing/client/j2me/MANIFEST.MF" overwrite="true">
|
2007-11-26 12:04:32 -08:00
|
|
|
<filterset>
|
2008-06-26 08:35:39 -07:00
|
|
|
<filter token="APP_NAME" value="BarcodeReader"/>
|
2007-11-29 11:44:05 -08:00
|
|
|
<filter token="VERSION" value="${version}"/>
|
2007-11-26 12:04:32 -08:00
|
|
|
</filterset>
|
|
|
|
</copy>
|
|
|
|
|
2008-06-26 08:35:39 -07:00
|
|
|
<jar jarfile="BarcodeReader.jar" basedir="build-j2me" manifest="src/com/google/zxing/client/j2me/MANIFEST.MF"/>
|
2007-11-07 13:56:22 -08:00
|
|
|
|
2008-06-26 08:35:39 -07:00
|
|
|
<move file="BarcodeReader.jar" tofile="temp.jar"/>
|
2008-02-04 11:16:34 -08:00
|
|
|
<java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
|
2008-03-25 11:23:49 -07:00
|
|
|
<jvmarg value="-Dmaximum.inlined.code.length=32"/>
|
2007-11-29 11:44:05 -08:00
|
|
|
<arg value="-injars temp.jar"/>
|
2008-06-26 08:35:39 -07:00
|
|
|
<arg value="-outjars BarcodeReader.jar"/>
|
2008-02-05 13:13:30 -08:00
|
|
|
<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"/>
|
2007-11-29 11:44:05 -08:00
|
|
|
<arg value="-microedition"/>
|
|
|
|
<arg value="-keep public class com.google.zxing.client.j2me.ZXingMIDlet"/>
|
2008-06-26 08:35:39 -07:00
|
|
|
<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"/>
|
2008-03-21 05:46:00 -07:00
|
|
|
<arg value="-optimizationpasses 7"/>
|
|
|
|
<arg value="-overloadaggressively"/>
|
|
|
|
<arg value="-allowaccessmodification"/>
|
2007-11-29 11:44:05 -08:00
|
|
|
<arg value="-verbose"/>
|
2008-10-29 08:42:22 -07:00
|
|
|
<arg value="-dump proguard-dump.txt"/>
|
2007-11-29 11:44:05 -08:00
|
|
|
</java>
|
|
|
|
<delete file="temp.jar"/>
|
|
|
|
|
2007-11-12 12:22:22 -08:00
|
|
|
<!-- get .jar size to include it in the .jad file -->
|
2008-06-26 08:35:39 -07:00
|
|
|
<length file="BarcodeReader.jar" property="jar-size"/>
|
2007-11-26 12:04:32 -08:00
|
|
|
|
2008-06-26 08:35:39 -07:00
|
|
|
<copy file="BarcodeReader.jad.template" tofile="BarcodeReader.jad" overwrite="true">
|
2007-11-07 13:56:22 -08:00
|
|
|
<filterset>
|
|
|
|
<filter token="JAR_SIZE" value="${jar-size}"/>
|
2008-06-26 08:35:39 -07:00
|
|
|
<filter token="APP_NAME" value="BarcodeReader"/>
|
2007-11-28 09:29:10 -08:00
|
|
|
<filter token="VERSION" value="${version}"/>
|
2007-11-07 13:56:22 -08:00
|
|
|
</filterset>
|
|
|
|
</copy>
|
2007-10-23 12:12:27 -07:00
|
|
|
|
|
|
|
</target>
|
|
|
|
|
2008-06-25 12:40:13 -07:00
|
|
|
<target name="dump">
|
|
|
|
<java jar="${WTK-home}/bin/proguard.jar" fork="true">
|
|
|
|
<arg value="-injars BarcodeReader.jar"/>
|
|
|
|
<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="-dontshrink"/>
|
|
|
|
<arg value="-dontobfuscate"/>
|
|
|
|
<arg value="-dontoptimize"/>
|
|
|
|
<arg value="-dump dump.txt"/>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
2007-10-23 12:12:27 -07:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="build"/>
|
|
|
|
<delete dir="build-j2me"/>
|
2007-11-26 12:04:32 -08:00
|
|
|
<delete dir="." includes="*.jar"/>
|
2007-12-07 14:16:18 -08:00
|
|
|
<delete dir="." includes="*.jad"/>
|
|
|
|
<delete file="src/com/google/zxing/client/j2me/MANIFEST.MF"/>
|
2008-10-29 08:42:22 -07:00
|
|
|
<delete file="proguard-dump.txt"/>
|
2007-10-23 12:12:27 -07:00
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|