[GRADLE-803] Implicit Project Execution in Multi-Project Builds and Support for Multiple settings.gradle Files Created: 27/Jan/10  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 0.8
Fix Version/s: None

Type: Improvement
Reporter: Thomas Glaeser Assignee: Unassigned
Resolution: Won't Fix Votes: 8


 Description   

If setting up a multi-project build by specifying something like

include ":component:core", ":component:app:runtime"

in the projects root settings.gradle, then I want to see two projects getting build only, core and runtime. However Gradle decides to also build :component as well as :component:app. However it doesn't make sense to build anything here as these are no real projects but simply folders used to structure the project layout (if I could start from scratch I would of course choose a different directory layout). If I would want to see these projects getting build as well wouldn't I have added them to the include statement?

Even worse, any common configuration I define for the subprojects via configuration injection in the root projects build.gradle file will also be applied to projects :component and as :component:app. Is there a way to avoid this behavior? Shouldn't Gradle support multiple settings.gradle files at different hierarchy levels?



 Comments   
Comment by Adam Murdoch [ 27/Jan/10 ]

We plan on simplifying this in the Gradle 0.10 release.

In the meantime, you can get the behaviour you want by doing something like this in your settings.gradle:

include 'core'
include 'runtime'

project(':core').projectDir = new File(rootDir, 'component/core')
project(':runtime').projectDir = new File(rootDir, 'component/app/runtime')
Comment by Thomas Glaeser [ 27/Jan/10 ]

This works quite well as long as I want to build from the project root or am I in the component/core or component/app/runtime directory. However what to do if I want to build all my subprojects from the component or component/app directories? As this is not a registered project node anymore I cannot build from there, right?

I think I can live with that for now as long as there is hope to see this addressed in a future release. Do you have the new behavior for 0.10 specified somewhere?

Comment by Hans Dockter [ 31/Jan/10 ]

You can always build from everywhere if you specify the root project dir:

gradle -p/myroot

You can additionally only build subprojects by specifying absolute tasks paths:

gradle -p/myroot :subproject:build

The future improved behavior is nowhere specified yet.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 11:39:20 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.