2
votes

11.5. Selecting which build to execute states that:

When you run the gradle command, it looks for a build file in the current directory. You can use the -b option to select another build file. If you use -b option then settings.gradle file is not used.

I have multi-module project whose settings.gradle includes submodules.

How can I workaround this?

2
Isn't -c what you're looking for? - Opal
@Opal That's it, mate! Thank you! You should answer the question so that I can accept it. - Jin Kwon

2 Answers

1
votes

Isn't -c what you're looking for? With -c you can pass a settings.gradle file.

1
votes

I'm answering for further.

Actually, when I shoud use -b option, -c option doesn't work at all.

$ gradle -b _build.gradle -c settings.gradle

Document says

Alternatively, you can use the -p option to specify the project directory to use. For multi-project builds you should use -p option instead of -b option.

I have to make a directory and use -p option.

$ ls -F
gradlep/    sub1/    sub2/
$ ls gradlep
build.gradle settings.xml

Though, I can invoke gradle in root directory

$ gradle -p gradlep build