title: How to depend on all *compile and *testCompile tasks in Gradle
body: <p>I would like to have in <a href="https://bitbucket.org/lievendoclo/animalsniffer-gradle-plugin">animalSniffer</a> plugin one task to depend on compilation of all production classes (Java, Groovy, Scala) in all sourceSets and the second to depend on compilation of all test classes in all sourceSets (possibly separate <code>test</code> and <code>integrationTest</code>).</p>
  
  <p>I wouldn't like to depend on <code>*classes</code> tasks as <code>*classes</code> tasks should depend <code>animalSniffer</code> tasks (which detects Java version API incompatibilities after the compilation and can stop the build).</p>
  
  <p>Is there a better way in Gradle to achieve that than checking if an instance of <code>AbstractCompile</code> task name starts with "compileTest"?</p>