title: Execute task after another task
body: <p>I have created a separate source set which depends on main source set:</p>
  
  <pre><code>sourceSets {
     customSrc {
        output.classesDir = main.output.classesDir
        output.resourcesDir = main.output.resourcesDir
        compileClasspath += main.output
     }
  }
  </code></pre>
  
  <p>now I want to compile this source set whenever main source set compiles, so when <code>gradle compile</code> is invoked my source set is also compiled.</p>
  
  <p>I can simply add dependency to <code>build</code> task like that:</p>
  
  <pre><code>build.dependsOn customSrcClasses
  </code></pre>
  
  <p>but that is unreliable, someone can call just <code>classes</code> task and custom source set will not compile.</p>
  
  <p>How can I achieve it?</p>