What is the official way (if one) to make one task always execute after another task? This is different than both dependsOn and mustRunAfter.
In my build we use JDK 7, but we target JDK 6. Rather than needing to have users configure the second JDK path (in order to set “bootstrap class path”) we opted to use a library called Animal Sniffer that checks API usages. So my build defines a task named checkJavaApiSignature.
In terms of ordering: * checkJavaApiSignature depends on compileJava : compileJava has to be run before checkJavaApiSignature * checkJavaApiSignature needs to be run everytime compileJava has been run, every time compileJava has been run. But this is the one that Gradle (iiuc) does not really have a task relationship for. To my understanding, mustRunAfter is more about specifying which task to run when both are requested.
I tried using doLast but that did not work. Neither:
compileJava.doLast checkJavaApiSignature
^^ config error
compileJava.doLast {checkJavaApiSignature}
^^ nothing happens
compileJava.doLast {checkJavaApiSignature.execute()}
^^ error because checkJavaApiSignature’s deps arent run