I came across that problem,

but I think it is partly because I was migrating quite a large unwieldy
build script from ant to gradle, and the correct use of gradle dependsOn
just didn't fit what I needed.
in the end, for some parts of my build script, I ended up in directly
invoking the execution of the gradle task, so that events happened exactly
in the order I needed.

eg,

getByName('aggregateModuleTests').execute()

or simply

aggregateModuleTests.execute()

I'm not sure if there is any such thing as a simple 'function' allowed in a
gradle script .. ?
and as I didn't know, and didn't see any reference to such an entity, I was
just directly executing tasks.


On 27 May 2011 17:38, Greg Gigon <[email protected]> wrote:

> Yes.
>
> I assume that the whole Idea of Gradle is to declare what tasks depend on
> what and Gradle will execute them in the right order.
> For example if A depends on C and C depends on B, if you execute task A,
> the order will be B > C > A.
>
> With multiple dependency it's exactly the same deal. Assumption is that
> Gradle will work it out. Therefore it checks each task dependency. If a task
> have multiple dependencies then those are sorted.
>
> If you want some tasks in multiple dependencies to be executed in specific
> order, add dependencies between them.
> For example, if you are in the situation:
>
> task A;
> A.dependsOn C
> A.dependsOn B
>
> those will be executed B > C > A
> if you are after order C > B > A you need to declare B.dependsOn C
>
> task A;
> A.dependsOn C
> A.dependsOn B
> B.dependsOn C
>
> Cheers, Greg
>
> On Thu, May 26, 2011 at 11:53 PM, bart <[email protected]> wrote:
>
>> I'm running into this same issue.  Does anyone have any advice?
>>
>> --
>> View this message in context:
>> http://gradle.1045684.n5.nabble.com/tasks-and-dependsOn-order-not-in-the-order-given-tp3339151p4430335.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
>>
>>
>>
>
>
> --
> Greg Gigon
> http://greggigon.com
> http://www.linkedin.com/in/greggigon
> Twitter: gregorygigon <http://twitter.com/gregorygigon>
>
> "You see, wire telegraph is a kind of a very, very long cat. You pull his
> tail in New York and his head is meowing in Los Angeles. Do you understand
> this? And radio operates exactly the same way: you send signals here, they
> receive them there. The only difference is that there is no cat."
>      Albert Einstein, when asked to describe radio
>
>

Reply via email to