`dependsOn` is the correct solution. Calling `execute` on a task is not
supported and should be avoided. What's your problem with `dependsOn`? If
it's just the syntax, you can easily write a helper method that lets you
write something like `chain(preRelease, validate, compile)`. Not sure what
you are trying to accomplish with `rethrowFailure`.

Cheers,
Peter


k4rn4k wrote
> 
> Hello, 
> 
> I'm trying to implement the next behavior in gradle:
> 
> command:  gradle release
> 
> will do:
> 
> 1: Pre-release changes
> 2: Validations
> 3: Compilation
> 4: Tagging
> 5: UploadArchives
> 6: Post-release changes
> 
> All of these are tasks. I could rewrite them as methods but ill still have
> the same problem with compilation and uploadArchives. 
> If I explicitly call them (as tasks.name.execute() ) I don't get the usual
> output 
>>:path:to:project:task... evaluating...
> It just doesn't give any output.
> 
> If some of the task crash another task will restore back the changes so
> the dependsOn approach also forces me to include 
> try{
>               tasks.name.getState().rethrowFailure()
> everywhere.
> 
> 
> Is there a better way than dependsOn, dependsOn, dependsOn... ? getting
> the usual output. Should I manually add them to the taskGraph? How could
> this be done ? 
> 
> something like 
> 
> task release <<{
> 
> try {
>      preRelease, validate, compile...
> } catch (Ex e) restore
> 
> would be very useful
> 
> Thanks
> 
> EDIT: Also when I call tasks.name.execute() it isn't being evaluated for
> subprojects
> 


--
View this message in context: 
http://gradle.1045684.n5.nabble.com/What-is-the-best-way-to-define-the-execution-of-several-tasks-tp5501594p5502261.html
Sent from the gradle-user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email


Reply via email to