java left logo
java middle logo
java right logo
 

Home arrow Other API Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 3947
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
How to use DependSet task E-mail
User Rating: / 11
PoorBest 

DependSet

A task to manage arbitrary dependencies between files.

Description

The dependset task compares a set of source files with a set of target files. If any of the source files is more recent than any of the target files, all of the target files are removed.

Source files and target files are specified via nested FileSets and/or nested FileLists. Arbitrarily many source and target filesets/filelists may be specified, but at least one filelist/fileset is required for both sources and targets.

Use a FileSet when you want to use wildcard include or exclude patterns and don't care about missing files. Use a FileList when you want to consider the non-existence of a file as if it were out of date. If there are any non-existing files in any source or target FileList, all target files will be removed.

DependSet is useful to capture dependencies that are not or cannot be determined algorithmically. For example, the <style> task only compares the source XML file and XSLT stylesheet against the target file to determined whether to restyle the source. Using dependset you can extend this dependency checking to include a DTD or XSD file as well as other stylesheets imported by the main stylesheet.

Parameters

(none)

Parameters Specified as Nested Elements

srcfileset

The nested srcfileset element specifies a FileSet. All files included in this fileset will be compared against all files included in all of the targetfileset filesets and targetfilelist filelists. Multiple srcfileset filesets may be specified.

srcfilelist

The nested srcfilelist element specifies a FileList. All files included in this filelist will be compared against all files included in all of the targetfileset filesets and targetfilelist filelists. Multiple srcfilelist filelists may be specified.

targetfileset

The nested targetfileset element specifies a FileSet. All files included in this fileset will be compared against all files included in all of the srcfileset filesets and sourcefilelist filelists, and if any are older, they are all deleted. Multiple targetfileset filesets may be specified.

targetfilelist

The nested targetfilelist element specifies a FileList. All files included in this filelist will be compared against all files included in all of the srcfileset filesets and sourcefilelist filelists, and if any are older, they are all deleted. Multiple targetfilelist filelists may be specified.

Examples

    
    <dependset>

       <srcfilelist
           dir   = "${dtd.dir}"
           files = "paper.dtd,common.dtd"/>
       <srcfilelist
           dir   = "${xsl.dir}"
           files = "common.xsl"/>

       <srcfilelist
           dir   = "${basedir}"
           files = "build.xml"/>
       <targetfileset
           dir      = "${output.dir}"
           includes = "**/*.html"/>

    </dependset>  

In this example derived HTML files in the ${output.dir} directory will be removed if any are out-of-date with respect to:

  1. the DTD of their source XML files
  2. a common DTD (imported by the main DTD)
  3. a subordinate XSLT stylesheet (imported by the main stylesheet), or
  4. the buildfile

If any of the source files in the above example does not exist, all target files will also be removed. To ignore missing source files instead, use filesets instead of filelists for the source files.

Source: Apache Ant


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.