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 |
|
---|
29 | A task to manage arbitrary dependencies between resources.
|
---|
30 |
|
---|
31 | <h3>Description</h3>
|
---|
32 |
|
---|
33 | <p>
|
---|
34 | The dependset task compares a set of sources with a set of target
|
---|
35 | files. If any of the sources has been modified more recently than
|
---|
36 | any of the target files, all of the target files are removed.
|
---|
37 | </p>
|
---|
38 | <p>
|
---|
39 | Sources and target files are specified via nested
|
---|
40 | <a href="../CoreTypes/resources.html#collection">Resource Collection</a>s;
|
---|
41 | sources can be resources of any type, while targets are restricted to files
|
---|
42 | only. At least one set of sources and one set of targets is required.
|
---|
43 | </p>
|
---|
44 | <p>
|
---|
45 | Use a FileSet when you want to use wildcard include or exclude
|
---|
46 | patterns and don't care about missing files. Use a FileList when you
|
---|
47 | want to consider the non-existence of a file as if it were out of
|
---|
48 | date. If there are any non-existing files in any source or target
|
---|
49 | FileList, all target files will be removed.
|
---|
50 | </p>
|
---|
51 | <p>
|
---|
52 | DependSet is useful to capture dependencies that are not or cannot be
|
---|
53 | determined algorithmically. For example, the <code><style></code> task only
|
---|
54 | compares the source XML file and XSLT stylesheet against the target
|
---|
55 | file to determined whether to restyle the source. Using dependset you
|
---|
56 | can extend this dependency checking to include a DTD or XSD file as
|
---|
57 | well 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><sources></code> element is a
|
---|
71 | <a href="../CoreTypes/resources.html#union">Union</a> into which
|
---|
72 | arbitrary resource collections can be nested. <b>Since Ant 1.7</b>
|
---|
73 | </p>
|
---|
74 |
|
---|
75 | <h4>srcfileset</h4>
|
---|
76 |
|
---|
77 | <p>
|
---|
78 | The nested <code><srcfileset></code> element specifies a <a
|
---|
79 | href="../CoreTypes/fileset.html">FileSet</a>. All files included in
|
---|
80 | this fileset will be compared against all files included in all of the
|
---|
81 | <code><targetfileset></code> filesets and <code><targetfilelist></code>
|
---|
82 | filelists. Multiple <code><srcfileset></code> filesets may be specified.
|
---|
83 | </p>
|
---|
84 |
|
---|
85 | <h4>srcfilelist</h4>
|
---|
86 |
|
---|
87 | <p>
|
---|
88 | The nested <code><srcfilelist></code> element specifies a <a
|
---|
89 | href="../CoreTypes/filelist.html">FileList</a>. All files included in
|
---|
90 | this filelist will be compared against all files included in all of the
|
---|
91 | <code><targetfileset></code> filesets and <code><targetfilelist></code>
|
---|
92 | filelists. Multiple <code><srcfilelist></code> filelists may be specified.
|
---|
93 | </p>
|
---|
94 |
|
---|
95 | <h4>targets</h4>
|
---|
96 |
|
---|
97 | <p>The <code><targets></code> element is a
|
---|
98 | <a href="../using.html#path">Path</a> and thus can
|
---|
99 | include any filesystem-based resource. <b>Since Ant 1.7</b>
|
---|
100 | </p>
|
---|
101 |
|
---|
102 | <h4>targetfileset</h4>
|
---|
103 |
|
---|
104 | <p>
|
---|
105 | The nested <code><targetfileset></code> element specifies a <a
|
---|
106 | href="../CoreTypes/fileset.html">FileSet</a>. All files included in
|
---|
107 | this fileset will be compared against all files included in all of the
|
---|
108 | <code><srcfileset></code> filesets and <code><sourcefilelist></code>
|
---|
109 | filelists, and if any are older, they are all deleted.
|
---|
110 | Multiple <code><targetfileset></code> filesets may be specified.
|
---|
111 | </p>
|
---|
112 |
|
---|
113 | <h4>targetfilelist</h4>
|
---|
114 |
|
---|
115 | <p>
|
---|
116 | The nested <code><targetfilelist></code> element specifies a <a
|
---|
117 | href="../CoreTypes/filelist.html">FileList</a>. All files included in
|
---|
118 | this filelist will be compared against all files included in all of the
|
---|
119 | <code><srcfileset></code> filesets and <code><sourcefilelist></code>
|
---|
120 | filelists, and if any are older, they are all deleted.
|
---|
121 | Multiple <code><targetfilelist></code> filelists may be specified.
|
---|
122 | </p>
|
---|
123 |
|
---|
124 | <h3>Examples</h3>
|
---|
125 | <blockquote> <pre>
|
---|
126 | <dependset>
|
---|
127 | <srcfilelist
|
---|
128 | dir = "${dtd.dir}"
|
---|
129 | files = "paper.dtd,common.dtd"/>
|
---|
130 | <srcfilelist
|
---|
131 | dir = "${xsl.dir}"
|
---|
132 | files = "common.xsl"/>
|
---|
133 | <srcfilelist
|
---|
134 | dir = "${basedir}"
|
---|
135 | files = "build.xml"/>
|
---|
136 | <targetfileset
|
---|
137 | dir = "${output.dir}"
|
---|
138 | includes = "**/*.html"/>
|
---|
139 | </dependset> </pre>
|
---|
140 | </blockquote>
|
---|
141 |
|
---|
142 | <p>
|
---|
143 | In this example derived HTML files in the ${output.dir} directory
|
---|
144 | will 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>
|
---|
153 | If any of the sources in the above example does not exist, all
|
---|
154 | target files will also be removed. To ignore missing sources instead,
|
---|
155 | use filesets instead of filelists for the sources.
|
---|
156 | </p>
|
---|
157 |
|
---|
158 |
|
---|
159 |
|
---|
160 | </body>
|
---|
161 | </html>
|
---|