title: Android Studio - gradle task to execute after SYNC
body: <p>Is there a way to execute gradle task once after project Sync with Gradle files is complete?</p>
  
  <p>I've tried to set task dependency to preBuild, as I've seen <code>gradle:build</code> is triggered when Sync is executing. But the problem is that dependency doesn't seem to work, task is not executed and I have to manually start the task after each Sync.</p>
  
  <p>This is basically what I've tried so far</p>
  
  <pre><code>apply plugin: 'com.android.library'
  ...
  
  task myTask {
      ...
  }
  gradle.projectsEvaluated {
      preBuild.dependsOn(myTask)
  }
  </code></pre>
  
  <p>I've also tried to set task dependency to other tasks that I see are triggered (:generate{Something}), but that wasn't successful either.</p>
  
  <p>Is there anything I can to do force the gradle task to be executed after each Sync?
  I'm using Gradle 2.2.1 + Android Studio 1.0.2</p>