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.

cab.html 5.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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>Cab Task</title>
  20. </head>
  21. <body>
  22. <h2 id="cab">Cab</h2>
  23. <h3>Description</h3>
  24. <p>The cab task creates Microsoft cabinet archive files. It is invoked similar to
  25. the <a href="../Tasks/jar.html">jar</a> or <a href="../Tasks/zip.html">zip</a> tasks. This task
  26. will work on Windows using the external <code>cabarc</code> tool (provided by Microsoft) which must
  27. be located in your executable path.</p>
  28. <p>To use this task on other platforms you need to download and compile <code>libcabinet</code>
  29. from <a href="https://www.freshports.org/archivers/libcabinet/">https://www.freshports.org/archivers/libcabinet/</a>.</p>
  30. <p>See the section on <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on
  31. how the inclusion/exclusion of files works, and how to write patterns.</p>
  32. <p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most
  33. attributes of <code>&lt;fileset&gt;</code> (<var>dir</var> becomes <var>basedir</var>) as well as
  34. the nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
  35. and <code>&lt;patternset&gt;</code> elements.</p>
  36. <h3>Parameters</h3>
  37. <table class="attr">
  38. <tr>
  39. <th>Attribute</th>
  40. <th>Description</th>
  41. <th>Required</th>
  42. </tr>
  43. <tr>
  44. <td>cabfile</td>
  45. <td>the name of the cab file to create.</td>
  46. <td>Yes</td>
  47. </tr>
  48. <tr>
  49. <td>basedir</td>
  50. <td>the directory to start archiving files from.</td>
  51. <td>No</td>
  52. </tr>
  53. <tr>
  54. <td>verbose</td>
  55. <td>set to <q>yes</q> if you want to see the output from the <code>cabarc</code> tool.</td>
  56. <td>No; defaults to <q>no</q></td>
  57. </tr>
  58. <tr>
  59. <td>compress</td>
  60. <td>set to <q>no</q> to store files without compressing.</td>
  61. <td>No; defaults to <q>yes</q></td>
  62. </tr>
  63. <tr>
  64. <td>options</td>
  65. <td>set additional command-line options for the <code>cabarc</code> tool. Should not
  66. normally be necessary.</td>
  67. <td>No</td>
  68. </tr>
  69. <tr>
  70. <td>includes</td>
  71. <td>comma- or space-separated list of patterns of files that must be included.</td>
  72. <td>No; defaults to all (<q>**</q>)</td>
  73. </tr>
  74. <tr>
  75. <td>includesfile</td>
  76. <td>name of a file. Each line of this file is taken to be an include pattern</td>
  77. <td>No</td>
  78. </tr>
  79. <tr>
  80. <td>excludes</td>
  81. <td>comma- or space-separated list of patterns of files that must be excluded.</td>
  82. <td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
  83. </tr>
  84. <tr>
  85. <td>excludesfile</td>
  86. <td>name of a file. Each line of this file is taken to be an exclude pattern</td>
  87. <td>No</td>
  88. </tr>
  89. <tr>
  90. <td>defaultexcludes</td>
  91. <td>indicates whether default excludes should be used or not (<q>yes|no</q>).</td>
  92. <td>No; defaults to <q>yes</q></td>
  93. </tr>
  94. </table>
  95. <h3>Parameters specified as nested elements</h3>
  96. <h4>fileset</h4>
  97. <p>The cab task supports one nested <a href="../Types/fileset.html"><code>&lt;fileset&gt;</code></a>
  98. element to specify the files to be included in the archive. If this is specified,
  99. the <var>basedir</var> attribute cannot be used.</p>
  100. <h3>Examples</h3>
  101. <pre>
  102. &lt;cab cabfile=&quot;${dist}/manual.cab&quot;
  103. basedir=&quot;htdocs/manual&quot;/&gt;</pre>
  104. <p>cabs all files in the <samp>htdocs/manual</samp> directory into a file
  105. called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory.</p>
  106. <pre>
  107. &lt;cab cabfile=&quot;${dist}/manual.cab&quot;
  108. basedir=&quot;htdocs/manual&quot;
  109. excludes=&quot;mydocs/**, **/todo.html&quot;/&gt;</pre>
  110. <p>cabs all files in the <samp>htdocs/manual</samp> directory into a file
  111. called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory. Files in the
  112. directory <samp>mydocs</samp>, or files with the name <samp>todo.html</samp> are excluded.</p>
  113. <pre>
  114. &lt;cab cabfile=&quot;${dist}/manual.cab&quot;
  115. basedir=&quot;htdocs/manual&quot;
  116. includes=&quot;api/**/*.html&quot;
  117. excludes=&quot;**/todo.html&quot;
  118. verbose=&quot;yes&quot;/&gt;</pre>
  119. <p>Cab all files in the <samp>htdocs/manual</samp> directory into a file
  120. called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory. Only <samp>.html</samp> files
  121. under the directory <samp>api</samp> are archived, and files with the name <samp>todo.html</samp>
  122. are excluded. Output from the <code>cabarc</code> tool is displayed in the build output.</p>
  123. <pre>
  124. &lt;cab cabfile=&quot;${dist}/manual.cab&quot;
  125. verbose=&quot;yes&quot;&gt;
  126. &lt;fileset
  127. dir=&quot;htdocs/manual&quot;
  128. includes=&quot;api/**/*.html&quot;
  129. excludes=&quot;**/todo.html&quot;/&gt;
  130. &lt;/cab&gt;</pre>
  131. <p>is equivalent to the example above.</p>
  132. </body>
  133. </html>