Cengiz
Cengiz

Reputation: 4867

Nesting settings.gradle

Is it possible to nest multiple settings.gradle files for a multi module project?

E.g. settings.gradle of Project A should include settings.gradle of Project A_a

A (include ':A_a',':A_b')
A_a (include 'A_a_1','A_a_2','A_a_3')
A_a_1
A_a_2
A_a_3
A_b 

Upvotes: 1

Views: 2702

Answers (2)

Dani Muñoz
Dani Muñoz

Reputation: 38

As of 2023, Gradle (8.x) provides documentation for structuring large projects with several settings.gradle by using an umbrella build.

For example:

├── android-app
│   └── settings.gradle
├── server-application
│   └── settings.gradle
│
├── admin-feature
│   └── settings.gradle
├── user-feature
│   └── settings.gradle

You can just check it here https://docs.gradle.org/8.0/userguide/structuring_software_products.html or here https://docs.gradle.org/8.0/userguide/structuring_software_products_details.html

Upvotes: 0

Hiery Nomus
Hiery Nomus

Reputation: 17769

No, there should only be one settings.gradle in the root project of the build. Gradle expects it to be that way, that's how it was built. It will

Please see the Build Lifecycle documentation of gradle for a full explanation. Particularly the Initialization chapter.

Upvotes: 3

Related Questions