Hi Allan,

On Apr 29, 2008, at 3:50 PM, Allan Lewis wrote:


I have a project setup as below:

root
+project1
+project2
+unit-test

2 sub-projects, along with another unit/integration test project which
depends on both of the other projects. In addition, project1 is a code generator, which the unit-test project needs to execute to generate some of the sources to be tested. So, in other words, what is the best way for me to structure things so that I can both build project1 and incorporate it into my build for later projects? I playes around a bit with adding some
plugins/tasks to buildSrc, but wasn't able to get things working.

buildSrc is the way to go. I have forgotten to mention in the user's guide that buildSrc has to be in the root project. The binaries of buildSrc are available to all subproject build scripts. If we encounter use cases were it would be much better that each subproject can have its own buildSrc we might modify this.

root/settings.xml:
include 'project2', 'unit-test'

root/buildSrc/src/main/java ...sources of your former project1
root/buildSrc/src/test/java ...if there are tests

root/unit-test/gradlefile;
dependencies {
   compile project(':project2')
}

I'm delighted that people start using the multi-project functionality of Gradle.

Please don't hesitate to ask as many questions as necessary to get your stuff running.

- Hans



Thanks for any help, and congrats on a great new tool.  I'm currently
looking at migrating an existing Maven build over to Gradle.
--
View this message in context: http://www.nabble.com/Advice-on-multi- project-build-source-setup-tp16960881p16960881.html
Sent from the gradle-user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



--
Hans Dockter
Gradle Project lead
http://www.gradle.org




Reply via email to