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

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