Browse Source

Corrected example in "Writing your own task" to use <taskdef> as a

child of <project> instead of <target>.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267958 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
29217089f5
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      docs/index.html

+ 3
- 5
docs/index.html View File

@@ -4733,7 +4733,7 @@ public class MyVeryOwnTask extends Task {
<ol>
<li>Make sure the class that implements your task is in the classpath when
starting Ant.</li>
<li>In your initialization target, add a <i>taskdef</i> task. This actually adds
<li>Add a <i>taskdef</i> element to your project. This actually adds
your task to the system.</li>
<li>Use your task in the rest of the buildfile.</li>
</ol>
@@ -4742,11 +4742,9 @@ public class MyVeryOwnTask extends Task {
<pre>&lt;?xml version=&quot;1.0&quot;?&gt;

&lt;project name=&quot;OwnTaskExample&quot; default=&quot;main&quot; basedir=&quot;.&quot;&gt;
&lt;target name=&quot;init&quot;&gt;
&lt;taskdef name=&quot;mytask&quot; classname=&quot;com.mydomain.MyVeryOwnTask&quot;/&gt;
&lt;/target&gt;
&lt;taskdef name=&quot;mytask&quot; classname=&quot;com.mydomain.MyVeryOwnTask&quot;/&gt;

&lt;target name=&quot;main&quot; depends=&quot;init&quot;&gt;
&lt;target name=&quot;main&quot;&gt;
&lt;mytask message=&quot;Hello World! MyVeryOwnTask works!&quot; /&gt;
&lt;/target&gt;
&lt;/project&gt;


Loading…
Cancel
Save