# Multi-project task dependencies

**URL:** <https://discuss.gradle.org/t/multi-project-task-dependencies/3619>\
**Category:** Old Forum Archive\
**Created:** [July 3, 2013, 4:55pm UTC](https://discuss.gradle.org/t/multi-project-task-dependencies/3619 "2013-07-03T16:55:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nishant\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/n/82dd89/32.png) [@Nishant\_Agarwal](https://discuss.gradle.org/u/Nishant_Agarwal)\
**Post date:** [July 3, 2013, 4:55pm UTC](https://discuss.gradle.org/t/multi-project-task-dependencies/3619/1 "2013-07-03T16:55:00Z")

</div>

I have a flat-multi-project structure like below: A --build.gradle B --build.gradle

A task taskA in project A when called has to do something like this.

```gradle
taskA{
  //do something -- usually set a global parameter
  //call projectB.taskB to execute
}

```

dependsOn fails because: 1. taskA(dependsOn : ‘:projectB:taskB’) – this fails because taskB requires value set by taskA at line1 to execute 2. taskB(dependsOn : ‘:projectA:taskA’) – this is of no use because taskA is my main (visible) task and this does not assures “taskB must run after taskA”

I tried mustRunAfter() but i think it has been deprecated.

It looks simple but I cannot figure out the workaround. Can you please help me out here.

FYI: I am moving from ant to gradle build and this particular logic is related to antcallback functionality

```gradle
<antcallback antfile="${custom.dir}/pabuild/extension.xml" target="isActionRequired" return="requireAction">
  <param name="currentTask" value="deploy"/>
 </antcallback>

```

Thanks. Nish.

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [July 20, 2013, 6:56pm UTC](https://discuss.gradle.org/t/multi-project-task-dependencies/3619/2 "2013-07-20T18:56:00Z")

</div>

> 1. taskB(dependsOn : ‘:projectA:taskA’) – this is of no use because taskA is my main (visible) task and this does not assures “taskB must run after taskA”

It does guarantee that taskA is run before taskB.

This seems to be all you need.
