org.apache.tools.ant.taskdefs
Class DependSet

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.MatchingTask
                    |
                    +--org.apache.tools.ant.taskdefs.DependSet

public class DependSet
extends MatchingTask

A Task to record explicit dependencies. If any of the target files are out of date with respect to any of the source files, all target files are removed. This is useful where dependencies cannot be computed (for example, dynamically interpreted parameters or files that need to stay in synch but are not directly linked) or where the ant task in question could compute them but does not (for example, the linked DTD for an XML file using the style task). nested arguments:

At least one instance of either a fileset or filelist for both source and target are required.

This task will examine each of the source files against each of the target files. If any target files are out of date with respect to any of the source files, all targets are removed. If any files named in a (src or target) filelist do not exist, all targets are removed. Hint: If missing files should be ignored, specify them as include patterns in filesets, rather than using filelists.

This task attempts to optimize speed of dependency checking. It will stop after the first out of date file is found and remove all targets, rather than exhaustively checking every source vs target combination unnecessarily.

Example uses:

  • Record the fact that an XML file must be up to date with respect to its XSD (Schema file), even though the XML file itself includes no reference to its XSD.
  • Record the fact that an XSL stylesheet includes other sub-stylesheets
  • Record the fact that java files must be recompiled if the ant build file changes
  • Version:
    $Revision: 1.1.2.1 $ $Date: 2001/08/18 14:22:09 $
    Author:
    Craeg Strong

    Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
    fileset, useDefaultExcludes
     
    Fields inherited from class org.apache.tools.ant.Task
    description, location, target, taskName, taskType, wrapper
     
    Fields inherited from class org.apache.tools.ant.ProjectComponent
    project
     
    Constructor Summary
    DependSet()
              Creates a new DependSet Task.
     
    Method Summary
     void addSrcfilelist(FileList fl)
              Nested <srcfilelist> element.
     void addSrcfileset(FileSet fs)
              Nested <srcfileset> element.
     void addTargetfilelist(FileList fl)
              Nested <targetfilelist> element.
     void addTargetfileset(FileSet fs)
              Nested <targetfileset> element.
     void execute()
              Executes the task.
     
    Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
    createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, setDefaultexcludes, setExcludes, setExcludesfile, setIncludes, setIncludesfile, XsetIgnore, XsetItems
     
    Methods inherited from class org.apache.tools.ant.Task
    getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
     
    Methods inherited from class org.apache.tools.ant.ProjectComponent
    getProject, setProject
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    DependSet

    public DependSet()
    Creates a new DependSet Task.
    Method Detail

    addSrcfileset

    public void addSrcfileset(FileSet fs)
    Nested <srcfileset> element.

    addSrcfilelist

    public void addSrcfilelist(FileList fl)
    Nested <srcfilelist> element.

    addTargetfileset

    public void addTargetfileset(FileSet fs)
    Nested <targetfileset> element.

    addTargetfilelist

    public void addTargetfilelist(FileList fl)
    Nested <targetfilelist> element.

    execute

    public void execute()
                 throws BuildException
    Executes the task.
    Overrides:
    execute in class Task
    Following copied from class: org.apache.tools.ant.Task
    Throws:
    BuildException - if someting goes wrong with the build


    Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.