Class Transform
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.ExecTask
org.apache.tools.ant.taskdefs.ExecuteOn
org.apache.tools.ant.taskdefs.Transform
- All Implemented Interfaces:
Cloneable
Has been merged into ExecuteOn, empty class for backwards compatibility.
We leave that in case that external programs access this class directly,
for example via
Transform tr = (Transform) getProject().createTask("apply") -
Nested Class Summary
Nested classes/interfaces inherited from class ExecuteOn
ExecuteOn.FileDirBothModifier and TypeClassDescriptionstatic classEnumerated attribute with the values "file", "dir" and "both" for the type attribute. -
Field Summary
Fields inherited from class ExecuteOn
destDir, filesets, mapper, mapperElement, srcFilePos, srcIsFirst, targetFilePos, typeModifier and TypeFieldDescriptionprotected Fileprotected Vector<AbstractFileSet> protected FileNameMapperprotected Mapperprotected Commandline.Markerprotected booleanHas <srcfile> been specified before <targetfile>protected Commandline.Markerprotected StringFields inherited from class ExecTask
cmdl, failOnError, newEnvironment, redirector, redirectorElementModifier and TypeFieldDescriptionprotected Commandlineprotected booleanprotected booleanprotected Redirectorprotected RedirectorElementFields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class ExecuteOn
add, add, addDirset, addFilelist, addFileset, checkConfiguration, createHandler, createMapper, createSrcfile, createTargetfile, getCommandline, getCommandline, getDirs, getFiles, getFilesAndDirs, runExec, runParallel, setAddsourcefile, setDest, setForce, setForwardslash, setIgnoremissing, setMaxParallel, setParallel, setRelative, setSkipEmptyFilesets, setType, setupRedirector, setVerboseModifier and TypeMethodDescriptionvoidAdd a collection of resources upon which to operate.voidadd(FileNameMapper fileNameMapper) Add a nested FileNameMapper.voidAdd a set of directories upon which to operate.voidaddFilelist(FileList list) Add a list of source files upon which to operate.voidaddFileset(FileSet set) Add a set of files upon which to operate.protected voidCheck the configuration of this ExecuteOn instance.protected ExecuteStreamHandlerCreate the ExecuteStreamHandler instance that will be used during execution.Create a nested Mapper element to use for mapping source files to target files.Create a placeholder indicating where on the command line the name of the source file should be inserted.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 voidRun the specified Execute object.protected voidRun the command in "parallel" mode, making sure that at most maxParallel sourcefiles get passed on the command line.voidsetAddsourcefile(boolean b) Set whether to send the source file name on the command line.voidSpecify the directory where target files are to be placed.voidsetForce(boolean b) Set whether to bypass timestamp comparisons for target files.voidsetForwardslash(boolean forwardSlash) Set whether the source and target file names on Windows and OS/2 must use the forward slash as file separator.voidsetIgnoremissing(boolean b) Set whether to ignore nonexistent files from filelists.voidsetMaxParallel(int max) Limit the command line length by passing at maximum this many sourcefiles at once to the command.voidsetParallel(boolean parallel) Set whether to execute in parallel mode.voidsetRelative(boolean relative) Set whether the filenames should be passed on the command line as absolute or relative pathnames.voidsetSkipEmptyFilesets(boolean skip) Set whether empty filesets will be skipped.voidsetType(ExecuteOn.FileDirBoth type) Set whether the command works only on files, directories or both.protected voidSet up the I/O Redirector.voidsetVerbose(boolean b) Set whether to operate in verbose mode.Methods inherited from class ExecTask
addConfiguredRedirector, addEnv, createArg, createWatchdog, execute, getOs, getOsFamily, getResolveExecutable, isValidOs, logFlush, maybeSetResultPropertyValue, prepareExec, resolveExecutable, runExecute, setAppend, setCommand, setDir, setDiscardError, setDiscardOutput, setError, setErrorProperty, setExecutable, setFailIfExecutionFails, setFailonerror, setInput, setInputString, setLogError, setNewenvironment, setOs, setOsFamily, setOutput, setOutputproperty, setResolveExecutable, setResultProperty, setSearchPath, setSpawn, setTimeout, setTimeout, setVMLauncherModifier and TypeMethodDescriptionvoidaddConfiguredRedirector(RedirectorElement redirectorElement) Add aRedirectorElementto this task.voidAdd an environment variable to the launched process.Adds a command-line argument.protected ExecuteWatchdogCreate the Watchdog to kill a runaway process.voidexecute()Do the work.final StringgetOs()List of operating systems on which the command may be executed.final StringRestrict this execution to a single OS FamilybooleanIndicates whether to attempt to resolve the executable to a file.protected booleanIs this the OS the user wanted?protected voidlogFlush()Flush the output stream - if there is one.protected voidmaybeSetResultPropertyValue(int result) Helper method to set result property to the passed in value if appropriate.protected ExecuteCreate an Execute instance with the correct working directory set.protected StringresolveExecutable(String exec, boolean mustSearchPath) The method attempts to figure out where the executable is so that we can feed the full path.protected final voidrunExecute(Execute exe) A Utility method for this classes and subclasses to run an Execute instance (an external command).voidsetAppend(boolean append) Set whether output should be appended to or overwrite an existing file.voidsetCommand(Commandline cmdl) Sets a command line.voidSet the working directory of the process.voidsetDiscardError(boolean discard) Whether error output should be discarded.voidsetDiscardOutput(boolean discard) Whether output should be discarded.voidSet the File to which the error stream of the process should be redirected.voidsetErrorProperty(String errorProperty) Sets the name of the property whose value should be set to the error of the process.voidsetExecutable(String value) Set the name of the executable program.voidsetFailIfExecutionFails(boolean flag) Set whether to stop the build if program cannot be started.voidsetFailonerror(boolean fail) Fail if the command exits with a non-zero return code.voidSet the input file to use for the task.voidsetInputString(String inputString) Set the string to use as input.voidsetLogError(boolean logError) Controls whether error output of exec is logged.voidsetNewenvironment(boolean newenv) Do not propagate old environment when new environment variables are specified.voidList of operating systems on which the command may be executed.voidsetOsFamily(String osFamily) Restrict this execution to a single OS FamilyvoidFile the output of the process is redirected to.voidsetOutputproperty(String outputProp) Sets the property name whose value should be set to the output of the process.voidsetResolveExecutable(boolean resolveExecutable) Set whether to attempt to resolve the executable to a file.voidsetResultProperty(String resultProperty) Sets the name of a property in which the return code of the command should be stored.voidsetSearchPath(boolean searchPath) Set whether to search nested, then system PATH environment variables for the executable.voidsetSpawn(boolean spawn) Set whether or not you want the process to be spawned.voidsetTimeout(Integer value) Set the timeout in milliseconds after which the process will be killed.voidsetTimeout(Long value) Set the timeout in milliseconds after which the process will be killed.voidsetVMLauncher(boolean vmLauncher) Set whether to launch new process with VM, otherwise use the OS's shell.Methods inherited from class Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeModifier and TypeMethodDescriptionfinal voidbindToOwner(Task owner) Bind a task to another; use this when configuring a newly created task to do work on behalf of another.Returns the container target of this task.Returns the wrapper used for runtime configuration.Returns the name to use in logging messages.Return the type of task.protected RuntimeConfigurableReturn the runtime configurable structure for this task.protected voidhandleErrorFlush(String output) Handles an error line by logging it with the WARN priority.protected voidhandleErrorOutput(String output) Handles an error output by logging it with the WARN priority.protected voidhandleFlush(String output) Handles output by logging it with the INFO priority.protected inthandleInput(byte[] buffer, int offset, int length) Handle an input request by this task.protected voidhandleOutput(String output) Handles output by logging it with the INFO priority.voidinit()Called by the project to let the task initialize properly.protected final booleanHas this task been marked invalid?voidLogs a message with the default (INFO) priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidLogs a message with the given priority.voidConfigures this task - if it hasn't been done already.final voidperform()Performs this task if it's still valid, or gets a replacement version and performs that otherwise.voidForce the task to be reconfigured from its RuntimeConfigurable.voidsetOwningTarget(Target target) Sets the target container of this task.voidSets the wrapper to be used for runtime configuration.voidsetTaskName(String name) Sets the name to use in logging messages.voidsetTaskType(String type) Sets the name with which the task has been invoked.Methods inherited from class ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProjectModifier and TypeMethodDescriptionclone()Returns the description of the current action.Returns the file/location where this task was defined.Returns the project to which this component belongs.voidsetDescription(String desc) Sets a description of the current action.voidsetLocation(Location location) Sets the file/location where this task was defined.voidsetProject(Project project) Sets the project object of this component.
-
Constructor Details
-
Transform
public Transform()
-