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.

taskdef.html 1.9 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="taskdef">Taskdef</a></h2>
  8. <h3>Description</h3>
  9. <p>Adds a task definition to the current project, such that this new task can be
  10. used in the current project. Two attributes are needed, the name that identifies
  11. this task uniquely, and the full name of the class (including the packages) that
  12. implements this task.</p>
  13. <p>Taskdef should be used to add your own tasks to the system. See also &quot;<a
  14. href="../develop.html#writingowntask">Writing your own task</a>&quot;.</p>
  15. <h3>Parameters</h3>
  16. <table border="1" cellpadding="2" cellspacing="0">
  17. <tr>
  18. <td valign="top"><b>Attribute</b></td>
  19. <td valign="top"><b>Description</b></td>
  20. <td align="center" valign="top"><b>Required</b></td>
  21. </tr>
  22. <tr>
  23. <td valign="top">name</td>
  24. <td valign="top">the name of the task</td>
  25. <td valign="top" align="center">Yes</td>
  26. </tr>
  27. <tr>
  28. <td valign="top">classname</td>
  29. <td valign="top">the full class name implementing the task</td>
  30. <td valign="top" align="center">Yes</td>
  31. </tr>
  32. <tr>
  33. <td valign="top">classpath</td> <td valign="top">the classpath to
  34. use when looking up <code>classname</code>.</td> <td
  35. align="center" valign="top">No</td>
  36. </tr>
  37. </table>
  38. <h3>Parameters specified as nested elements</h3>
  39. <h4>classpath</h4>
  40. <p><code>Taskdef</code>'s <i>classpath</i> attribute is a <a
  41. href="../using.html#path">PATH like structure</a> and can also be set via a nested
  42. <i>classpath</i> element.</p>
  43. <h3>Examples</h3>
  44. <pre> &lt;taskdef name=&quot;myjavadoc&quot; classname=&quot;com.mydomain.JavadocTask&quot;/&gt;</pre>
  45. <p>makes a task called <code>myjavadoc</code> available to Ant. The class <code>com.mydomain.JavadocTask</code>
  46. implements the task.</p>
  47. <hr>
  48. <p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  49. Reserved.</p>
  50. </body>
  51. </html>