mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Add proguard optimizer support. Switch to compile against WTK class files and target version 1.2 class file output, to possibly fix compatibility issues.
git-svn-id: https://zxing.googlecode.com/svn/trunk@84 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
958edca745
commit
5ee60cd4e2
|
@ -8,23 +8,8 @@ version=0.1.2
|
||||||
WTK-home=/usr/local/WTK2.5.2
|
WTK-home=/usr/local/WTK2.5.2
|
||||||
#WTK-home=C:\\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
|
# 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
|
# 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,
|
# 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:
|
# and simply pointing to the directory containing them both here:
|
||||||
BB-JDK-home=.
|
BB-JDK-home=.
|
||||||
|
|
|
@ -20,24 +20,25 @@
|
||||||
|
|
||||||
<property file="../build.properties"/>
|
<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">
|
<target name="init">
|
||||||
<tstamp/>
|
<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>
|
||||||
|
|
||||||
<target name="build" depends="init">
|
<target name="build" depends="init">
|
||||||
<mkdir dir="build"/>
|
<mkdir dir="build"/>
|
||||||
<javac srcdir="src"
|
<javac srcdir="src"
|
||||||
destdir="build"
|
destdir="build"
|
||||||
source="1.4"
|
source="1.2"
|
||||||
target="1.4"
|
target="1.2"
|
||||||
bootclasspath="${JDK1.4-classes}"
|
bootclasspath="${javame-compile-bootclasspath-path}"
|
||||||
optimize="true"
|
optimize="true"
|
||||||
debug="true"
|
debug="true"
|
||||||
deprecation="true"
|
deprecation="true"
|
||||||
|
@ -59,7 +60,7 @@
|
||||||
<formatter type="plain" usefile="false"/>
|
<formatter type="plain" usefile="false"/>
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="build"/>
|
<pathelement location="build"/>
|
||||||
<pathelement location="build-test"/>
|
<pathelement location="build-test"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
<assertions>
|
<assertions>
|
||||||
<enable/>
|
<enable/>
|
||||||
|
@ -74,7 +75,7 @@
|
||||||
|
|
||||||
<target name="clean">
|
<target name="clean">
|
||||||
<delete dir="build"/>
|
<delete dir="build"/>
|
||||||
<delete dir="build-test"/>
|
<delete dir="build-test"/>
|
||||||
<delete file="core.jar"/>
|
<delete file="core.jar"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
|
@ -30,16 +30,18 @@
|
||||||
</fileset>
|
</fileset>
|
||||||
<pathelement location="../core/core.jar"/>
|
<pathelement location="../core/core.jar"/>
|
||||||
</path>
|
</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">
|
<target name="init">
|
||||||
<tstamp/>
|
<tstamp/>
|
||||||
<fail message="Please set 'JDK1.4-classes' in build.properties">
|
|
||||||
<condition>
|
|
||||||
<not>
|
|
||||||
<available file="${JDK1.4-classes}" type="file"/>
|
|
||||||
</not>
|
|
||||||
</condition>
|
|
||||||
</fail>
|
|
||||||
<fail message="Please set 'WTK-home' in build.properties">
|
<fail message="Please set 'WTK-home' in build.properties">
|
||||||
<condition>
|
<condition>
|
||||||
<not>
|
<not>
|
||||||
|
@ -47,15 +49,22 @@
|
||||||
</not>
|
</not>
|
||||||
</condition>
|
</condition>
|
||||||
</fail>
|
</fail>
|
||||||
|
<fail message="Please put proguard.jar in 'bin' under the WTK install directory">
|
||||||
|
<condition>
|
||||||
|
<not>
|
||||||
|
<available file="${WTK-home}/bin/proguard.jar" type="file"/>
|
||||||
|
</not>
|
||||||
|
</condition>
|
||||||
|
</fail>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile" depends="init">
|
<target name="compile" depends="init">
|
||||||
<mkdir dir="build"/>
|
<mkdir dir="build"/>
|
||||||
<javac srcdir="src"
|
<javac srcdir="src"
|
||||||
destdir="build"
|
destdir="build"
|
||||||
source="1.4"
|
source="1.2"
|
||||||
target="1.4"
|
target="1.2"
|
||||||
bootclasspath="${JDK1.4-classes}"
|
bootclasspath="${javame-compile-bootclasspath-path}"
|
||||||
optimize="true"
|
optimize="true"
|
||||||
debug="true"
|
debug="true"
|
||||||
deprecation="true"
|
deprecation="true"
|
||||||
|
@ -70,9 +79,9 @@
|
||||||
src/com/google/zxing/client/j2me/AdvancedMultimediaManager.java -->
|
src/com/google/zxing/client/j2me/AdvancedMultimediaManager.java -->
|
||||||
<javac srcdir="src-basic"
|
<javac srcdir="src-basic"
|
||||||
destdir="build"
|
destdir="build"
|
||||||
source="1.4"
|
source="1.2"
|
||||||
target="1.4"
|
target="1.2"
|
||||||
bootclasspath="${JDK1.4-classes}"
|
bootclasspath="${javame-compile-bootclasspath-path}"
|
||||||
optimize="true"
|
optimize="true"
|
||||||
debug="true"
|
debug="true"
|
||||||
deprecation="true"
|
deprecation="true"
|
||||||
|
@ -81,9 +90,9 @@
|
||||||
</javac>
|
</javac>
|
||||||
<javac srcdir="src"
|
<javac srcdir="src"
|
||||||
destdir="build"
|
destdir="build"
|
||||||
source="1.4"
|
source="1.2"
|
||||||
target="1.4"
|
target="1.2"
|
||||||
bootclasspath="${JDK1.4-classes}"
|
bootclasspath="${javame-compile-bootclasspath-path}"
|
||||||
optimize="true"
|
optimize="true"
|
||||||
debug="true"
|
debug="true"
|
||||||
deprecation="true"
|
deprecation="true"
|
||||||
|
@ -97,7 +106,6 @@
|
||||||
<unzip src="../core/core.jar" dest="build"/>
|
<unzip src="../core/core.jar" dest="build"/>
|
||||||
|
|
||||||
<mkdir dir="build-j2me"/>
|
<mkdir dir="build-j2me"/>
|
||||||
<property name="preverify-classpath" refid="wtk-build-path"/>
|
|
||||||
<exec executable="${WTK-home}/bin/preverify1.1">
|
<exec executable="${WTK-home}/bin/preverify1.1">
|
||||||
<arg line="-classpath ${preverify-classpath} -d build-j2me build"/>
|
<arg line="-classpath ${preverify-classpath} -d build-j2me build"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
@ -111,12 +119,26 @@
|
||||||
<copy file="src/com/google/zxing/client/j2me/MANIFEST.MF.template" tofile="src/com/google/zxing/client/j2me/MANIFEST.MF" overwrite="true">
|
<copy file="src/com/google/zxing/client/j2me/MANIFEST.MF.template" tofile="src/com/google/zxing/client/j2me/MANIFEST.MF" overwrite="true">
|
||||||
<filterset>
|
<filterset>
|
||||||
<filter token="APP_NAME" value="${jar-name}"/>
|
<filter token="APP_NAME" value="${jar-name}"/>
|
||||||
<filter token="VERSION" value="${version}"/>
|
<filter token="VERSION" value="${version}"/>
|
||||||
</filterset>
|
</filterset>
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
<jar jarfile="${jar-name}.jar" basedir="build-j2me" manifest="src/com/google/zxing/client/j2me/MANIFEST.MF" level="9"/>
|
<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 -->
|
<!-- get .jar size to include it in the .jad file -->
|
||||||
<length file="${jar-name}.jar" property="jar-size"/>
|
<length file="${jar-name}.jar" property="jar-size"/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue