2

Two projects in separate, parallel directories:

/Root/A/build.gradle
/Root/B/build.gradle

A is dependant on B:

// in /Root/A/build.gradle:
dependencies{
    compile project(':B')
    // ...
}

Both files define defaultTasks:

defaultTasks 'doWork'

The project's B default task doWork performs several tasks, e.g.:

task doWork {
     dependsOn 'build', 'some_task', 'other_task'
}

What's surprising: the set of tasks chosen to be executed from B is different depending on where the gradle is called from:

  • the same for /Root/ and /Root/B/,
  • different for /Root/A - smaller, none of the tasks defined in doWork get executed.

Question: is 'compile project(':X')' not calling defaultTasks? What task is it calling?

hauron
  • 4,550
  • 5
  • 35
  • 52

0 Answers0