Accessing rootProject from Task argument


I know it’s possible to do something like that:

task myTask(dependsOn 'myOtherTask') {

However, I know it’s also possible to reference the rootProject like so:

tasks.myTask.dependsOn rootProject.tasks.myOtherTasks

Can I access ‘rootPoject’ using argument like the first option? note that I do not know the rootProject name, so I have to access it like I do with ‘rootProject’. Something like:

task myTask(dependsOn ':rootProject:myOtherTask') {


The root project’s path is just ‘:’

Bah, so simple and yet I managed to miss that. Thank you! :slight_smile: