xetra11
xetra11

Reputation: 8885

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.

Upvotes: 4

Views: 2092

Answers (1)

Valts Mazurs
Valts Mazurs

Reputation: 81

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.

Upvotes: 2

Related Questions