mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
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:
parent
14895cf9b3
commit
56c4b6a94d
|
@ -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"/>
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -101,7 +101,7 @@ final class DataBlock {
|
|||
}
|
||||
|
||||
if (rawCodewordsOffset != rawCodewords.length) {
|
||||
throw new IllegalStateException();
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue