title: How to write dependsOn in Custom plugin
body: <p>I have a task in my build.gradle :</p>
  
  <pre><code>task makeJar(type: Copy) {
  delete('dist/')
  from('build/intermediates/bundles/release')
  into('dist/')
  include('classes.jar')
  def jarName = new VersionName().getNameWithVersion() + '.jar'  
  rename('classes.jar', jarName)
  }
  makeJar.dependsOn('clearTask', build)
  </code></pre>
  
  <p>Now, I want to remove this from my build.gradle and create a custom plugin like this : MakeJarTask.groovy  (this is in eclipse project)</p>
  
  <pre><code>class MakeJarPluginTask extends Copy{
  @TaskAction
  def makeJar(){
      logger.lifecycle("creating a jar *********************")
      delete('dist/')
      from('build/intermediates/bundles/release')
      into('dist/')
      include('classes.jar')
              def jarName = new VersionName().getNameWithVersion() + '.jar'
      rename('classes.jar', jarName)
   }
  </code></pre>
  
  <p>Calling this Task in callGroovy.class (that implements Plugin)</p>
  
  <pre><code>project.tasks.create("makeJarPlugin1", MakeJarPluginTask.class){
   dependsOn("clearDist", "build")
  }
  </code></pre>
  
  <p>But this doesn't give the correct output .
  The error is in last part, I think this is not the correct way to use dependsOn but I am not able to get how to use this. Any help will be highly appreciated.</p>