We use a similar setup on my project. You could also either [1] rename "main" to "master" per Gradle convention or [2] define another settings.gradle file in subproject directories so they can be the root when building from there. Check user guide doc, section 39.4 Initialization:
[quote] 39.4. Initialization How does Gradle know whether to do a single or multiproject build? If you trigger a multiproject build from the directory where the settings file is, things are easy. But Gradle also allows you to execute the build from within any subproject taking part in the build. [18] If you execute Gradle from within a project that has no settings.gradle file, Gradle does the following: It searches for a settings.gradle in a directory called master which has the same nesting level as the current dir. If no settings.gradle is found, it searches the parent directories for the existence of a settings.gradle file. If no settings.gradle file is found, the build is executed as a single project build. If a settings.gradle file is found, Gradle checks if the current project is part of the multiproject hierarchy defined in the found settings.gradle file. If not, the build is executed as a single project build. Otherwise a multiproject build is executed. [/quote] I don't think there's currently a way to tell Gradle where to look for your settings file, so we use solution 1 and have had no problems with it. Andrew Goode | Technical Architect/Team Lead tel: 678-762-6861 andrew.go...@nextraq.com 1200 Lake Hearn Drive, Suite 500, Atlanta, GA, 30319 http://www.nextraq.com This communication, along with any attachment(s), is intended only for the use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of any information contained in or attached to this communication is strictly prohibited. If you have received this message in error, please notify the sender immediately and destroy the original communication and its attachments without reading, printing or saving in any manner. Thank you. -----Original Message----- From: Luke Daley [mailto:luke.da...@gradleware.com] Sent: Thursday, November 17, 2011 5:34 PM To: user@gradle.codehaus.org Subject: Re: [gradle-user] Changing the location of settings.gradle in a multi-project build You'll have to run... gradle -c ../main <task> On 17/11/2011, at 10:18 PM, Alexander von Zitzewitz wrote: > Hi, > > I am trying to set up a multi project build where settings.gradle is parallel > to the subprojects like: > > a/ > b/ > main/ > build.gradle > settings.gradle > > > a and b are sub projects of main. Now I can run the build from main, after > some tweaks to the settings file. But I cannot build locally. If I call > gradle build in the a directory gradle cannot find the settings file. How can > I configure the directory of the settings file for a? > > Thanks for any help in advance. > > Best regards > > Alexander von Zitzewitz > > hello2morrow Inc. > 1 (877) 294-6327 > > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > -- Luke Daley Principal Engineer, Gradleware http://gradleware.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email