title: How to set Gradle custom ant task classpath?
body: <p>I have a custom Ant task in my codebase that I need to use from Gradle. There are plenty of examples of how to use a task that is packaged in a jar file, but this is different. </p>
  
  <p>My <code>taskdef</code> should look something like:</p>
  
  <pre><code>ant.taskdef(
      name: 'generator',
      classname: 'MyGenerator', 
      classpath: ???
  )
  </code></pre>
  
  <p>The <code>classpath</code> should include everything in <code>bin/</code> (where my code gets compiled to) <strong>and</strong> all the jars listed in the <code>dependencies</code> section of the build script. How to fill in the blank?</p>
  
  <p>I've tried a few different things, resulting in either obscure messages like <code>The &lt;taskdef&gt; type doesn't support nested text data</code> or typical <code>NoClassDefFoundError</code>.</p>