On 22/01/10 2:42 AM, MartyMcFly wrote:
Hi,
I do have problems with the concept of multiproject layout.
As far as I understood it is defined by a hierarichal structure
SuperProject
-- subproject1
-- subproject2
when I create the settings.gradle and the build.gradle in SuperProject with
allprojects {
task hello<< { task -> println "I'm $task.project.name"}
}
and run it i get the output from all projects (super and subprojects)
now I want to build the subprojects. They all have their java sources in a
'src' folder.. so my idea was
usePlugin 'java'
sourceSets.main.java.srcDir 'src'
You need to put these statements in a subprojects { } or allprojects { }
closure, otherwise you're just applying them to the root project:
subprojects {
usePlugin 'java'
sourceSets.main.java.srcDir 'src'
}
but this doesnt compile any source in the subprojects... do I need a
build.gradle for each subproject ? what does it look like ?
You don't need a build file for each subproject. You can configure the
subprojects from the root project's build file if you prefer, using
something like the above example.
When you say it doesn't compile any source, do you mean that there are
no compileJava tasks being run, or that the tasks are run but they don't
generate anything into the build directories?
If I run it with the -d flag i do get some information which show that the
subprojects are considered
[main] INFO org.gradle.Main - Included projects: [root project
'superproject', project ':subproject1']
So how does the build file structure has to look like that I can build all
subprojects (which of course compile in their specific ouput folder and
build only their jar) ?
Thanks in advance (again)
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email