gradlegradle-multi-project-build

How to build only submodules of a gradle parent module?


I am desperately trying to build only submodules of a gradle module. This is my current struture:

root
|_ foo
   |_egg
   |_nogg
|_ bar
   |_celona

When I run

gradle :foo:egg:build

It builds the submodule. I want it to build all two submodules egg and nogg

I tried:

gradle :foo:build

But it only build foo (which has no sources)

gradle :foo:*:build

Is what I expected to do or

gradle :foo::build

However no luck in getting it to work. Any ideas? The documentation is not giving out a hint for the multiproject part.


Solution

  • You could execute all foo sub-project tasks by specifying full path to each task:

    gradle :foo:egg:build :foo:nogg:build
    

    Gradle accepts multiple tasks in command line parameters.