User Guide ch 15 : run example got project could not be found in root project


(greyby-5) #1

Run Example 15.6. Accessing tasks by path in the user guide

project(':projectA') {
    task hello
}
  task hello
  println tasks.getByPath('hello').path
println tasks.getByPath(':hello').path
println tasks.getByPath('projectA:hello').path
println tasks.getByPath(':projectA:hello').path

got this “Project with path ‘projectA’ could not be found in root project ‘projectA’” ,is there any conversion must observe?


(Peter Niederwieser) #2

This example assumes a ‘settings.gradle’ containing ‘include ‘projectA’’.


(greyby-5) #3

Thank you very much, Peter. Problem resolved. I read chapter 6:Build Script Basics, than click the link task details and read Chapter 15, More about Tasks . And I didn’t see something refer to settings.gradle. So got this confused.