2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2001-08-06 14:32:46 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2002-02-03 22:00:42 +00:00
|
|
|
<title>DependSet Task</title>
|
2001-08-06 14:32:46 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2>DependSet</h2>
|
|
|
|
|
2005-09-15 15:39:15 +00:00
|
|
|
A task to manage arbitrary dependencies between resources.
|
2001-08-06 14:32:46 +00:00
|
|
|
|
|
|
|
<h3>Description</h3>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The <code>dependset</code> task compares a set of sources with a set of target files. If any of
|
|
|
|
the sources has been modified more recently than any of the target files, all of the target files
|
|
|
|
are removed.</p>
|
|
|
|
<p>Sources and target files are specified via
|
|
|
|
nested <a href="../Types/resources.html#collection">Resource Collection</a>s; sources can be
|
|
|
|
resources of any type, while targets are restricted to files only. At least one set of sources and
|
|
|
|
one set of targets is required.</p>
|
|
|
|
<p>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.</p>
|
|
|
|
<p>DependSet is useful to capture dependencies that are not or cannot be determined algorithmically.
|
|
|
|
For example, the <code><style></code> task only compares the source XML file and XSLT
|
|
|
|
stylesheet against the target file to determined whether to restyle the source.
|
|
|
|
Using <code>dependset</code> you can extend this dependency checking to include a DTD or XSD file as
|
|
|
|
well as other stylesheets imported by the main stylesheet.</p>
|
2001-08-06 14:32:46 +00:00
|
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<table class="attr">
|
2008-12-03 16:53:33 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<th>Attribute</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Required</th>
|
2008-12-03 16:53:33 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>verbose</td>
|
|
|
|
<td>Makes the task list all deleted targets files and the reason why they get deleted.</td>
|
|
|
|
<td>No</td>
|
2008-12-03 16:53:33 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2001-08-06 14:32:46 +00:00
|
|
|
|
|
|
|
<h3>Parameters Specified as Nested Elements</h3>
|
|
|
|
|
2005-09-15 15:39:15 +00:00
|
|
|
<h4>sources</h4>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The <code><sources></code> element is a <a href="../Types/resources.html#union">Union</a>
|
|
|
|
into which arbitrary resource collections can be nested. <em>Since Apache Ant 1.7</em>
|
2005-09-15 15:39:15 +00:00
|
|
|
</p>
|
|
|
|
|
2001-08-06 14:32:46 +00:00
|
|
|
<h4>srcfileset</h4>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The nested <code><srcfileset></code> element specifies
|
|
|
|
a <a href="../Types/fileset.html">FileSet</a>. All files included in this fileset will be compared
|
|
|
|
against all files included in all of the <code><targetfileset></code> filesets
|
|
|
|
and <code><targetfilelist></code> filelists. Multiple <code><srcfileset></code>
|
|
|
|
filesets may be specified.</p>
|
2001-08-06 14:32:46 +00:00
|
|
|
|
|
|
|
<h4>srcfilelist</h4>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The nested <code><srcfilelist></code> element specifies
|
|
|
|
a <a href="../Types/filelist.html">FileList</a>. All files included in this filelist will be
|
|
|
|
compared against all files included in all of the <code><targetfileset></code> filesets
|
|
|
|
and <code><targetfilelist></code> filelists. Multiple <code><srcfilelist></code>
|
|
|
|
filelists may be specified.</p>
|
2005-09-15 15:39:15 +00:00
|
|
|
|
|
|
|
<h4>targets</h4>
|
|
|
|
|
2018-03-04 15:17:41 +01:00
|
|
|
<p><em>Since Ant 1.7</em></p>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The <code><targets></code> element is a <a href="../using.html#path">Path</a> and thus can
|
2018-03-04 15:17:41 +01:00
|
|
|
include any filesystem-based resource.</p>
|
2001-08-06 14:32:46 +00:00
|
|
|
|
|
|
|
<h4>targetfileset</h4>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The nested <code><targetfileset></code> element specifies
|
|
|
|
a <a href="../Types/fileset.html">FileSet</a>. All files included in this fileset will be compared
|
|
|
|
against all files included in all of the <code><srcfileset></code> filesets
|
|
|
|
and <code><sourcefilelist></code> filelists, and if any are older, they are all deleted.
|
|
|
|
Multiple <code><targetfileset></code> filesets may be specified.</p>
|
2001-08-06 14:32:46 +00:00
|
|
|
|
|
|
|
<h4>targetfilelist</h4>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The nested <code><targetfilelist></code> element specifies
|
|
|
|
a <a href="../Types/filelist.html">FileList</a>. All files included in this filelist will be
|
|
|
|
compared against all files included in all of the <code><srcfileset></code> filesets
|
|
|
|
and <code><sourcefilelist></code> filelists, and if any are older, they are all deleted.
|
|
|
|
Multiple <code><targetfilelist></code> filelists may be specified.</p>
|
2001-08-06 14:32:46 +00:00
|
|
|
|
|
|
|
<h3>Examples</h3>
|
2018-02-09 06:54:03 +01:00
|
|
|
<pre>
|
2018-02-28 07:58:59 +01:00
|
|
|
<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></pre>
|
|
|
|
|
|
|
|
<p>In this example derived HTML files in the ${output.dir} directory will be removed if any are
|
|
|
|
out-of-date with respect to:</p>
|
2001-08-30 13:23:14 +00:00
|
|
|
<ol>
|
2018-02-28 07:58:59 +01:00
|
|
|
<li>the DTD of their source XML files</li>
|
|
|
|
<li>a common DTD (imported by the main DTD)</li>
|
|
|
|
<li>a subordinate XSLT stylesheet (imported by the main stylesheet), or</li>
|
|
|
|
<li>the buildfile</li>
|
2001-08-30 13:23:14 +00:00
|
|
|
</ol>
|
2001-09-08 01:05:18 +00:00
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>If any of the sources in the above example does not exist, all target files will also be removed.
|
|
|
|
To ignore missing sources instead, use filesets instead of filelists for the sources.</p>
|
2001-08-06 14:32:46 +00:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|