diff --git a/bootstrap.bat b/bootstrap.bat index 120c085ff..b239b551f 100755 --- a/bootstrap.bat +++ b/bootstrap.bat @@ -23,7 +23,7 @@ if not "%OS%" == "Windows_NT" if exist bootstrap\nul deltree/y bootstrap if "%OS%" == "Windows_NT" if exist build\classes\nul rmdir/s/q build\classes if not "%OS%" == "Windows_NT" if exist build\classes\nul deltree/y build\classes -SET LOCALCLASSPATH=lib\crimson.jar;lib\jaxp.jar; +SET LOCALCLASSPATH=lib\crimson.jar for %%i in (lib\optional\*.jar) do call src\script\lcp.bat %%i if exist "%JAVA_HOME%\lib\tools.jar" call src\script\lcp.bat %JAVA_HOME%\lib\tools.jar if exist "%JAVA_HOME%\lib\classes.zip" call src\script\lcp.bat %JAVA_HOME%\lib\classes.zip diff --git a/bootstrap.sh b/bootstrap.sh index 81bdc9898..5830a082c 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -68,7 +68,7 @@ if [ -d "build/classes" ] ; then rm -r build/classes fi -CLASSPATH=lib/crimson.jar:lib/jaxp.jar:${CLASSPATH} +CLASSPATH=lib/crimson.jar:${CLASSPATH} DIRLIBS=lib/optional/*.jar for i in ${DIRLIBS} diff --git a/build.bat b/build.bat index cd8d98551..ae9ffc17b 100755 --- a/build.bat +++ b/build.bat @@ -10,7 +10,7 @@ echo Bootstrap FAILED goto cleanup :runAnt -set LOCALCLASSPATH=lib\crimson.jar;lib\jaxp.jar;bootstrap\lib\ant.jar +set LOCALCLASSPATH=lib\crimson.jar;bootstrap\lib\ant.jar for %%i in (lib\optional\*.jar) do call bootstrap\bin\lcp.bat %%i set CLASSPATH=lib\optional\xalanj1compat.jar;%LOCALCLASSPATH%;%CLASSPATH% set LOCALCLASSPATH= diff --git a/build.sh b/build.sh index b62086766..866cd71f5 100755 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ if test ! -f bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/ exit fi -LOCALCLASSPATH=lib/crimson.jar:lib/jaxp.jar +LOCALCLASSPATH=lib/crimson.jar # add in the dependency .jar files DIRLIBS=lib/optional/*.jar for i in ${DIRLIBS} diff --git a/docs/manual/OptionalTasks/replaceregexp.html b/docs/manual/OptionalTasks/replaceregexp.html new file mode 100644 index 000000000..b867e3fa1 --- /dev/null +++ b/docs/manual/OptionalTasks/replaceregexp.html @@ -0,0 +1,116 @@ + + + + +Ant User Manual + + + + +

ReplaceRegExp

+

Description

+

ReplaceRegExp is a directory based task for replacing the +occurrence of a given regular expression with a substitution pattern +in a selected file or set of files.

+ +

Similar to regexp +type mappers this task needs a supporting regular expression +library and an implementation of +org.apache.tools.ant.util.regexp.Regexp. Ant comes with +implementations for +the java.util.regex package of JDK 1.4, +jakarta-regexp +and jakarta-ORO, +but you will still need the library itself.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
filefile for which the regular expression should be replaced.Yes if no nested <fileset> is used
matchThe regular expression pattern to match in the file(s)Yes, if no nested <regularexpression> is used
replaceThe substition pattern to place in the file(s) in place + of the regular expression.Yes, if no nested <substitution> is used
flagsThe flags to use when matching the regular expression. For more + information, consult the Perl5 syntax
+ g --> Global replacement. Replace all occurances found
+ i --> Case Insensitive. Do not consider case in the match
+ m --> Multiline. Treat the string as multiple lines of input, using "^" and "$" as the start or end of any line, respectively, rather than start or end of string.
+ s --> Singleline. Treat the string as a single line of input, using "." to match any character, including a newline, which normally, it would not match.
+
No
bylineProcess the file(s) one line at a time, executing the replacement + on one line at a time (true/false). This is useful if you + want to only replace the first occurance of a regular expression on + each line, which is not easy to do when processing the file as a whole. + Defaults to false.No
+

Examples

+
  <replaceregexp file="${src}/build.properties" 
+                         match="OldProperty=(.*)"
+                         replace="NewProperty=\1"
+                         byline="true" />
+
+

replaces occurrences of the property name "OldProperty" + with "NewProperty" in a properties file, preserving the existing +value, in the file ${src}/build.properties

+

Parameters specified as nested elements

+

This task supports a nested FileSet + element.

+

This task supports a nested RegularExpression element to specify + the regular expression. You can use this element to refer to a previously + defined regular expression datatype instance.

+
+ <regularexpression id="id" pattern="expression" />
+ <regularexpression refid="id" /> +
+

This task supports a nested Substitution element to specify + the substitution pattern. You can use this element to refer to a previously + defined substition pattern datatype instance.

+
+ <substitution id="id" pattern="expression" />
+ <substitution refid="id" /> +
+

Examples

+
+
+<replaceregexp byline="true">
+  <regularexpression expression="OldProperty=(.*)" />
+  <substitution expression="NewProperty=\1" />
+  <fileset dir=".">
+   <includes="*.properties" />
+  </fileset>
+ </replaceregexp>
+
+

replaces occurrences of the property name "OldProperty" + with "NewProperty" in a properties file, preserving the existing +value, in all files ending in .properties in the current directory

+ +
+

Copyright © 2000,2001 Apache Software Foundation. All rights +Reserved.

+ + + + diff --git a/docs/manual/optionaltasklist.html b/docs/manual/optionaltasklist.html index f3e50db99..22f1bb326 100644 --- a/docs/manual/optionaltasklist.html +++ b/docs/manual/optionaltasklist.html @@ -39,6 +39,7 @@ PropertyFile
Pvcs
RenameExtensions
+ReplaceRegExp
Rpm
Script
Sound