On 26/10/2010, at 5:35 PM, Etienne Studer wrote:

> Hi
> 
> I've noticed that if I run the build task of the java plugin, the assemble 
> task runs before the test task (alphabetically ordered), meaning that my 
> archives are built even if I have failing tests. I think this is not ideal. 
> Why create artifacts if my tests are red? Especially if my archiving tasks 
> take a long time to run due to the size of the project.
> 
> I could do a 'gradle test build' to get that under control. But I don't think 
> this can be the final solution that every developer on the project has to 
> remember. 
> 
> Any thoughts and ideas are appreciated.

As you point out, Gradle could do better at providing feedback earlier.

A solution to this problem that we've talked about is to have Gradle prioritise 
verification tasks (such as test, checkstyle, etc) so that it runs them as 
early as possible in the build (subject to dependency constraints, of course). 
This way, Gradle would run the tests before building the jar. Or it would build 
the jar so that it can run the tests for a dependent project before it bothers 
with the javadoc, say.

Prioritisation is something we want to use for other use cases too. For 
example, validation tasks, such as those that check that certain project or 
task properties have been set, would have the highest priority. Then we might 
do verification tasks, then bundling tasks, then finally publishing tasks last.

Gradle might also take the execution time of a task into account when 
prioritising tasks, so that it would favour quick tasks over long running 
tasks. Or it might take the failure rate of a task into account, so that it 
would favour tasks that fail a lot over those that do not.


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Reply via email to