org.apache.tools.ant.taskdefs
Class ExecuteOn
java.lang.Object
|
+--org.apache.tools.ant.Task
|
+--org.apache.tools.ant.taskdefs.ExecTask
|
+--org.apache.tools.ant.taskdefs.ExecuteOn
- Direct Known Subclasses:
- Chmod, Transform
- public class ExecuteOn
- extends ExecTask
Executes a given command, supplying a set of files as arguments.
- Author:
- Stefan Bodewig, Mariusz Nowostawski
Inner Class Summary |
static class |
ExecuteOn.FileDirBoth
Enumerated attribute with the values "file", "dir" and "both"
for the type attribute. |
Method Summary |
void |
addFileset(FileSet set)
Adds a set of files (nested fileset attribute). |
protected void |
checkConfiguration()
Has the user set all necessary attributes? |
Commandline.Marker |
createSrcfile()
Marker that indicates where the name of the source file should
be put on the command line. |
protected java.lang.String[] |
getCommandline(java.lang.String[] srcFiles,
java.io.File baseDir)
Construct the command line for parallel execution. |
protected java.lang.String[] |
getCommandline(java.lang.String srcFile,
java.io.File baseDir)
Construct the command line for serial execution. |
protected java.lang.String[] |
getDirs(java.io.File basedir,
DirectoryScanner ds)
Return the list of Directories from this DirectoryScanner that
should be included on the command line. |
protected java.lang.String[] |
getFiles(java.io.File basedir,
DirectoryScanner ds)
Return the list of files from this DirectoryScanner that should
be included on the command line. |
protected void |
runExec(Execute exe)
Run the command using the given Execute instance. |
void |
setParallel(boolean parallel)
Shall the command work on all specified files in parallel? |
void |
setType(ExecuteOn.FileDirBoth type)
Shall the command work only on files, directories or both? |
Methods inherited from class org.apache.tools.ant.taskdefs.ExecTask |
addEnv, createArg, createHandler, createWatchdog, execute, isValidOs, logFlush, prepareExec, setCommand, setDir, setExecutable, setFailonerror, setNewenvironment, setOs, setOutput, setTimeout |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getProject, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
filesets
protected java.util.Vector filesets
type
protected java.lang.String type
srcFilePos
protected Commandline.Marker srcFilePos
ExecuteOn
public ExecuteOn()
addFileset
public void addFileset(FileSet set)
- Adds a set of files (nested fileset attribute).
setParallel
public void setParallel(boolean parallel)
- Shall the command work on all specified files in parallel?
setType
public void setType(ExecuteOn.FileDirBoth type)
- Shall the command work only on files, directories or both?
createSrcfile
public Commandline.Marker createSrcfile()
- Marker that indicates where the name of the source file should
be put on the command line.
checkConfiguration
protected void checkConfiguration()
- Description copied from class:
ExecTask
- Has the user set all necessary attributes?
- Overrides:
checkConfiguration
in class ExecTask
runExec
protected void runExec(Execute exe)
throws BuildException
- Description copied from class:
ExecTask
- Run the command using the given Execute instance.
- Overrides:
runExec
in class ExecTask
getCommandline
protected java.lang.String[] getCommandline(java.lang.String[] srcFiles,
java.io.File baseDir)
- Construct the command line for parallel execution.
- Parameters:
srcFiles
- The filenames to add to the commandlinebaseDir
- filenames are relative to this dir
getCommandline
protected java.lang.String[] getCommandline(java.lang.String srcFile,
java.io.File baseDir)
- Construct the command line for serial execution.
- Parameters:
srcFile
- The filename to add to the commandlinebaseDir
- filename is relative to this dir
getFiles
protected java.lang.String[] getFiles(java.io.File basedir,
DirectoryScanner ds)
- Return the list of files from this DirectoryScanner that should
be included on the command line.
getDirs
protected java.lang.String[] getDirs(java.io.File basedir,
DirectoryScanner ds)
- Return the list of Directories from this DirectoryScanner that
should be included on the command line.
Copyright ? 2000 Apache Software Foundation. All Rights Reserved.