title: Gradle batch task that invokes subproject and other tasks in order
body: <p>I am writing gradle 1.4 build file for multimodule project. So there is root <strong>build.gradle</strong> that defines something like:</p>
  
  <pre><code>subprojects {
      apply plugin: 'java'
      ...
  </code></pre>
  
  <p>which defines <strong>build</strong> task for all submodules. Submodules are included in <strong>settings.gradle</strong> and each module has its build file with defined dependencies.</p>
  
  <p>Everything by-the-book, so far:) Now, in the main build file I've added some additional project-scope tasks, like: <em>aggregateJavadoc</em> (collects all javadocs into one) or <em>bundleJar</em> (creates bundle jar from all classes), etc. Each on works when invoked manually.</p>
  
  <p>Now I need a task <strong>release</strong> that will</p>
  
  <ul>
  <li><p>build all submodules (as invoked from command line - meaning, i dont want to manually write execute() for each submodule)</p></li>
  <li><p>invoke additional tasks (using execute() I presume).</p></li>
  </ul>
  
  <p>I tried <strong>dependsOn</strong> but the order of listed tasks is not followed. Also, dependent modules seems to be executed after release task execution. I tried several other ideas and failed.</p>
  
  <p>Question: what would be the best way to create such <em>batch task</em>, that has to invoke something on all submodules and additionally to perform some more tasks? What would be the best gradle-friendly solution? Thanx!</p>