title: Adding a custom ant task to custom_rules.xml in my Android project
body: <p>I want to add a task to the Ant script for my Android project in order to generate Javadocs from the source code. To do so, I have modified the <code>custom_rules.xml</code> file as</p>
  
  <pre><code>&lt;project name="bbct-android-common-tests-custom-rules" default="help"&gt;
      &lt;property name="javadoc.dir" value=""/&gt;
      &lt;task name="javadoc" description="Generate Javadocs"&gt;
          &lt;javadoc sourcedir="${src.dir}" destdir="${javadoc.dir}"/&gt;
      &lt;/task&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>And added the following line to <code>ant.properties</code>:</p>
  
  <pre><code>javadoc.dir=javadoc
  </code></pre>
  
  <p>Now when I run <code>ant javadoc</code>, I get the following error message:</p>
  
  <blockquote>
    <p>$ ant javadoc<br>
    Buildfile: e:\devel\src\java\bbct\android\common\test\build.xml</p>
    
    <p>BUILD FAILED<br>
    e:\devel\src\java\bbct\android\common\test\build.xml:69: The following error occurred while executing this line:<br>
    e:\devel\src\java\bbct\android\common\test\custom_rules.xml:22: Problem: failed to create task or type task<br>
    Cause: The name is undefined.<br>
    Action: Check the spelling.<br>
    Action: Check that any custom tasks/types have been declared.<br>
    Action: Check that any / declarations have taken place.  </p>
    
    <p>Total time: 0 seconds</p>
  </blockquote>
  
  <p>I also replaced my property values in the <code>&lt;javadoc&gt;</code> task and still get the same error.</p>
  
  <p>Also, my google search has been in vain. I have found several articles about building Javadocs from Eclipse and writing custom Ant scripts in general, just nothing about simply adding a task to the default script. Does anyone know where I can look to figure out what I need to do to fix this problem?</p>