Modifier and Type | Class and Description |
---|---|
static class |
ExecuteOn.FileDirBoth
Enumerated attribute with the values "file", "dir" and "both"
for the type attribute.
|
Modifier and Type | Field and Description |
---|---|
protected File |
destDir |
protected Vector<AbstractFileSet> |
filesets |
protected FileNameMapper |
mapper |
protected Mapper |
mapperElement |
protected Commandline.Marker |
srcFilePos |
protected boolean |
srcIsFirst
Has <srcfile> been specified before <targetfile>
|
protected Commandline.Marker |
targetFilePos |
protected String |
type |
cmdl, failOnError, newEnvironment, redirector, redirectorElement
Constructor and Description |
---|
ExecuteOn() |
Modifier and Type | Method and Description |
---|---|
void |
add(FileNameMapper fileNameMapper)
Add a nested FileNameMapper.
|
void |
add(ResourceCollection rc)
Add a collection of resources upon which to operate.
|
void |
addDirset(DirSet set)
Add a set of directories upon which to operate.
|
void |
addFilelist(FileList list)
Add a list of source files upon which to operate.
|
void |
addFileset(FileSet set)
Add a set of files upon which to operate.
|
protected void |
checkConfiguration()
Check the configuration of this ExecuteOn instance.
|
protected ExecuteStreamHandler |
createHandler()
Create the ExecuteStreamHandler instance that will be used
during execution.
|
Mapper |
createMapper()
Create a nested Mapper element to use for mapping
source files to target files.
|
Commandline.Marker |
createSrcfile()
Create a placeholder indicating where on the command line
the name of the source file should be inserted.
|
Commandline.Marker |
createTargetfile()
Create a placeholder indicating where on the command line
the name of the target file should be inserted.
|
protected String[] |
getCommandline(String[] srcFiles,
File[] baseDirs)
Construct the command line for parallel execution.
|
protected String[] |
getCommandline(String srcFile,
File baseDir)
Construct the command line for serial execution.
|
protected String[] |
getDirs(File baseDir,
DirectoryScanner ds)
Return the list of Directories from this DirectoryScanner that
should be included on the command line.
|
protected String[] |
getFiles(File baseDir,
DirectoryScanner ds)
Return the list of files from this DirectoryScanner that should
be included on the command line.
|
protected String[] |
getFilesAndDirs(FileList list)
Return the list of files or directories from this FileList that
should be included on the command line.
|
protected void |
runExec(Execute exe)
Run the specified Execute object.
|
protected void |
runParallel(Execute exe,
Vector<String> fileNames,
Vector<File> baseDirs)
Run the command in "parallel" mode, making sure that at most
maxParallel sourcefiles get passed on the command line.
|
void |
setAddsourcefile(boolean b)
Set whether to send the source file name on the command line.
|
void |
setDest(File destDir)
Specify the directory where target files are to be placed.
|
void |
setForce(boolean b)
Set whether to bypass timestamp comparisons for target files.
|
void |
setForwardslash(boolean forwardSlash)
Set whether the source and target file names on Windows and OS/2
must use the forward slash as file separator.
|
void |
setIgnoremissing(boolean b)
Set whether to ignore nonexistent files from filelists.
|
void |
setMaxParallel(int max)
Limit the command line length by passing at maximum this many
sourcefiles at once to the command.
|
void |
setParallel(boolean parallel)
Set whether to execute in parallel mode.
|
void |
setRelative(boolean relative)
Set whether the filenames should be passed on the command line as
absolute or relative pathnames.
|
void |
setSkipEmptyFilesets(boolean skip)
Set whether empty filesets will be skipped.
|
void |
setType(ExecuteOn.FileDirBoth type)
Set whether the command works only on files, directories or both.
|
protected void |
setupRedirector()
Set up the I/O Redirector.
|
void |
setVerbose(boolean b)
Set whether to operate in verbose mode.
|
addConfiguredRedirector, addEnv, createArg, createWatchdog, execute, getOs, getOsFamily, getResolveExecutable, isValidOs, logFlush, maybeSetResultPropertyValue, prepareExec, resolveExecutable, runExecute, setAppend, setCommand, setDir, setError, setErrorProperty, setExecutable, setFailIfExecutionFails, setFailonerror, setInput, setInputString, setLogError, setNewenvironment, setOs, setOsFamily, setOutput, setOutputproperty, setResolveExecutable, setResultProperty, setSearchPath, setSpawn, setTimeout, setTimeout, setVMLauncher
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
protected File destDir
protected Vector<AbstractFileSet> filesets
protected FileNameMapper mapper
protected Mapper mapperElement
protected Commandline.Marker srcFilePos
protected boolean srcIsFirst
protected Commandline.Marker targetFilePos
protected String type
public void add(FileNameMapper fileNameMapper)
fileNameMapper
- the mapper to add.public void add(ResourceCollection rc)
rc
- resource collection to add.public void addDirset(DirSet set)
set
- the DirSet to add.public void addFilelist(FileList list)
list
- the FileList to add.public void addFileset(FileSet set)
set
- the FileSet to add.protected void checkConfiguration()
checkConfiguration
in class ExecTask
protected ExecuteStreamHandler createHandler() throws BuildException
createHandler
in class ExecTask
ExecuteStreamHandler
.BuildException
- on error.public Mapper createMapper() throws BuildException
Mapper
.BuildException
- if more than one mapper is defined.public Commandline.Marker createSrcfile()
Commandline.Marker
.public Commandline.Marker createTargetfile()
Commandline.Marker
.protected String[] getCommandline(String[] srcFiles, File[] baseDirs)
srcFiles
- The filenames to add to the commandline.baseDirs
- filenames are relative to this dir.protected String[] getCommandline(String srcFile, File baseDir)
srcFile
- The filename to add to the commandline.baseDir
- filename is relative to this dir.protected String[] getDirs(File baseDir, DirectoryScanner ds)
baseDir
- the File base directory.ds
- the DirectoryScanner to use for file scanning.protected String[] getFiles(File baseDir, DirectoryScanner ds)
baseDir
- the File base directory.ds
- the DirectoryScanner to use for file scanning.protected String[] getFilesAndDirs(FileList list)
list
- the FileList to check.protected void runExec(Execute exe) throws BuildException
runExec
in class ExecTask
exe
- the Execute instance representing the external process.BuildException
- on errorprotected void runParallel(Execute exe, Vector<String> fileNames, Vector<File> baseDirs) throws IOException, BuildException
exe
- the Executable to use.fileNames
- the Vector of filenames.baseDirs
- the Vector of base directories corresponding to fileNames.IOException
- on I/O errors.BuildException
- on other errors.public void setAddsourcefile(boolean b)
Defaults to true
.
b
- whether to add the source file to the command line.public void setDest(File destDir)
destDir
- the File object representing the destination directory.public void setForce(boolean b)
b
- whether to bypass timestamp comparisons.public void setForwardslash(boolean forwardSlash)
forwardSlash
- whether the forward slash will be forced.public void setIgnoremissing(boolean b)
b
- whether to ignore missing files.public void setMaxParallel(int max)
Set to <= 0 for unlimited - this is the default.
max
- int
maximum number of sourcefiles
passed to the executable.public void setParallel(boolean parallel)
parallel
- whether to run in parallel.public void setRelative(boolean relative)
relative
- whether to pass relative pathnames.public void setSkipEmptyFilesets(boolean skip)
skip
- whether to skip empty filesets.public void setType(ExecuteOn.FileDirBoth type)
type
- a FileDirBoth EnumeratedAttribute.protected void setupRedirector()
setupRedirector
in class ExecTask
public void setVerbose(boolean b)
b
- whether to operate in verbose mode.