title: Execute gradle tasks on sub projects in order
body: <p>we have a project structure such that</p>
  
  <pre><code>ParentProject
      projA
      projB
      projC
      projD
      ...
  </code></pre>
  
  <p>We have a bunch of tasks that we run on these projects from the parent project, calling <code>gradle clean build make tag push remove</code></p>
  
  <pre>
  clean: removes the build directory for each project
  build: compiles the source code
  make: uses the compiled code to create a docker image (custom task)
  tag: tags the docker image (custom task)
  push: pushes the tagged docker image to our nexus repo (custom task)
  remove: removes the local docker image (custom task)
  </pre>
  
  <p>all the tasks work as intended, but not exactly in the order we want.</p>
  
  <p>our issue is disk space. creating all the docker images (we have many to make) takes several gigabytes of space. Gradle fails because it runs out of disk space before reaching the end. We thought we could solve this issue by simply removing the image after it is pushed and free the disk space, but the way gradle runs, that does not work.</p>
  
  <p>Current, gradle executes in the following manner:</p>
  
  <pre><code>projA:clean
  projB:clean
  projC:clean
  ...
  projA:build
  projB:build
  projC:build
  ...
  projA:make
  projB:make
  projC:make
  ...
  </code></pre>
  
  <p>going through like this, everything tries to build before anything gets removed. The way we would like to run gradle is as follows:</p>
  
  <pre><code>projA:clean
  projA:build
  projA:make
  projA:tag
  projA:push
  projA:remove
  projB:clean
  projB:build
  projB:make
  projB:tag
  projB:push
  projB:remove
  ...
  </code></pre>
  
  <p>this way the project cleans itself up and frees disk space before the next project starts building.</p>
  
  <p>is there any way to do this?</p>
  
  <p>edit: There may be times where not every task needs to be run. The image may already built and simply needs to be retagged. Or may need to be built for local testing, but not tagged or pushed.</p>