1

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 
Cengiz
  • 5,375
  • 6
  • 52
  • 77

1 Answers1

3

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.

Hiery Nomus
  • 17,429
  • 2
  • 41
  • 37
  • 1
    And why there should only be one settings.gradle? Would it be a bad practice or it is technically not possible? – Cengiz Feb 05 '13 at 09:21
  • Agree w this answer totally, but just adding - It seems they give you an API if you would like to tinker with the recommended build structure. I have not used it, but check out the section titled: "56.4. Running tasks by their absolute path" - http://gradle.org/docs/current/userguide/multi_project_builds.html#sec:running_partial_build_from_the_root – Bamerza May 15 '15 at 23:08
  • There can be several settings.gradle files in your project, however, Gradle is only taking the rootProject one into account by default. There are different approaches around which realize a load of multiple settings.gradle files. Take a look at the answers [here](http://stackoverflow.com/questions/12154031/multiple-settings-gradle-files-for-multiple-projects-building/) – Ben Steinert Jun 15 '15 at 17:31