Accessing rootProject from Task argument


(Ken) #1

Hi,

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') {
}

Thanks!


(Stefan Oehme) #2

The root project’s path is just ‘:’


(Ken) #3

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