Class AntRunner
MatchingTask, an array of
FileSet can be given.
please have a look at the setter methods of the task to evaluate the properties to set. the properties are case
sensitive.
if use the task 'Expand', the class org.apache.tools.ant.taskdefs.Expand will be loaded and
instantiated. you must set the property 'destFile' with java.io.File. the AntRunner will call
Expand.setDestFile(File).
see @link{http://ant.apache.org/manual} for a list of standard ant tasks.
short list of tasks:
Ant AntCall ANTLR AntStructure AntVersion Apply/ExecOn Apt Attrib Augment Available Basename Bindtargets BuildNumber
BUnzip2 BZip2 Cab Continuus/Synergy Tasks CvsChangeLog Checksum Chgrp Chmod Chown Clearcase Tasks Componentdef Concat
Condition Supported conditions Copy Copydir Copyfile Cvs CVSPass CvsTagDiff CvsVersion Defaultexcludes Delete Deltree
Depend Dependset Diagnostics Dirname Ear Echo Echoproperties EchoXML EJB Tasks Exec Fail Filter FixCRLF FTP GenKey
Get GUnzip GZip Hostinfo Image Import Include Input Jar Jarlib-available Jarlib-display Jarlib-manifest
Jarlib-resolve Java Javac JavaCC Javadoc/Javadoc2 Javah JDepend JJDoc JJTree Jlink JspC JUnit JUnitReport Length
LoadFile LoadProperties LoadResource Local MacroDef Mail MakeURL Manifest ManifestClassPath MimeMail Mkdir Move
Native2Ascii NetRexxC Nice Parallel Patch PathConvert Perforce Tasks PreSetDef ProjectHelper Property PropertyFile
PropertyHelper Pvcs Record Rename RenameExtensions Replace ReplaceRegExp ResourceCount Retry RExec Rmic Rpm
SchemaValidate Scp Script Scriptdef Sequential ServerDeploy Setproxy SignJar Sleep SourceOffSite Sound Splash Sql
Sshexec Sshsession Subant Symlink Sync Tar Taskdef Telnet Tempfile Touch Translate Truncate TStamp Typedef Unjar
Untar Unwar Unzip Uptodate Microsoft Visual SourceSafe Tasks Waitfor War WhichResource Weblogic JSP Compiler
XmlProperty XmlValidate XSLT/Style Zip
- Version:
- $Revision$
- Author:
- Thomas Schneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringuseful to list and search files. seeFilesstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringusefull to unzip files. seeExpandstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.tools.ant.BuildListenercreateBuildListener(PrintStream out, PrintStream err) static org.apache.tools.ant.types.FileSet[]createFileSets(String expression) <directory-name>[:{[include][,...]]} static org.apache.tools.ant.BuildListenercreate System.out build listenerstatic org.apache.tools.ant.BuildListenerstatic org.apache.tools.ant.BuildListenercreatePipedAntBuildListener(PipedOutputStream pipedOutputStream) createPipedBuildListenerstatic voidrunRegexReplace(String match, String replace, String dir, String includes) convenience to run taskTASK_REPLACE_REGEXPstatic voidstarts the task by name using its properties and perhaps some filesets.static voidrunTask(String name, Properties taskProperties, String fileSetExpression)
-
Field Details
-
TASK_PATH
-
TASK_JAR
- See Also:
-
TASK_ZIP
- See Also:
-
TASK_UNJAR
usefull to unzip files. seeExpand- See Also:
-
TASK_COPY
- See Also:
-
TASK_MOVE
- See Also:
-
TASK_DELETE
- See Also:
-
TASK_FILES
useful to list and search files. seeFiles- See Also:
-
TASK_REPLACE_REGEXP
- See Also:
-
TASK_XSLT
- See Also:
-
TASK_SQL
- See Also:
-
-
Constructor Details
-
AntRunner
public AntRunner()
-
-
Method Details
-
runTask
-
runTask
public static void runTask(String name, Map taskProperties, org.apache.tools.ant.types.FileSet... fileSets) starts the task by name using its properties and perhaps some filesets. See here for an overview of ants standard tasks.Example: FileSet[] fileSets = AntRunner.createFileSets("./:{**\*.*ml}**\*.xml;" + basedir.getPath() + ":{*.txt}"); Properties props = new Properties(); props.put("destFile", new File(destFile)); AntRunner.runTask("Jar", props, fileSets);- Parameters:
name- task nametaskProperties- task propertiesfileSets- optional filesets (depends on the task!)
-
createLogfileBuildListener
public static org.apache.tools.ant.BuildListener createLogfileBuildListener()create System.out build listener- Returns:
- ant build listener
-
createPipedAntBuildListener
public static org.apache.tools.ant.BuildListener createPipedAntBuildListener(PipedOutputStream pipedOutputStream) createPipedBuildListener- Parameters:
pipedOutputStream- stream to be connected to aPipedInputStream.- Returns:
- ant build listener
-
createBuildListener
public static org.apache.tools.ant.BuildListener createBuildListener(PrintStream out, PrintStream err) -
createMessageListener
public static org.apache.tools.ant.BuildListener createMessageListener() -
createFileSets
<directory-name>[:{[include][,...]]}[[exclude][, ...]];... - Parameters:
expression-- Returns:
-
runRegexReplace
convenience to run taskTASK_REPLACE_REGEXP- Parameters:
match-replace-dir-includes-
-