0

Trying to follow official gradle 6.3 user manual I faced example that doesn't work. build.gradle:

project('projectA') {
  task taskX {
    dependsOn ':projectB:taskY'
    doLast {
      println 'taskX'
    }
  }
}

project('projectB') {
  task taskY {
    doLast {
      println 'taskY'
    }
  }
}

But if I run gradle -q taskX I get:

FAILURE: Build failed with an exception.

* Where:
Build file '[path_to_gradle_file]/build.gradle' line: 1

* What went wrong:
A problem occurred evaluating root project 'dependency'.
> Project with path 'projectA' could not be found in root project 'dependency'.
disable1992
  • 4,873
  • 3
  • 17
  • 25

1 Answers1

0

For the multi-project gradle script for this case it is required to have settings.gradle with:

include 'projectA', 'projectB'
disable1992
  • 4,873
  • 3
  • 17
  • 25