source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual1.7.0/manual/CoreTasks/dependset.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

File size: 5.5 KB
Line 
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<html>
18
19<head>
20<meta http-equiv="Content-Language" content="en-us">
21<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22<title>DependSet Task</title>
23</head>
24
25<body>
26
27<h2>DependSet</h2>
28
29A task to manage arbitrary dependencies between resources.
30
31<h3>Description</h3>
32
33<p>
34The dependset task compares a set of sources with a set of target
35files. If any of the sources has been modified more recently than
36any of the target files, all of the target files are removed.
37</p>
38<p>
39Sources and target files are specified via nested
40<a href="../CoreTypes/resources.html#collection">Resource Collection</a>s;
41sources can be resources of any type, while targets are restricted to files
42only. At least one set of sources and one set of targets is required.
43</p>
44<p>
45Use a FileSet when you want to use wildcard include or exclude
46patterns and don't care about missing files. Use a FileList when you
47want to consider the non-existence of a file as if it were out of
48date. If there are any non-existing files in any source or target
49FileList, all target files will be removed.
50</p>
51<p>
52DependSet is useful to capture dependencies that are not or cannot be
53determined algorithmically. For example, the <code>&lt;style&gt;</code> task only
54compares the source XML file and XSLT stylesheet against the target
55file to determined whether to restyle the source. Using dependset you
56can extend this dependency checking to include a DTD or XSD file as
57well as other stylesheets imported by the main stylesheet.
58</p>
59
60<h3>Parameters</h3>
61
62<p>
63(none)
64</p>
65
66<h3>Parameters Specified as Nested Elements</h3>
67
68<h4>sources</h4>
69
70<p>The <code>&lt;sources&gt;</code> element is a
71<a href="../CoreTypes/resources.html#union">Union</a> into which
72arbitrary resource collections can be nested. <b>Since Ant 1.7</b>
73</p>
74
75<h4>srcfileset</h4>
76
77<p>
78The nested <code>&lt;srcfileset&gt;</code> element specifies a <a
79href="../CoreTypes/fileset.html">FileSet</a>. All files included in
80this fileset will be compared against all files included in all of the
81<code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
82filelists. Multiple <code>&lt;srcfileset&gt;</code> filesets may be specified.
83</p>
84
85<h4>srcfilelist</h4>
86
87<p>
88The nested <code>&lt;srcfilelist&gt;</code> element specifies a <a
89href="../CoreTypes/filelist.html">FileList</a>. All files included in
90this filelist will be compared against all files included in all of the
91<code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
92filelists. Multiple <code>&lt;srcfilelist&gt;</code> filelists may be specified.
93</p>
94
95<h4>targets</h4>
96
97<p>The <code>&lt;targets&gt;</code> element is a
98<a href="../using.html#path">Path</a> and thus can
99include any filesystem-based resource. <b>Since Ant 1.7</b>
100</p>
101
102<h4>targetfileset</h4>
103
104<p>
105The nested <code>&lt;targetfileset&gt;</code> element specifies a <a
106href="../CoreTypes/fileset.html">FileSet</a>. All files included in
107this fileset will be compared against all files included in all of the
108<code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
109filelists, and if any are older, they are all deleted.
110Multiple <code>&lt;targetfileset&gt;</code> filesets may be specified.
111</p>
112
113<h4>targetfilelist</h4>
114
115<p>
116The nested <code>&lt;targetfilelist&gt;</code> element specifies a <a
117href="../CoreTypes/filelist.html">FileList</a>. All files included in
118this filelist will be compared against all files included in all of the
119<code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
120filelists, and if any are older, they are all deleted.
121Multiple <code>&lt;targetfilelist&gt;</code> filelists may be specified.
122</p>
123
124<h3>Examples</h3>
125<blockquote> <pre>
126 &lt;dependset&gt;
127 &lt;srcfilelist
128 dir = &quot;${dtd.dir}&quot;
129 files = &quot;paper.dtd,common.dtd&quot;/&gt;
130 &lt;srcfilelist
131 dir = &quot;${xsl.dir}&quot;
132 files = &quot;common.xsl&quot;/&gt;
133 &lt;srcfilelist
134 dir = &quot;${basedir}&quot;
135 files = &quot;build.xml&quot;/&gt;
136 &lt;targetfileset
137 dir = &quot;${output.dir}&quot;
138 includes = &quot;**/*.html&quot;/&gt;
139 &lt;/dependset&gt; </pre>
140</blockquote>
141
142<p>
143In this example derived HTML files in the ${output.dir} directory
144will be removed if any are out-of-date with respect to:</p>
145<ol>
146<li>the DTD of their source XML files</li>
147<li>a common DTD (imported by the main DTD)</li>
148<li>a subordinate XSLT stylesheet (imported by the main stylesheet), or</li>
149<li>the buildfile</li>
150</ol>
151
152<p>
153If any of the sources in the above example does not exist, all
154target files will also be removed. To ignore missing sources instead,
155use filesets instead of filelists for the sources.
156</p>
157
158
159
160</body>
161</html>
Note: See TracBrowser for help on using the repository browser.