Я новичок в Gradle и следую этому учебнику Gradle , и он дает следующий пример, который я скопировал / вставил в мой файл ~ / gradle-tutorial / build.gradle
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
Когда я запускаю
$ gradle -q hello
Я получаю
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/myuser/gradle-tutorial/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating root project 'gradle-tutorial'.
> Project with path ':projectA' could not be found in root project 'gradle-tutorial'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Я создал файл ~ / gradle-tutorial / projectA / build.gradle, но все равно получил тот жеошибка.
Чего мне не хватает?
Примечание. Я обнаружил Проект с путем ': mypath' не найден в корневом проекте 'myproject' , но не можетпонять, как заставить этот ответ работать в моем простом случае с одним файлом / одним каталогом.