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.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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><a name="fileset">ClassFileSet</a></h2>
  23. <p>A classfileset is a specialized type of fileset which, given a set of
  24. &quot;root&quot; classes, will include all of the class files upon which the
  25. root classes depend. This is typically used to create a jar with all of the
  26. required classes for a particular application.
  27. </p>
  28. <p>
  29. classfilesets are typically used by reference. They are declared with an
  30. &quot;id&quot; value and this is then used as a reference where a normal fileset
  31. is expected.
  32. </p>
  33. <p>
  34. This type requires the <code>BCEL</code> library.
  35. </p>
  36. <h3>Attributes</h3>
  37. <p>The class fileset support the following attributes in addition
  38. to those supported by the
  39. <a href="../Types/fileset.html">standard fileset</a>:
  40. </p>
  41. <table border="1" cellpadding="2" cellspacing="0">
  42. <tr>
  43. <td valign="top"><b>Attribute</b></td>
  44. <td valign="top"><b>Description</b></td>
  45. <td align="center" valign="top"><b>Required</b></td>
  46. </tr>
  47. <tr>
  48. <td valign="top">rootclass</td>
  49. <td valign="top">A single root class name</td>
  50. <td valign="top" align="center">No</td>
  51. </tr>
  52. </table>
  53. <h3>Nested Elements</h3>
  54. <h4>Root</h4>
  55. <p>
  56. When more than one root class is required, multiple nested <code>&lt;root&gt;</code> elements
  57. may be used
  58. </p>
  59. <table border="1" cellpadding="2" cellspacing="0">
  60. <tr>
  61. <td valign="top"><b>Attribute</b></td>
  62. <td valign="top"><b>Description</b></td>
  63. <td align="center" valign="top"><b>Required</b></td>
  64. </tr>
  65. <tr>
  66. <td valign="top">classname</td>
  67. <td valign="top">The fully qualified name of the root class</td>
  68. <td align="center" valign="top">Yes</td>
  69. </tr>
  70. </table>
  71. <h4>RootFileSet</h4>
  72. <p>
  73. A root fileset is used to add a set of root classes from a fileset. In this case the entries in
  74. the fileset are expected to be Java class files. The name of the Java class is determined by the
  75. relative location of the classfile in the fileset. So, the file
  76. <code>org/apache/tools/ant/Project.class</code> corresponds to the Java class
  77. <code>org.apache.tools.ant.Project</code>.</p>
  78. <h4>Examples</h4>
  79. <blockquote><pre>
  80. &lt;classfileset id=&quot;reqdClasses" dir=&quot;${classes.dir}&quot;&gt;
  81. &lt;root classname=&quot;org.apache.tools.ant.Project&quot;/&gt;
  82. &lt;/classfileset&gt;
  83. </pre></blockquote>
  84. <p>This example creates a fileset containing all the class files upon which the
  85. <code>org.apache.tools.ant.Project</code> class depends. This fileset could
  86. then be used to create a jar.
  87. </p>
  88. <blockquote><pre>
  89. &lt;jar destfile=&quot;minimal.jar&quot;&gt;
  90. &lt;fileset refid=&quot;reqdClasses&quot;/&gt;
  91. &lt;/jar&gt;
  92. </pre></blockquote>
  93. <blockquote><pre>
  94. &lt;classfileset id=&quot;reqdClasses&quot; dir=&quot;${classes.dir}&quot;&gt;
  95. &lt;rootfileset dir=&quot;${classes.dir}&quot; includes=&quot;org/apache/tools/ant/Project*.class&quot;/&gt;
  96. &lt;/classfileset&gt;
  97. </pre></blockquote>
  98. <p>This example constructs the classfileset using all the class with names starting with Project
  99. in the org.apache.tools.ant package</p>
  100. </body>
  101. </html>