source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual1.7.0/manual/OptionalTypes/classfileset.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: 3.9 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<head>
19<meta http-equiv="Content-Language" content="en-us">
20<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
21<title>ClassFileSet Type</title>
22</head>
23
24<body>
25<h2><a name="fileset">ClassFileSet</a></h2>
26<p>A classfileset is a specialised type of fileset which, given a set of
27&quot;root&quot; classes, will include all of the class files upon which the
28root classes depend. This is typically used to create a jar with all of the
29required classes for a particular application.
30</p>
31<p>
32classfilesets are typically used by reference. They are declared with an
33&quot;id&quot; value and this is then used as a reference where a normal fileset
34is expected.
35</p>
36<p>
37This type requires the <code>jakarta-BCEL</code> library.
38</p>
39
40
41<h3>Attributes</h3>
42<p>The class fileset support the following attributes in addition
43to those supported by the
44<a href="../CoreTypes/fileset.html">standard fileset</a>:
45</p>
46
47<table border="1" cellpadding="2" cellspacing="0">
48 <tr>
49 <td valign="top"><b>Attribute</b></td>
50 <td valign="top"><b>Description</b></td>
51 <td align="center" valign="top"><b>Required</b></td>
52 </tr>
53 <tr>
54 <td valign="top">rootclass</td>
55 <td valign="top">A single root class name</td>
56 <td valign="top" align="center">No</td>
57 </tr>
58</table>
59
60<h3>Nested Elements</h3>
61
62<h4>Root</h4>
63<p>
64When more than one root class is required, multiple nested <code>&lt;root&gt;</code> elements
65may be used
66</p>
67<table border="1" cellpadding="2" cellspacing="0">
68 <tr>
69 <td valign="top"><b>Attribute</b></td>
70 <td valign="top"><b>Description</b></td>
71 <td align="center" valign="top"><b>Required</b></td>
72 </tr>
73 <tr>
74 <td valign="top">classname</td>
75 <td valign="top">The fully qualified name of the root class</td>
76 <td align="center" valign="top">Yes</td>
77 </tr>
78</table>
79
80<h4>RootFileSet</h4>
81<p>
82A root fileset is used to add a set of root classes from a fileset. In this case the entries in
83the fileset are expected to be Java class files. The name of the Java class is determined by the
84relative location of the classfile in the fileset. So, the file
85<code>org/apache/tools/ant/Project.class</code> corresponds to the Java class
86<code>org.apache.tools.ant.Project</code>.</p>
87
88<h3>Examples</h3>
89<blockquote><pre>
90&lt;classfileset id=&quot;reqdClasses" dir=&quot;${classes.dir}&quot;&gt;
91 &lt;root classname=&quot;org.apache.tools.ant.Project&quot;/&gt;
92&lt;/classfileset&gt;
93</pre></blockquote>
94
95<p>This example creates a fileset containing all the class files upon which the
96<code>org.apache.tools.ant.Project</code> class depends. This fileset could
97then be used to create a jar.
98</p>
99
100<blockquote><pre>
101&lt;jar destfile=&quot;minimal.jar&quot;&gt;
102 &lt;fileset refid=&quot;reqdClasses&quot;/&gt;
103&lt;/jar&gt;
104</pre></blockquote>
105
106<blockquote><pre>
107&lt;classfileset id=&quot;reqdClasses&quot; dir=&quot;${classes.dir}&quot;&gt;
108 &lt;rootfileset dir=&quot;${classes.dir}&quot; includes=&quot;org/apache/tools/ant/Project*.class&quot;/&gt;
109&lt;/classfileset&gt;
110</pre></blockquote>
111
112<p>This example constructs the classfileset using all the class with names starting with Project
113in the org.apache.tools.ant package</p>
114
115
116
117</body>
118</html>
119
Note: See TracBrowser for help on using the repository browser.