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.

bindtargets.html 3.2 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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>Bindtargets Task</title>
  20. </head>
  21. <body>
  22. <h2 id="ant">Bindtargets</h2>
  23. <p><em>Since Apache Ant 1.8.2</em></p>
  24. <h3>Description</h3>
  25. <p>Make some target the extension of some
  26. defined <a href="../targets.html#extension-points">extension point</a>. It will make the list of
  27. targets dependencies of the extension point.</p>
  28. <p>This target is useful when you want to have a target to participate in another build workflow
  29. which explicitly exposes an extension point for that kind of insertion. Thus the target to bind and
  30. the extension point to bind to are both declared in some imported build files. But directly
  31. modifying the target dependency graph of these external build files may have a side effect on some
  32. other project which imports them. This task helps to modify the target dependencies but only in your
  33. context.</p>
  34. <p><strong>Note</strong>: this task is quite equivalent to the definition of an intermediate target
  35. which will be the bridge between the target to bind and the extension point. For instance:</p>
  36. <pre>&lt;bindtargets targets="jar,javadoc" extensionPoint="dist"/&gt;</pre>
  37. <p>is quite equivalent to:</p>
  38. <pre>&lt;target name="bind-to-dist" depends="jar,javadoc" extensionOf="dist"/&gt;</pre>
  39. <p>This task basically avoids the creation of a target.</p>
  40. <p>The <code>bindtargets</code> task may only be used as a top-level task. This means that it may
  41. not be used in a target. This is making the target dependency graph static and predictable as soon
  42. as every build file is loaded.</p>
  43. <h3>Parameters</h3>
  44. <table class="attr">
  45. <tr>
  46. <th>Attribute</th>
  47. <th>Description</th>
  48. <th>Required</th>
  49. </tr>
  50. <tr>
  51. <td>targets</td>
  52. <td>a comma separated list of target names to bind.</td>
  53. <td>Yes</td>
  54. </tr>
  55. <tr>
  56. <td>extensionPoint</td>
  57. <td>the name of the extension point to bind the targets to.</td>
  58. <td>Yes</td>
  59. </tr>
  60. <tr>
  61. <td>onMissingExtensionPoint</td>
  62. <td>What to do if this target tries to extend a
  63. missing <a href="../targets.html#extension-points">extension-point</a>: <q>fail</q>, <q>warn</q>, <q>ignore</q>.</td>
  64. <td>No; defaults to <q>fail</q></td>
  65. </tr>
  66. </table>
  67. <h3>Examples</h3>
  68. <pre>&lt;bindtargets targets=&quot;build-jar,build-src-jar&quot; extensionPoint=&quot;dist&quot;/&gt;</pre>
  69. </body>
  70. </html>