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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
18 | <html>
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
22 | <title>TarFileSet Type</title>
|
---|
23 | </head>
|
---|
24 | <body>
|
---|
25 | <h2><a name="fileset">TarFileSet</a></h2>
|
---|
26 |
|
---|
27 | <p><em>TarFileSet</em> has been added as a stand-alone type in Ant
|
---|
28 | 1.7.</p>
|
---|
29 |
|
---|
30 | <p>A <code><tarfileset></code> is a special form of a <code><<a
|
---|
31 | href="fileset.html">fileset</a>></code> which can behave in 2
|
---|
32 | different ways : <br>
|
---|
33 | </p>
|
---|
34 | <ul>
|
---|
35 | <li>When the <span style="font-style: italic;">src</span> attribute
|
---|
36 | is used - or a nested resource collection has been specified, the
|
---|
37 | tarfileset is populated with tar entries found in the file <span
|
---|
38 | style="font-style: italic;">src</span>.<br>
|
---|
39 | </li>
|
---|
40 | <li>When the <span style="font-style: italic;">dir</span> attribute
|
---|
41 | is used, the tarfileset is populated with filesystem files found under <span
|
---|
42 | style="font-style: italic;">dir</span>.<br>
|
---|
43 | </li>
|
---|
44 | </ul>
|
---|
45 | <p><code><tarfileset></code> supports all attributes of <code><<a
|
---|
46 | href="fileset.html">fileset</a>></code>
|
---|
47 | in addition to those listed below.<br>
|
---|
48 | </p>
|
---|
49 | <p>A tarfileset can be defined with the <span style="font-style:
|
---|
50 | italic;">id </span>attribute and referred to with the <span
|
---|
51 | style="font-style: italic;">refid</span> attribute. This is also true
|
---|
52 | for tarfileset which has been added in Ant 1.7.<br>
|
---|
53 | </p>
|
---|
54 | <h3>Parameters</h3>
|
---|
55 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
56 | <tbody>
|
---|
57 | <tr>
|
---|
58 | <td valign="top"><b>Attribute</b></td>
|
---|
59 | <td valign="top"><b>Description</b></td>
|
---|
60 | <td valign="top" align="center"><b>Required</b></td>
|
---|
61 | </tr>
|
---|
62 | <tr>
|
---|
63 | <td valign="top">prefix</td>
|
---|
64 | <td valign="top">all files in the fileset are prefixed with that
|
---|
65 | path in the archive.</td>
|
---|
66 | <td align="center" valign="top">No</td>
|
---|
67 | </tr>
|
---|
68 | <tr>
|
---|
69 | <td valign="top">fullpath</td>
|
---|
70 | <td valign="top">the file described by the fileset is placed at
|
---|
71 | that exact location in the archive.</td>
|
---|
72 | <td align="center" valign="top">No</td>
|
---|
73 | </tr>
|
---|
74 | <tr>
|
---|
75 | <td valign="top">src</td>
|
---|
76 | <td valign="top">may be used in place of the <i>dir</i> attribute
|
---|
77 | to specify a tar file whose contents will be extracted and included
|
---|
78 | in the archive.</td>
|
---|
79 | <td align="center" valign="top">No</td>
|
---|
80 | </tr>
|
---|
81 | <tr>
|
---|
82 | <td valign="top">filemode</td>
|
---|
83 | <td valign="top">A 3 digit octal string, specify the user, group
|
---|
84 | and other modes in the standard Unix fashion. Only applies to
|
---|
85 | plain files. Default is 644.</td>
|
---|
86 | <td align="center" valign="top">No</td>
|
---|
87 | </tr>
|
---|
88 | <tr>
|
---|
89 | <td valign="top">dirmode</td>
|
---|
90 | <td valign="top">A 3 digit octal string, specify the user, group
|
---|
91 | and other modes in the standard Unix fashion. Only applies to
|
---|
92 | directories. Default is 755.</td>
|
---|
93 | <td align="center" valign="top">No</td>
|
---|
94 | </tr>
|
---|
95 | <tr>
|
---|
96 | <td valign="top">username</td>
|
---|
97 | <td valign="top">The username for the tar entry. This is not the same as the UID.
|
---|
98 | </td>
|
---|
99 | <td align="center" valign="top">No</td>
|
---|
100 | </tr>
|
---|
101 | <tr>
|
---|
102 | <td valign="top">group</td>
|
---|
103 | <td valign="top">The groupname for the tar entry. This is not the same as the GID.
|
---|
104 | </td>
|
---|
105 | <td align="center" valign="top">No</td>
|
---|
106 | </tr>
|
---|
107 | <tr>
|
---|
108 | <td valign="top">uid</td>
|
---|
109 | <td valign="top">The user identifier (UID) for the tar entry. This is an integer value
|
---|
110 | and is not the same as the username.
|
---|
111 | </td>
|
---|
112 | <td align="center" valign="top">No</td>
|
---|
113 | </tr>
|
---|
114 | <tr>
|
---|
115 | <td valign="top">gid</td>
|
---|
116 | <td valign="top">The group identifier (GID) for the tar entry.
|
---|
117 | </td>
|
---|
118 | <td align="center" valign="top">No</td>
|
---|
119 | </tr>
|
---|
120 | </tbody>
|
---|
121 | </table>
|
---|
122 | <p>The <i>fullpath</i> attribute can only be set for filesets that
|
---|
123 | represent a single file. The <i>prefix</i> and <i>fullpath</i>
|
---|
124 | attributes cannot both be set on the same fileset.</p>
|
---|
125 | <p>When using the <i>src</i> attribute, include and exclude patterns
|
---|
126 | may be used to specify a subset of the archive for inclusion in the
|
---|
127 | archive as with the <i>dir</i> attribute.</p>
|
---|
128 |
|
---|
129 | <p>Please note that currently only the <a
|
---|
130 | href="../CoreTasks/tar.html">tar</a> task uses the permission and
|
---|
131 | ownership attributes.</p>
|
---|
132 |
|
---|
133 | <h3>Parameters specified as nested elements</h3>
|
---|
134 |
|
---|
135 | <h4>any <a href="resources.html">resource</a> or single element
|
---|
136 | resource collection</h4>
|
---|
137 |
|
---|
138 | <p>The specified resource will be used as src.</p>
|
---|
139 |
|
---|
140 | <h3>Examples</h3>
|
---|
141 | <blockquote>
|
---|
142 | <pre>
|
---|
143 | <copy todir="some-dir">
|
---|
144 | <tarfileset includes="lib/**">
|
---|
145 | <bzip2resource>
|
---|
146 | <url url="http://example.org/dist/some-archive.tar.bz2"/>
|
---|
147 | </bzip2resource>
|
---|
148 | </tarfileset>
|
---|
149 | </copy>
|
---|
150 | </pre></blockquote>
|
---|
151 |
|
---|
152 | <p>downloads the archive some-archive.tar.bz2, uncompresses and
|
---|
153 | extracts it on the fly, copies the contents of the lib directory into
|
---|
154 | some-dir and discards the rest of the archive. File timestamps will
|
---|
155 | be compared between the archive's entries and files inside the target
|
---|
156 | directory, no files get overwritten unless they are out-of-date.</p>
|
---|
157 |
|
---|
158 |
|
---|
159 | </body>
|
---|
160 | </html>
|
---|