On Oct 30, 2008, at 11:29 PM, Adam Murdoch wrote:



Martin Stephan wrote:
Hi,

inspired by some other posts on this list I decided to have a look at
Gradle again (after I chose Gant over Gradle 0.1 a while ago) and
tried to migrate a Gant script to Gradle (which worked, just probably
not very elagantly) and also to add some Gradle Goodness. Here I'm
having problems.

So I'm trying to do automated version numbering and again, I guess,
there are much better ways but I'm trying to understand why the code
below is not working when I call 'gradle minor jar'.

I guess 'if (dag.hasTask(':major') || dag.hasTask(':minor'))' won't
work because 'jar' and 'minor' have different DAGs



Pretty much. Gradle treats each task name provided on the command- line as a separate build, each with its own project, task instances, and DAG. So, when you run 'gradle minor jar', its exactly the same as running 'gradle minor' and then 'gradle jar'. Which, of course, isn't going to do what you want.

I don't think that this behaviour is very often (ever?) what one expects or wants, so perhaps we could make some changes to make this work better.

I'm not sure about that. Most of our users come from Ant or Maven. And for both tools specifying multiple tasks (targets/phases) means running them sequentially and isolated. But there is an issue for offering an alternative, were specifying multiple tasks leads to the creation of a single DAG ( http://jira.codehaus.org/browse/GRADLE-24).

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





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

   http://xircles.codehaus.org/manage_email


Reply via email to