mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-20 20:19:32 +00:00
ICU-4921 update codemangler tool
X-SVN-Rev: 18898
This commit is contained in:
parent
98070774c9
commit
39a10a9f78
3 changed files with 52 additions and 19 deletions
|
@ -1185,12 +1185,12 @@
|
|||
<zip destfile="${zipTestSrc.file}"
|
||||
compress="true"
|
||||
basedir="${src.dir}"
|
||||
includes="com/ibm/icu/dev/test/**/*"/>
|
||||
includes="com/ibm/icu/dev/test/**/*"
|
||||
excludes="com/ibm/icu/dev/test/cldr/**/*, com/ibm/icu/dev/test/perf/**/*"/>
|
||||
</target>
|
||||
|
||||
<target name="undoEclipseMangle" depends="buildmangle">
|
||||
<target name="undoEclipseMangle" depends="buildmangle" description="preprocess files back to default)">
|
||||
<java classname="com.ibm.icu.dev.tool.docs.CodeMangler" classpath="${build.dir}" logError="true">
|
||||
<arg value="-v"/>
|
||||
<arg value="@eclipseCoreArgs.txt"/>
|
||||
<arg value="@eclipseTestArgs.txt"/>
|
||||
</java>
|
||||
|
@ -1199,6 +1199,7 @@
|
|||
<target name="eclipseCoreMangle" depends="buildmangle">
|
||||
<java classname="com.ibm.icu.dev.tool.docs.CodeMangler" classpath="${build.dir}" logError="true">
|
||||
<arg value="-dFOUNDATION"/>
|
||||
<arg value="-t"/>
|
||||
<arg value="@eclipseCoreArgs.txt"/>
|
||||
</java>
|
||||
</target>
|
||||
|
@ -1206,13 +1207,14 @@
|
|||
<target name="eclipseTestMangle" depends="buildmangle">
|
||||
<java classname="com.ibm.icu.dev.tool.docs.CodeMangler" classpath="${build.dir}" logError="true">
|
||||
<arg value="-dFOUNDATION"/>
|
||||
<arg value="-t"/>
|
||||
<arg value="@eclipseTestArgs.txt"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="eclipseCore" depends="init,coreData,icudata,eclipseCoreMangle">
|
||||
<javac includes="com/ibm/icu/util/**/*.java,com/ibm/icu/text/**/*.java,com/ibm/icu/math/**/*.java,com/ibm/icu/impl/**/*.java,com/ibm/icu/lang/*.java"
|
||||
excludes="**/CVS/**/*"
|
||||
excludes="**/CVS/**/*,**/GlobalizationPreferences*"
|
||||
compiler="javac1.3"
|
||||
srcdir="${src.dir}"
|
||||
destdir="${build.dir}"
|
||||
|
@ -1239,13 +1241,14 @@
|
|||
<move file="${zipCoreSrc.file}" toDir="${eclipse.dir}/com.ibm.icu"/>
|
||||
<zip destfile="eclipseICU4J_core.zip"
|
||||
basedir="${eclipse.dir}"
|
||||
includes="com.ibm.icu,com.ibm.icu/**/*"/>
|
||||
includes="com.ibm.icu,com.ibm.icu/**/*"
|
||||
excludes="com.ibm.icu/CVS/**/*"/>
|
||||
</target>
|
||||
|
||||
<target name="eclipseTestPkg" depends="eclipseCore,eclipseTestMangle" description="build tests trimmed for eclipse API">
|
||||
<antcall target="tests"/>
|
||||
<jar jarfile="${testjar.file}" compress="true" manifest="${icu4j.tests.manifest}">
|
||||
<fileset dir="${build.dir}" includes="com/ibm/icu/dev/test/**/*"/>
|
||||
<fileset dir="${build.dir}" includes="com/ibm/icu/dev/test/**/*" excludes="/com/ibm/icu/dev/test/**/GlobalizationPreferences*"/>
|
||||
<fileset dir="${build.dir}" includes="com/ibm/icu/dev/data/**/*"/>
|
||||
</jar>
|
||||
<copy file="${testjar.file}" toDir="${eclipse.dir}/com.ibm.icu.tests"/>
|
||||
|
@ -1254,5 +1257,21 @@
|
|||
<zip destfile="eclipseICU4J_tests.zip"
|
||||
basedir="${eclipse.dir}"
|
||||
includes="com.ibm.icu.tests,com.ibm.icu.tests/**/*"/>
|
||||
</target>
|
||||
</target>
|
||||
|
||||
<target name="eclipseInterfacePkg" depends="init" description="build eclipse interface package">
|
||||
<zip destfile="eclipseICU4J_intf.zip"
|
||||
basedir="${eclipse.dir}"
|
||||
includes="org.eclipse.icu/**/*"/>
|
||||
</target>
|
||||
|
||||
<target name="eclipseImplementationPkg" depends="init" description="build eclipse implementation package">
|
||||
<zip destfile="eclipseICU4J_impl.zip"
|
||||
basedir="${eclipse.dir}"
|
||||
includes="com.ibm.icu.eclipse/**/*"/>
|
||||
</target>
|
||||
|
||||
<target name="eclipsePkgs"
|
||||
depends="eclipseCorePkg,eclipseTestPkg,eclipseInterfacePkg"
|
||||
description="build all eclipse packages"/>
|
||||
</project>
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
# Copyright (C) 2005, International Business Machines Corporation and
|
||||
# others. All Rights Reserved.
|
||||
src/com/ibm/icu/dev/test/bigdec/DiagBigDecimal.java
|
||||
src/com/ibm/icu/dev/test/format/BigNumberFormatTest.java
|
||||
src/com/ibm/icu/dev/test/format/GlobalizationPreferencesTest.java
|
||||
src/com/ibm/icu/dev/test/format/NumberFormatRegressionTest.java
|
||||
src/com/ibm/icu/dev/test/format/NumberFormatTest.java
|
||||
src/com/ibm/icu/dev/test/format/NumberRegression.java
|
||||
src/com/ibm/icu/dev/test/format/RbnfTest.java
|
||||
src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java
|
||||
src/com/ibm/icu/dev/test/util/UtilityTest.java
|
||||
src/com/ibm/icu/dev/test/TestAll.java
|
||||
|
|
|
@ -32,15 +32,16 @@ import java.util.regex.Pattern;
|
|||
* commenting out lines based on the current flag settings.
|
||||
*/
|
||||
public class CodeMangler {
|
||||
private File indir; // root of input
|
||||
private File outdir; // root of output
|
||||
private String suffix; // suffix to process, default '.jpp'
|
||||
private boolean recurse; // true if recurse on directories
|
||||
private boolean force; // true if force reprocess of files
|
||||
private boolean clean; // true if output is to be cleaned
|
||||
private HashMap map; // defines
|
||||
private ArrayList names; // files/directories to process
|
||||
private String header; // sorted list of defines passed in
|
||||
private File indir; // root of input
|
||||
private File outdir; // root of output
|
||||
private String suffix; // suffix to process, default '.jpp'
|
||||
private boolean recurse; // true if recurse on directories
|
||||
private boolean force; // true if force reprocess of files
|
||||
private boolean clean; // true if output is to be cleaned
|
||||
private boolean timestamp; // true if we read/write timestamp
|
||||
private HashMap map; // defines
|
||||
private ArrayList names; // files/directories to process
|
||||
private String header; // sorted list of defines passed in
|
||||
|
||||
private boolean verbose; // true if we emit debug output
|
||||
|
||||
|
@ -59,6 +60,7 @@ public class CodeMangler {
|
|||
"-c[lean] - remove all control flags from code on output (does not proceed if overwriting)\n" +
|
||||
"-r[ecurse] - if present, recursively process subdirectories\n" +
|
||||
"-f[orce] - force reprocessing of files even if timestamp and headers match\n" +
|
||||
"-t[imestamp] - expect/write timestamp in header\n" +
|
||||
"-dNAME[=VALUE] - define NAME with optional value VALUE\n" +
|
||||
" (or -d NAME[=VALUE])\n" +
|
||||
"-help - print this usage message and exit.\n" +
|
||||
|
@ -81,6 +83,7 @@ public class CodeMangler {
|
|||
names = new ArrayList();
|
||||
suffix = ".java";
|
||||
clean = false;
|
||||
timestamp = false;
|
||||
|
||||
String inname = null;
|
||||
String outname = null;
|
||||
|
@ -351,7 +354,10 @@ public class CodeMangler {
|
|||
boolean hasHeader = line.startsWith(HEADER_PREFIX);
|
||||
if (hasHeader && !force) {
|
||||
long expectLastModified = ((infile.lastModified() + 999)/1000)*1000;
|
||||
String headerline = HEADER_PREFIX + ' ' + String.valueOf(expectLastModified) + ' ' + header;
|
||||
String headerline = HEADER_PREFIX + ' ' +
|
||||
(timestamp ? String.valueOf(expectLastModified) : "")
|
||||
+ ' ' + header;
|
||||
headerline = headerline.trim();
|
||||
if (line.equals(headerline)) {
|
||||
if (verbose) System.out.println("no changes necessary to " + infile.getCanonicalPath());
|
||||
instream.close();
|
||||
|
@ -387,7 +393,10 @@ public class CodeMangler {
|
|||
|
||||
outModTime = ((outfile.lastModified()+999)/1000)*1000; // round up
|
||||
outstream = new PrintStream(new FileOutputStream(outfile));
|
||||
String headerline = HEADER_PREFIX + ' ' + String.valueOf(outModTime) + ' ' + header;
|
||||
String headerline = HEADER_PREFIX + ' ' +
|
||||
(timestamp ? String.valueOf(outModTime) : "")
|
||||
+ ' ' + header;
|
||||
headerline = headerline.trim();
|
||||
outstream.println(headerline);
|
||||
if (verbose) System.out.println("header: " + headerline);
|
||||
|
||||
|
@ -498,7 +507,9 @@ public class CodeMangler {
|
|||
outfile.renameTo(backup);
|
||||
}
|
||||
|
||||
outfile.setLastModified(outModTime); // synch with timestamp
|
||||
if (timestamp) {
|
||||
outfile.setLastModified(outModTime); // synch with timestamp
|
||||
}
|
||||
|
||||
if (oldMap != null) {
|
||||
map = oldMap;
|
||||
|
|
Loading…
Add table
Reference in a new issue