Jeppe Nejsum Madsen wrote:
Hi,

I just upgraded to 0.8 and it seems that broke my build (which worked
with trunk a few weeks old).

I want to force the clean task to be run whenever a release is made, so
I had this:

task bundle(dependsOn: ['clean','assemble']) << {...}

This used to do the correct thing (by coincidence?) in that clean was
run before assemble (or libs as it was called at the time).

It was coincidence.

 With 0.8, it
now runs assemble followed by clean, which is not very useful :-(

I tried adding bundle.doFirst {...} and call clean here, but this is not
executed until after assemble has run and just before bundle is about to
run....

So is there a way to force clean to be run as the first task if
executing the bundle task? I guess I could look at the complete project
dag and look for bundle and then do a project.afterEvaluate, but this
seems a bit verbose. Any other solutions?


There's a few simpler options you have:

You could add the libs task back in:

task libs(dependsOn: assemble)

task bundle(dependsOn: [clean, libs]) << { ... }

Or you could depend on the same things as assemble:

task bundle(dependsOn: [clean, assemble.taskDependencies]) << { ... }


You shouldn't need these workarounds in 0.9. The task dependency auto-wiring will know to run clean, which destroys the build dir, before any tasks which create files in the build dir, such as assemble.


Adam


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to