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 | "root" classes, will include all of the class files upon which the
|
---|
28 | root classes depend. This is typically used to create a jar with all of the
|
---|
29 | required classes for a particular application.
|
---|
30 | </p>
|
---|
31 | <p>
|
---|
32 | classfilesets are typically used by reference. They are declared with an
|
---|
33 | "id" value and this is then used as a reference where a normal fileset
|
---|
34 | is expected.
|
---|
35 | </p>
|
---|
36 | <p>
|
---|
37 | This 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
|
---|
43 | to 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>
|
---|
64 | When more than one root class is required, multiple nested <code><root></code> elements
|
---|
65 | may 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>
|
---|
82 | A root fileset is used to add a set of root classes from a fileset. In this case the entries in
|
---|
83 | the fileset are expected to be Java class files. The name of the Java class is determined by the
|
---|
84 | relative 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 | <classfileset id="reqdClasses" dir="${classes.dir}">
|
---|
91 | <root classname="org.apache.tools.ant.Project"/>
|
---|
92 | </classfileset>
|
---|
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
|
---|
97 | then be used to create a jar.
|
---|
98 | </p>
|
---|
99 |
|
---|
100 | <blockquote><pre>
|
---|
101 | <jar destfile="minimal.jar">
|
---|
102 | <fileset refid="reqdClasses"/>
|
---|
103 | </jar>
|
---|
104 | </pre></blockquote>
|
---|
105 |
|
---|
106 | <blockquote><pre>
|
---|
107 | <classfileset id="reqdClasses" dir="${classes.dir}">
|
---|
108 | <rootfileset dir="${classes.dir}" includes="org/apache/tools/ant/Project*.class"/>
|
---|
109 | </classfileset>
|
---|
110 | </pre></blockquote>
|
---|
111 |
|
---|
112 | <p>This example constructs the classfileset using all the class with names starting with Project
|
---|
113 | in the org.apache.tools.ant package</p>
|
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|
117 | </body>
|
---|
118 | </html>
|
---|
119 |
|
---|