You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

classfileset.html 3.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>ClassFileSet Type</title>
  20. </head>
  21. <body>
  22. <h2 id="fileset">ClassFileSet</h2>
  23. <p>A classfileset is a specialized type of fileset which, given a set of &quot;root&quot;
  24. classes, will include all of the class files upon which the root classes depend. This is
  25. typically used to create a jar with all of the required classes for a particular application.
  26. </p>
  27. <p>
  28. classfilesets are typically used by reference. They are declared with an <var>id</var> value and
  29. this is then used as a reference where a normal fileset is expected.
  30. </p>
  31. <p>
  32. This type requires
  33. the <code>BCEL</code> <a href="../install.html#librarydependencies">library</a>.
  34. </p>
  35. <h3>Attributes</h3>
  36. <p>
  37. The class fileset support the following attributes in addition to those supported by
  38. the <a href="fileset.html">standard fileset</a>:
  39. </p>
  40. <table class="attr">
  41. <tr>
  42. <th>Attribute</th>
  43. <th>Description</th>
  44. <th>Required</th>
  45. </tr>
  46. <tr>
  47. <td>rootclass</td>
  48. <td>A single root class name</td>
  49. <td>No</td>
  50. </tr>
  51. </table>
  52. <h3>Nested elements</h3>
  53. <h4>Root</h4>
  54. <p>
  55. When more than one root class is required, multiple nested <code>&lt;root&gt;</code> elements
  56. may be used
  57. </p>
  58. <table class="attr">
  59. <tr>
  60. <th>Attribute</th>
  61. <th>Description</th>
  62. <th>Required</th>
  63. </tr>
  64. <tr>
  65. <td>classname</td>
  66. <td>The fully qualified name of the root class</td>
  67. <td>Yes</td>
  68. </tr>
  69. </table>
  70. <h4>RootFileSet</h4>
  71. <p>
  72. A root fileset is used to add a set of root classes from a fileset. In this case the entries in the
  73. fileset are expected to be Java class files. The name of the Java class is determined by the
  74. relative location of the classfile in the fileset. So, the
  75. file <code>org/apache/tools/ant/Project.class</code> corresponds to the Java
  76. class <code class="code">org.apache.tools.ant.Project</code>.</p>
  77. <h4>Examples</h4>
  78. <pre>
  79. &lt;classfileset id=&quot;reqdClasses" dir=&quot;${classes.dir}&quot;&gt;
  80. &lt;root classname=&quot;org.apache.tools.ant.Project&quot;/&gt;
  81. &lt;/classfileset&gt;</pre>
  82. <p>
  83. This example creates a fileset containing all the class files upon which
  84. the <code class="code">org.apache.tools.ant.Project</code> class depends. This fileset could then be
  85. used to create a jar.
  86. </p>
  87. <pre>
  88. &lt;jar destfile=&quot;minimal.jar&quot;&gt;
  89. &lt;fileset refid=&quot;reqdClasses&quot;/&gt;
  90. &lt;/jar&gt;</pre>
  91. <pre>
  92. &lt;classfileset id=&quot;reqdClasses&quot; dir=&quot;${classes.dir}&quot;&gt;
  93. &lt;rootfileset dir=&quot;${classes.dir}&quot; includes=&quot;org/apache/tools/ant/Project*.class&quot;/&gt;
  94. &lt;/classfileset&gt;</pre>
  95. <p>
  96. This example constructs the classfileset using all the class with names starting
  97. with <code class="code">Project</code> in the <code class="code">org.apache.tools.ant</code>
  98. package.
  99. </p>
  100. </body>
  101. </html>