title: tasks.setupAll.dependsOn(copyJars) does not work in gradle?
body: <p>I tried following the answer here</p>
  
  <p><a href="https://stackoverflow.com/questions/11128540/how-to-override-a-task-making-it-depend-on-one-of-mine-in-gradle">how to override a task making it depend on one of mine in gradle</a></p>
  
  <p>but it fails with</p>
  
  <blockquote>
    <p>Could not find property 'setupAll' on task set.</p>
  </blockquote>
  
  <p>I have tried a few things</p>
  
  <ol>
  <li>Make the task in subprojects section depend on master:copyJars but that fails</li>
  <li>The below solution</li>
  <li>stripped off the tasks which didn't work.</li>
  </ol>
  
  <p>I have only ONE build.gradle file and the settings.gradle file.  The settings gradle file is </p>
  
  <pre><code>include 'master', 'toneserver','webserver'
  </code></pre>
  
  <p>The master build.gradle file is(<strong>SPECIFICALLY, search for the two instances of setupAll as somehow there is something wrong with that</strong>)</p>
  
  <pre><code>//NOTE: Currently this file is for dependency management only but we would like
  // to convert all of the build to gradle from the ant files.  We needed to add dependency 
  // management so did so with gradle first as a first step in the process of evolution
  
  allprojects {
      apply plugin: 'java'
      apply plugin: 'eclipse'
  
      buildDir = 'output'
  
      task hello &lt;&lt; { task -&gt; println "I'm $task.project.name" }
      build &lt;&lt; { task -&gt; println "MASTER: I'm building now classpath=$sourceSets.main.compileClasspath.files" }
  }
  
  project(':toneserver') {
      dependencies {
          compile fileTree(dir: 'play-1.2.4/framework/lib', include: '*.jar')
          compile fileTree(dir: 'play-1.2.4/framework', include: '*.jar')
  
          compile project(':master')
          compile project(':webserver')
      }
  
      task eclipse(overwrite: true) {
      }
  
  }
  
  project(':webserver') {
      dependencies {
          compile fileTree(dir: 'play-1.2.4/framework/lib', include: '*.jar')
          compile fileTree(dir: 'play-1.2.4/framework', include: '*.jar')
  
          compile project(':master')
      }
  
      //playframework has it's own generation of .classpath and .project fils so do not 
      //overwrite their versions
      task eclipse(overwrite: true) {
      }
  }
  
  project(':master') {
      project.ext.genLibDir = file('lib')
      project.ext.fixedLibDir = file('libother')
  
      repositories {
           mavenCentral()
      }
  
      dependencies {
          compile group: 'org.hibernate',   name: 'hibernate-entitymanager', version: '4.1.4.Final'
          compile group: 'org.slf4j',       name: 'slf4j-api',               version: '1.6.6'
          compile group: 'org.slf4j',       name: 'log4j-over-slf4j',        version: '1.6.6'
          compile group: 'ch.qos.logback',  name: 'logback-core',            version: '1.0.6'
          compile group: 'joda-time',       name: 'joda-time',               version: '2.1'
          compile group: 'com.google.inject',name: 'guice',                  version: '3.0'
          compile group: 'com.google.protobuf',name: 'protobuf-java',        version: '2.4.1'
  
  
          //to be erased soon
          compile group: 'commons-configuration',name:'commons-configuration',version: '1.8'
          compile group: 'org.jboss.netty', name: 'netty',                   version: '3.2.7.Final'
  
          //compile group: 'org.asteriskjava',name: 'asterisk-java',         version: '1.0.0.M3'            
          compile fileTree(dir: project.ext.fixedLibDir, include: '*.jar')
      }
  
      task('copyJars') { 
          ext.collection = files { genLibDir.listFiles() }
          delete ext.collection
          copy { from configurations.compile into genLibDir }
          copy { from fixedLibDir into genLibDir }
      }
  
          tasks.setupAll.dependsOn(copyJars)
  }
  
  subprojects {
      version = 'Developer-Build'
  
      //configurations.compile {
      //  exclude group: 'javax.jms',        module: 'jms'
      //  exclude group: 'com.sun.jdmk',     module: 'jmxtools'
      //  exclude group: 'com.sun.jmx',      module: 'jmxri'
      //}
  
      task('setupAll', dependsOn: ['eclipse']) {
          description = 'Update jars from remote repositories and then fix eclipse classpath for master project'
  
      }
  
      hello &lt;&lt; {println "- I depend on stserver"}
  
      build &lt;&lt; { println "subproject:source sets=$sourceSets.main.java.srcDirs" }
  }
  
  task release &lt;&lt; { println "putting together release" }
  
  //TODO: have a release task AND if version is null when running the release task
  //throw an exception telling the user to pass in a version with "./build -Dversion=xxxx"
  //The automated build will call the release task with a version number like that
  gradle.taskGraph.whenReady {taskGraph -&gt;
      if (taskGraph.hasTask(release) &amp;&amp; version == 'Developer-Build') {
          throw new StopExecutionException("You must specify -Dversion=&lt;some version&gt; to run the release task")
      } else {
          version = '1.0-SNAPSHOT'
      }
  }
  </code></pre>
  
  <p>What is going on with this?  Overriding tasks to depend on other stuff should work pretty easily I though(maybe that syntax is still wrong?)</p>
  
  <p>thanks,
  Dean</p>