How can gradle find sub-project's tasks in root project?


(du li) #1

For example, I have a project organized like this:

Falcon
+-:app
+-:falcon-core
+-:tools

And I have a baselineCheckstyle task in my :app project.

$ ./gradlew :app:tasks --all | grep baseline
baselineCheckstyle

$ ./gradlew tasks --all | grep baseline
app:baselineCheckstyle

So, my question is if I run this in my root project, how can :app:baselineCheckstyle be executed?

$ ./gradlew baselineCheckstyle

If :tools sub-project also has a baselineCheckstyle task, can it also be executed?

Thanks a lot.


(du li) #2

https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:execution_rules_for_multi_project_builds