title: gradle custom task order on Android
body: <p>I have 2 gradle tasks that i want to run after <code>assembleRelease</code> task.</p>
  
  <pre><code>task copyRequiredFilesToVersionControl(type:Copy) {
    ...
  }
  
  task ('versionControl') &lt;&lt; {
    ...
  }
  </code></pre>
  
  <p>If I configure order for these tasks as below tasks get never called...</p>
  
  <pre><code>copyRequiredFilesToVersionControl.dependsOn(assembleRelease)
  versionControl.dependsOn(copyRequiredFilesToVersionControl)
  </code></pre>
  
  <p>If i change order like; </p>
  
  <pre><code>assembleRelease.dependsOn(copyRequiredFilesToVersionControl)
  versionControl.dependsOn(copyRequiredFilesToVersionControl)
  </code></pre>
  
  <p>Tasks are run at the beginning of document. So there is no file to copy and add to version control.</p>
  
  <p>What is the best approach?</p>