From the user docs, it appears that you can put the settings.gradle file for a multiproject into a “master” directory instead of the top directory. But when I try this, I get an error that appears to indicate that gradle can’t find the settings.gradle file.
Cause: Project with path ‘:A’ could not be found in root project ‘B’.
Here the directory structure is
rootDir
build.gradle
master
settings.gradle
A
build.gradle
…
B
build.gradle
…
and I am running ‘gradle clean’ from within B and B has a compile dependency on A, compile project(’:A’)
I have tried several variations on
include ‘A’, ‘B’ include ‘:A’, :B’ includeFlat ‘…/A’, ‘…/B’ includeFlat ‘A’, ‘B’ but none seem to work.
It is also unclear from the docs if the root level build.gradle can also live with the master directory. What about buildSrc?
I think it would be very nice if all 3 of these (settings.gradle, build.gradle, buildSrc) could live in the master directory. It would make version control much better when each subproject is in a separate mercurial repository, for example, and so having the root directory in version control is weird. Having these off in master makes it easy to version control just the master directory to capture build and settings files without having subprojects inside as well.
thanks, Philip
gradle --version
------------------------------------------------------------ Gradle 1.0-milestone-6 ------------------------------------------------------------
Gradle build time: Thursday, November 17, 2011 5:54:12 AM UTC Groovy: 1.8.4 Ant: Apache Ant™ version 1.8.2 compiled on December 20 2010 Ivy: 2.2.0 JVM: 1.6.0_20 (Sun Microsystems Inc. 16.3-b01) OS: Linux 2.6.18-92.1.13.el5 amd64