Added build-optimized target to produce optimized core.jar; tests now test optimized version; also removed the dependency from core to MIDP 2.0 as it was just depending on silly IllegalStateException

git-svn-id: https://zxing.googlecode.com/svn/trunk@423 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-06-12 15:55:42 +00:00
parent 14895cf9b3
commit 56c4b6a94d
5 changed files with 27 additions and 10 deletions

View file

@ -23,7 +23,6 @@
<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"/>
@ -46,7 +45,25 @@
<jar jarfile="core.jar" basedir="build" level="9"/>
</target>
<target name="build-test" depends="init,build">
<target name="build-optimized" depends="build">
<move file="core.jar" tofile="temp.jar"/>
<java jar="${WTK-home}/bin/proguard.jar" fork="true" failonerror="true">
<jvmarg value="-Dmaximum.inlined.code.length=32"/>
<arg value="-injars temp.jar"/>
<arg value="-outjars core.jar"/>
<arg value="-libraryjars ${WTK-home}/lib/cldcapi11.jar"/>
<arg value="-renamesourcefileattribute SourceFile"/>
<arg value="-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod"/>
<arg value="-keep class * { !private *; }"/>
<arg value="-optimizationpasses 7"/>
<arg value="-overloadaggressively"/>
<arg value="-allowaccessmodification"/>
<arg value="-verbose"/>
</java>
<delete file="temp.jar"/>
</target>
<target name="build-test" depends="init,build-optimized">
<fail message="Please build 'javase' first">
<condition>
<not>
@ -60,7 +77,7 @@
debug="true"
deprecation="true">
<classpath>
<pathelement location="build"/>
<pathelement location="core.jar"/>
<pathelement location="../javase/javase.jar"/>
<pathelement location="lib/junit.jar"/>
</classpath>
@ -71,7 +88,7 @@
<junit printsummary="on" haltonfailure="on" haltonerror="on" fork="true" dir=".">
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement location="build"/>
<pathelement location="core.jar"/>
<pathelement location="build-test"/>
<pathelement location="../javase/javase.jar"/>
<pathelement location="lib/junit.jar"/>
@ -92,7 +109,7 @@
<junit printsummary="on" haltonfailure="on" haltonerror="on" fork="true" dir=".">
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement location="build"/>
<pathelement location="core.jar"/>
<pathelement location="build-test"/>
<pathelement location="../javase/javase.jar"/>
<pathelement location="lib/junit.jar"/>

View file

@ -103,7 +103,7 @@ public interface MonochromeBitmapSource {
* of this class which are only used in resource-constrained mobile environments
* don't have a need to implement this.</p>
*
* @throws IllegalStateException if not supported
* @throws IllegalArgumentException if not supported
*/
MonochromeBitmapSource rotateCounterClockwise();

View file

@ -112,7 +112,7 @@ public abstract class BaseMonochromeBitmapSource implements MonochromeBitmapSour
}
public MonochromeBitmapSource rotateCounterClockwise() {
throw new IllegalStateException("Rotate not supported");
throw new IllegalArgumentException("Rotate not supported");
}
public boolean isRotateSupported() {

View file

@ -101,7 +101,7 @@ final class DataBlock {
}
if (rawCodewordsOffset != rawCodewords.length) {
throw new IllegalStateException();
throw new IllegalArgumentException();
}
return result;

View file

@ -80,7 +80,7 @@ final class DataBlock {
break;
}
if (numCodewords != shorterBlocksTotalCodewords + 1) {
throw new IllegalStateException("Data block sizes differ by more than 1");
throw new IllegalArgumentException("Data block sizes differ by more than 1");
}
longerBlocksStartAt--;
}
@ -109,7 +109,7 @@ final class DataBlock {
}
if (rawCodewordsOffset != rawCodewords.length) {
throw new IllegalStateException();
throw new IllegalArgumentException();
}
return result;