org.apache.tools.ant.taskdefs
Class Transform

java.lang.Object
  |
  +--org.apache.tools.ant.Task
        |
        +--org.apache.tools.ant.taskdefs.ExecTask
              |
              +--org.apache.tools.ant.taskdefs.ExecuteOn
                    |
                    +--org.apache.tools.ant.taskdefs.Transform

public class Transform
extends ExecuteOn

Executes a given command, supplying a set of files as arguments.

Only those files that are newer than their corresponding target files will be handeled, the rest will be ignored.

Author:
Stefan Bodewig

Inner classes inherited from class org.apache.tools.ant.taskdefs.ExecuteOn
ExecuteOn.FileDirBoth
 
Field Summary
protected  java.io.File destDir
           
protected  FileNameMapper mapper
           
protected  Mapper mapperElement
           
protected  boolean srcIsFirst
          Has <srcfile> been specified before <targetfile>
protected  Commandline.Marker targetFilePos
           
 
Fields inherited from class org.apache.tools.ant.taskdefs.ExecuteOn
filesets, srcFilePos, type
 
Fields inherited from class org.apache.tools.ant.taskdefs.ExecTask
cmdl, failOnError, newEnvironment
 
Fields inherited from class org.apache.tools.ant.Task
description, location, project, target, taskName, taskType, wrapper
 
Constructor Summary
Transform()
           
 
Method Summary
protected  void checkConfiguration()
          Has the user set all necessary attributes?
 Mapper createMapper()
          Defines the FileNameMapper to use (nested mapper element).
 Commandline.Marker createTargetfile()
          Marker that indicates where the name of the target 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 - i.e.
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 - i.e.
 void setDest(java.io.File destDir)
          Set the destination directory.
 
Methods inherited from class org.apache.tools.ant.taskdefs.ExecuteOn
addFileset, createSrcfile, runExec, setParallel, setType
 
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
 

Field Detail

targetFilePos

protected Commandline.Marker targetFilePos

mapperElement

protected Mapper mapperElement

mapper

protected FileNameMapper mapper

destDir

protected java.io.File destDir

srcIsFirst

protected boolean srcIsFirst
Has <srcfile> been specified before <targetfile>
Constructor Detail

Transform

public Transform()
Method Detail

setDest

public void setDest(java.io.File destDir)
Set the destination directory.

createTargetfile

public Commandline.Marker createTargetfile()
Marker that indicates where the name of the target file should be put on the command line.

createMapper

public Mapper createMapper()
                    throws BuildException
Defines the FileNameMapper to use (nested mapper element).

checkConfiguration

protected void checkConfiguration()
Description copied from class: ExecTask
Has the user set all necessary attributes?
Overrides:
checkConfiguration in class ExecuteOn

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 - i.e. only those that are newer than the corresponding target files.
Overrides:
getFiles in class ExecuteOn

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 - i.e. only those that are newer than the corresponding target files.
Overrides:
getDirs in class ExecuteOn

getCommandline

protected java.lang.String[] getCommandline(java.lang.String[] srcFiles,
                                            java.io.File baseDir)
Construct the command line for parallel execution.
Overrides:
getCommandline in class ExecuteOn
Parameters:
srcFiles - The filenames to add to the commandline
baseDir - 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.
Overrides:
getCommandline in class ExecuteOn
Parameters:
srcFile - The filename to add to the commandline
baseDir - filename is relative to this dir


Copyright ? 2000 Apache Software Foundation. All Rights Reserved.