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.

apply.html 21 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  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>Apply Task</title>
  20. </head>
  21. <body>
  22. <h2><a name="apply">Apply/<i>ExecOn</i></a></h2>
  23. <p><i>The name <code>execon</code> is deprecated and only kept for backwards
  24. compatibility.</i></p>
  25. <h3>Description</h3>
  26. <p>Executes a system command. When the <i>os</i> attribute is specified, then
  27. the command is only executed when Apache Ant is run on one of the specified operating
  28. systems.</p>
  29. <p>The files and/or directories of a number of <a
  30. href="../Types/resources.html#collection">Resource Collection</a>s
  31. &ndash; including but not restricted to
  32. <a href="../Types/fileset.html">FileSet</a>s,
  33. <a href="../Types/dirset.html">DirSet</a>s
  34. (<em>since&nbsp;Ant&nbsp;1.6</em>) or
  35. <a href="../Types/filelist.html">FileList</a>s
  36. (<em>since&nbsp;Ant&nbsp;1.6</em>)
  37. &ndash;
  38. are passed as arguments to the system command.</p>
  39. <p>If you specify a nested <a href="../Types/mapper.html">mapper</a>,
  40. the timestamp of each source file is compared to the timestamp of a
  41. target file which is defined by the nested mapper element and searched
  42. for in the given <i>dest</i>, if specified.</p>
  43. <p>At least one fileset or filelist is required,
  44. and you must not specify more than one mapper.</p>
  45. <p>Note that you cannot interact with the forked program, the only way
  46. to send input to it is via the input and inputstring attributes.</p>
  47. <h4><a name="background">Running Ant as a background process on
  48. Unix(-like) systems</a></h4>
  49. <p>If you run Ant as a background process (like <code>ant &</code>)
  50. and use the <code>&lt;apply&gt;</code> task with <code>spawn</code>
  51. set to <code>false</code>, you must provide explicit input to the
  52. forked process or Ant will be suspended because it tries to read
  53. from the standard input.</p>
  54. <h3>Parameters</h3>
  55. <table border="1" cellpadding="2" cellspacing="0">
  56. <tr>
  57. <td valign="top"><b>Attribute</b></td>
  58. <td valign="top"><b>Description</b></td>
  59. <td align="center" valign="top"><b>Required</b></td>
  60. </tr>
  61. <tr>
  62. <td valign="top">executable</td>
  63. <td valign="top">the command to execute without any command line
  64. arguments.</td>
  65. <td align="center" valign="top">Yes</td>
  66. </tr>
  67. <tr>
  68. <td valign="top">dest</td>
  69. <td valign="top">the directory where the command is expected to place
  70. target files when it is executed. This attribute is valid only when used
  71. in conjunction with a nested mapper; if omitted, the target filenames
  72. returned by the mapper will be interpreted as absolute paths.</td>
  73. <td align="center" valign="top">No</td>
  74. </tr>
  75. <tr>
  76. <td valign="top">spawn</td>
  77. <td valign="top">whether or not you want the commands to be spawned.<br>
  78. If you spawn a command, its output will not be logged by ant.<br>
  79. The input, output, error, and result property settings are not active when spawning a process.<br>
  80. <em>since&nbsp;Ant&nbsp;1.6</em>
  81. </td>
  82. <td align="center" valign="top">No, default is <i>false</i></td>
  83. </tr>
  84. <tr>
  85. <td valign="top">dir</td>
  86. <td valign="top">the directory in which the command should be executed.</td>
  87. <td align="center" valign="top">No.<br/>
  88. <strong>Note:</strong> the default used when dir has not been
  89. specified depends on the <code>vmlauncher</code> attribute. If
  90. <code>vmlauncher</code> is <code>true</code> the task will use
  91. the current working directory, otherwise it uses the project's basedir.
  92. </td>
  93. </tr>
  94. <tr>
  95. <td valign="top">relative</td>
  96. <td valign="top">whether the filenames should be passed on the
  97. command line as relative pathnames (relative to the base directory
  98. of the corresponding fileset/list for source files or the
  99. <i>dest</i> attribute for target files).</td>
  100. <td align="center" valign="top">No, default is <i>false</i></td>
  101. </tr>
  102. <tr>
  103. <td valign="top">forwardslash</td>
  104. <td valign="top">whether the file names should be passed
  105. with forward slashes even if the operating system requires other
  106. file separator. The option is ignored if the system file separator
  107. is a forward slash.</td>
  108. <td align="center" valign="top">No, default is <i>false</i></td>
  109. </tr>
  110. <tr>
  111. <td valign="top">os</td>
  112. <td valign="top">list of Operating Systems on which the command may be
  113. executed.</td>
  114. <td align="center" valign="top">No</td>
  115. </tr>
  116. <tr>
  117. <td valign="top">osfamily</td>
  118. <td valign="top">OS family as used in the &lt;os&gt; condition.
  119. <em>since Ant 1.7</em></td>
  120. <td align="center" valign="top">No</td>
  121. </tr>
  122. <tr>
  123. <td valign="top">output</td>
  124. <td valign="top">the file to which the output of the command
  125. should be redirected. If the error stream is not also redirected
  126. to a file or property, it will appear in this output.</td>
  127. <td align="center" valign="top">No</td>
  128. </tr>
  129. <tr>
  130. <td valign="top">error</td>
  131. <td valign="top">The file to which the standard error of the
  132. command should be redirected. <em>since&nbsp;Ant&nbsp;1.6</em></td>
  133. <td align="center" valign="top">No</td>
  134. </tr>
  135. <tr>
  136. <td valign="top">logError</td>
  137. <td valign="top">This attribute is used when you wish to see error
  138. output in Ant's log and you are redirecting output to a
  139. file/property. The error output will not be included in the output
  140. file/property. If you redirect error with the &quot;error&quot; or
  141. &quot;errorProperty&quot; attributes, this will have no effect.
  142. <em>since&nbsp;Ant&nbsp;1.6</em></td>
  143. <td align="center" valign="top">No</td>
  144. </tr>
  145. <tr>
  146. <td valign="top">append</td>
  147. <td valign="top">whether output should be appended to or overwrite
  148. an existing file. If you set parallel to false, you will probably
  149. want to set this one to true.</td>
  150. <td align="center" valign="top">No, default is <i>false</i></td>
  151. </tr>
  152. <tr>
  153. <td valign="top">outputproperty</td>
  154. <td valign="top">the name of a property in which the output of the
  155. command should be stored. Unless the error stream is redirected
  156. to a separate file or stream, this property will include the error
  157. output.</td>
  158. <td align="center" valign="top">No</td>
  159. </tr>
  160. <tr>
  161. <td valign="top">errorproperty</td>
  162. <td valign="top">The name of a property in which the standard error of the
  163. command should be stored. <em>since&nbsp;Ant&nbsp;1.6</em></td>
  164. <td align="center" valign="top">No</td>
  165. </tr>
  166. <tr>
  167. <td valign="top">input</td>
  168. <td valign="top">A file from which the executed command's standard
  169. input is taken. This attribute is mutually exclusive with the
  170. inputstring attribute. <em>since&nbsp;Ant&nbsp;1.6</em></td>
  171. <td align="center" valign="top">No</td>
  172. </tr>
  173. <tr>
  174. <td valign="top">inputstring</td>
  175. <td valign="top">A string which serves as the input stream for the
  176. executed command. This attribute is mutually exclusive with the
  177. input attribute. <em>since&nbsp;Ant&nbsp;1.6</em></td>
  178. <td align="center" valign="top">No</td>
  179. </tr>
  180. <tr>
  181. <td valign="top">resultproperty</td>
  182. <td valign="top">the name of a property in which the return code
  183. of the command should be stored. Only of interest if
  184. failonerror=false. If you set parallel to false, only the result
  185. of the first execution will be stored.</td>
  186. <td align="center" valign="top">No</td>
  187. </tr>
  188. <tr>
  189. <td valign="top">timeout</td>
  190. <td valign="top">Stop the command if it doesn't finish within the
  191. specified time (given in milliseconds).</td>
  192. <td align="center" valign="top">No</td>
  193. </tr>
  194. <tr>
  195. <td valign="top">failonerror</td>
  196. <td valign="top">Stop the buildprocess if the command exits with a
  197. returncode other than 0.</td>
  198. <td align="center" valign="top">No</td>
  199. </tr>
  200. <tr>
  201. <td valign="top">failifexecutionfails</td>
  202. <td valign="top">Stop the build if we can't start the program.
  203. Defaults to true. </td>
  204. <td align="center" valign="top">No</td>
  205. </tr>
  206. <tr>
  207. <td valign="top">skipemptyfilesets</td>
  208. <td valign="top">Don't run the command, if no source files have
  209. been found or are newer than their corresponding target
  210. files. Despite its name, this attribute applies to filelists as
  211. well.</td>
  212. <td align="center" valign="top">No, default is <i>false</i></td>
  213. </tr>
  214. <tr>
  215. <td valign="top">parallel</td>
  216. <td valign="top">Run the command only once, appending all files as
  217. arguments. If false, command will be executed once for every file.</td>
  218. <td align="center" valign="top">No, default is <i>false</i></td>
  219. </tr>
  220. <tr>
  221. <td valign="top">type</td>
  222. <td valign="top">One of <i>file</i>, <i>dir</i> or
  223. <i>both</i>. If set to <i>file</i>, only the names of plain
  224. files will be sent to the command. If set to <i>dir</i>, only
  225. the names of directories are considered.<br>
  226. <strong>Note:</strong> The type attribute does not apply to
  227. nested <i>dirset</i>s - <i>dirset</i>s always implicitly
  228. assume type to be <i>dir</i>.</td>
  229. <td align="center" valign="top">No, default is <i>file</i></td>
  230. </tr>
  231. <tr>
  232. <td valign="top">newenvironment</td>
  233. <td valign="top">Do not propagate old environment when new environment
  234. variables are specified.</td>
  235. <td align="center" valign="top">No, default is <i>false</i></td>
  236. </tr>
  237. <tr>
  238. <td valign="top">vmlauncher</td>
  239. <td valign="top">Run command using the Java VM's execution facilities
  240. where available. If set to false the underlying OS's shell,
  241. either directly or through the antRun scripts, will be used.
  242. Under some operating systems, this gives access to facilities
  243. not normally available through the VM including, under Windows,
  244. being able to execute scripts, rather than their associated
  245. interpreter. If you want to specify the name of the
  246. executable as a relative path to the directory given by the
  247. dir attribute, it may become necessary to set vmlauncher to
  248. false as well.</td>
  249. <td align="center" valign="top">No, default is <i>true</i></td>
  250. </tr>
  251. <tr>
  252. <td valign="top">resolveExecutable</td>
  253. <td valign="top">When this attribute is true, the name of the
  254. executable if resolved firstly against the project basedir and if
  255. that does not exist, against the execution directory if
  256. specified. On Unix systems, if you only want to allow execution of
  257. commands in the user's path, set this to false.
  258. <em>since&nbsp;Ant&nbsp;1.6</em></td>
  259. <td align="center" valign="top">No, default is <i>false</i></td>
  260. </tr>
  261. <tr>
  262. <td valign="top">maxparallel</td>
  263. <td valign="top">Limit the amount of parallelism by passing at
  264. most this many sourcefiles at once. Set it to &lt;= 0 for
  265. unlimited. <em>Since&nbsp;Ant&nbsp;1.6.</em></td>
  266. <td align="center" valign="top">No, unlimited by default</td>
  267. </tr>
  268. <tr>
  269. <td valign="top">addsourcefile</td>
  270. <td valign="top">Whether source file names should be added to the
  271. command automatically. <em>Since&nbsp;Ant&nbsp;1.6.</em></td>
  272. <td align="center" valign="top">No, default is <i>true</i></td>
  273. </tr>
  274. <tr>
  275. <td valign="top">verbose</td>
  276. <td valign="top">Whether to print a summary after execution or not.
  277. <em>Since&nbsp;Ant&nbsp;1.6.</em></td>
  278. <td align="center" valign="top">No, default <i>false</i></td>
  279. </tr>
  280. <tr>
  281. <td valign="top">ignoremissing</td>
  282. <td valign="top">Whether to ignore nonexistent files specified
  283. via filelists. <em>Since&nbsp;Ant&nbsp;1.6.2.</em></td>
  284. <td align="center" valign="top">No, default is <i>true</i></td>
  285. </tr>
  286. <tr>
  287. <td valign="top">force</td>
  288. <td valign="top">Whether to bypass timestamp comparisons
  289. for target files. <em>Since&nbsp;Ant&nbsp;1.6.3.</em></td>
  290. <td align="center" valign="top">No, default is <i>false</i></td>
  291. </tr>
  292. </table>
  293. <h3>Parameters specified as nested elements</h3>
  294. <h4>fileset</h4>
  295. <p>You can use any number of nested <code>&lt;fileset&gt;</code>
  296. elements to define the files for this task and refer to
  297. <code>&lt;fileset&gt;</code>s defined elsewhere.</p>
  298. <h4>filelist</h4>
  299. <p><em>Since&nbsp;Ant&nbsp;1.6</em></p>
  300. <p>You can use any number of nested <code>&lt;filelist&gt;</code>
  301. elements to define the files for this task and refer to
  302. <code>&lt;filelist&gt;</code>s defined elsewhere.</p>
  303. <h4>dirset</h4>
  304. <p><em>Since&nbsp;Ant&nbsp;1.6</em></p>
  305. <p>You can use any number of nested <code>&lt;dirset&gt;</code>
  306. elements to define the directories for this task and refer to
  307. <code>&lt;dirset&gt;</code>s defined elsewhere.</p>
  308. <h4>Any other <a href="../Types/resources.html#collection">Resource
  309. Collection</a></h4>
  310. <p><em>since Ant 1.7</em></p>
  311. <p>You can use any number of nested resource collections.</p>
  312. <h4>mapper</h4>
  313. <p>A single <code>&lt;mapper&gt;</code> specifies the target files relative
  314. to the <code>dest</code> attribute for dependency checking. If the
  315. <code>dest</code> attribute is specified it will be used as a base directory
  316. for resolving relative pathnames returned by the mapper. At least one
  317. <code>&lt;fileset&gt;</code> or <code>&lt;filelist&gt;</code> is required.</p>
  318. <h4>arg</h4>
  319. <p>Command line arguments should be specified as nested
  320. <code>&lt;arg&gt;</code> elements. See <a
  321. href="../using.html#arg">Command line arguments</a>.</p>
  322. <h4>srcfile</h4>
  323. <p>By default the file names of the source files will be added to the
  324. end of the command line (unless you set addsourcefile to
  325. <code>false</code>). If you need to place it somewhere different,
  326. use a nested <code>&lt;srcfile&gt;</code> element between your
  327. <code>&lt;arg&gt;</code> elements to mark the insertion point.</p>
  328. <table border="1" cellpadding="2" cellspacing="0">
  329. <tr>
  330. <td valign="top"><b>Attribute</b></td>
  331. <td valign="top"><b>Description</b></td>
  332. <td align="center" valign="top"><b>Required</b></td>
  333. </tr>
  334. <tr>
  335. <td valign="top">prefix</td>
  336. <td valign="top">a prefix to place in front of the file name when
  337. building the command line argument. <em>Since Ant 1.8.0</em></td>
  338. <td align="center" valign="top">No.</td>
  339. </tr>
  340. <tr>
  341. <td valign="top">suffix</td>
  342. <td valign="top">a suffix to append to the file name when
  343. building the command line argument. <em>Since Ant 1.8.0</em></td>
  344. <td align="center" valign="top">No.</td>
  345. </tr>
  346. </table>
  347. <h4>targetfile</h4>
  348. <p><code>&lt;targetfile&gt;</code> is similar to
  349. <code>&lt;srcfile&gt;</code> and marks the position of the target
  350. filename on the command line. If omitted, the target filenames will
  351. not be added to the command line at all. This element can only be
  352. specified if you also define a nested mapper.</p>
  353. <table border="1" cellpadding="2" cellspacing="0">
  354. <tr>
  355. <td valign="top"><b>Attribute</b></td>
  356. <td valign="top"><b>Description</b></td>
  357. <td align="center" valign="top"><b>Required</b></td>
  358. </tr>
  359. <tr>
  360. <td valign="top">prefix</td>
  361. <td valign="top">a prefix to place in front of the file name when
  362. building the command line argument. <em>Since Ant 1.8.0</em></td>
  363. <td align="center" valign="top">No.</td>
  364. </tr>
  365. <tr>
  366. <td valign="top">suffix</td>
  367. <td valign="top">a suffix to append to the file name when
  368. building the command line argument. <em>Since Ant 1.8.0</em></td>
  369. <td align="center" valign="top">No.</td>
  370. </tr>
  371. </table>
  372. <h4>env</h4>
  373. <p>It is possible to specify environment variables to pass to the
  374. system command via nested <code>&lt;env&gt;</code> elements. See the
  375. description in the section about <a href="exec.html#env">exec</a></p>
  376. <h4>redirector</h4>
  377. <i><b>Since&nbsp;Ant&nbsp;1.6.2</b></i>
  378. <p>A nested <a href="../Types/redirector.html">I/O Redirector</a>
  379. can be specified. &lt;apply&gt;'s behavior is like that of
  380. <a href="exec.html#redirector">exec</a> with regard to
  381. redirectors, with the exception that, in non-<i>parallel</i> mode,
  382. file mapping will take place with each iteration. This grants the
  383. user the capacity to receive input from, and send output to, different
  384. files for each sourcefile.
  385. </p>
  386. <p>In <i>parallel</i>-mode the redirector will be reset for each batch
  387. of executions (with <i>maxparallel</i> &gt; 0) and null will be used
  388. a source file just like it is in the case of <code>exec</code>.</p>
  389. <h3>Examples</h3>
  390. <blockquote><pre>
  391. &lt;apply executable=&quot;ls&quot;&gt;
  392. &lt;arg value=&quot;-l&quot;/&gt;
  393. &lt;fileset dir=&quot;/tmp&quot;&gt;
  394. &lt;patternset&gt;
  395. &lt;exclude name=&quot;**/*.txt&quot;/&gt;
  396. &lt;/patternset&gt;
  397. &lt;/fileset&gt;
  398. &lt;fileset refid=&quot;other.files&quot;/&gt;
  399. &lt;/apply&gt;
  400. </pre></blockquote>
  401. <p>invokes <code>ls -l</code>, adding the absolute filenames of all
  402. files below <code>/tmp</code> not ending in <code>.txt</code> and all
  403. files of the FileSet with <code>id</code> <code>other.files</code> to
  404. the command line.</p>
  405. <blockquote><pre>
  406. &lt;apply executable=&quot;somecommand&quot; parallel=&quot;false&quot;&gt;
  407. &lt;arg value=&quot;arg1&quot;/&gt;
  408. &lt;srcfile/&gt;
  409. &lt;arg value=&quot;arg2&quot;/&gt;
  410. &lt;fileset dir=&quot;/tmp&quot;/&gt;
  411. &lt;/apply&gt;
  412. </pre></blockquote>
  413. <p>invokes <code>somecommand arg1 SOURCEFILENAME arg2</code> for each
  414. file in <code>/tmp</code> replacing SOURCEFILENAME with the absolute
  415. filename of each file in turn. If <code>parallel</code> had been set
  416. to true, SOURCEFILENAME would be replaced with the absolute filenames
  417. of all files separated by spaces.</p>
  418. <blockquote><pre>
  419. &lt;apply executable=&quot;cc&quot; dest=&quot;src/C&quot; parallel=&quot;false&quot;&gt;
  420. &lt;arg value=&quot;-c&quot;/&gt;
  421. &lt;arg value=&quot;-o&quot;/&gt;
  422. &lt;targetfile/&gt;
  423. &lt;srcfile/&gt;
  424. &lt;fileset dir=&quot;src/C&quot; includes=&quot;*.c&quot;/&gt;
  425. &lt;mapper type=&quot;glob&quot; from=&quot;*.c&quot; to=&quot;*.o&quot;/&gt;
  426. &lt;/apply&gt;
  427. </pre></blockquote>
  428. <p>invokes <code>cc -c -o TARGETFILE SOURCEFILE</code> for each
  429. <code>.c</code> file that is newer than the corresponding
  430. <code>.o</code>, replacing TARGETFILE with the absolute filename of
  431. the <code>.o</code> and SOURCEFILE with the absolute name of the
  432. <code>.c</code> file.</p>
  433. <blockquote><pre>
  434. &lt;mapper id=&quot;out&quot; type=&quot;glob&quot;
  435. from=&quot;src${file.separator}*.file&quot;
  436. to=&quot;dest${file.separator}*.out&quot;/&gt;
  437. &lt;apply executable=&quot;processfile&quot; dest=&quot;dest&quot;&gt;
  438. &lt;fileset dir=&quot;src&quot; includes=&quot;*.file&quot;/&gt;
  439. &lt;mapper refid=&quot;out&quot;/&gt;
  440. &lt;redirector&gt;
  441. &lt;outputmapper refid=&quot;out&quot;/&gt;
  442. &lt;/redirector&gt;
  443. &lt;/apply&gt;
  444. </pre></blockquote>
  445. Applies the fictitious &quot;processfile&quot; executable to all
  446. files matching <code>*.file</code> in the <code>src</code> directory.
  447. The <code>out</code> <code>&lt;mapper&gt;</code> has been set up to map
  448. <code>*.file</code> to <code>*.out</code>, then this <code>&lt;mapper&gt;</code>
  449. is used to specify <code>targetfile</code>s for this &lt;apply&gt;
  450. task. A reference to <code>out</code> is then used as an
  451. <code>&lt;outputmapper&gt;</code> nested in a <code>&lt;redirector&gt;</code>, which in turn is
  452. nested beneath this <code>&lt;apply&gt;</code> instance. This allows us to perform
  453. dependency checking against output files--the target files in this case.
  454. <blockquote><pre>
  455. &lt;apply executable="ls" parallel="true"
  456. force="true" dest="${basedir}" append="true" type="both"&gt;
  457. &lt;path&gt;
  458. &lt;pathelement path="${env.PATH}"/&gt;
  459. &lt;/path&gt;
  460. &lt;identitymapper/&gt;
  461. &lt;/apply&gt;
  462. </pre></blockquote>
  463. Applies the "ls" executable to all directories in the PATH, effectively
  464. listing all executables that are available on the PATH.
  465. <blockquote><pre>
  466. &lt;apply executable="jsmin" addsourcefile="false"&gt;
  467. &lt;!-- Collect the JS-files --&gt;
  468. &lt;fileset dir="src" includes="*.js"/&gt;
  469. &lt;redirector&gt;
  470. &lt;!-- redirect STDIN; fileset collects relative to its dir, but we need --&gt;
  471. &lt;!-- relative to basedir --&gt;
  472. &lt;inputmapper type="glob" from="*" to="src/*"/&gt;
  473. &lt;!-- redirect STDOUT to file in dest-dir --&gt;
  474. &lt;outputmapper id="out" type="glob" from="*.js" to="dest/*.js"/&gt;
  475. &lt;/redirector&gt;
  476. &lt;/apply&gt;
  477. </pre></blockquote>
  478. Conversion of the command <code>jsmin &lt; src/a.js &gt; dest/a.js</code> but for
  479. all files in the src-directory. Because the filename itself should not be passed
  480. to the <code>jsmin</code> program, the <code>addsourcefile</code> is set to
  481. <code>false</code>.
  482. </body>
  483. </html>