On 05/05/2011, at 12:12 PM, Robert Winch wrote:

> You might conditionally apply the plugin based upon some convention. An 
> example of applying the java plugin to projects that contain a src folder is 
> shown below. More information on this method can be found in the user guide 
> [1].
> 
> def javaProjects = subprojects.findAll { p-> new 
> File(p.projectDir,'src').exists() }
> configure(javaProjects) {
>   apply plugin: 'java'
> }
> 
> [1] 
> http://www.gradle.org/current/docs/userguide/multi_project_builds.html#sub:project_filtering

Another option is to not even include the intermediate projects at all, and 
flatten out your project structure. For example, in your settings file, you 
might do something like this:

include 'access-protobuf'
project(':access-protobuf').projectDirectory = new File(rootDir, 
"lilith-data/access-protobuf")

Or, to automate it, something like:

new File(rootDir, "lilith-data").eachDir { dir ->
    include dir.name
    project(':${dir.name}').projectDir = dir
}


> 
> HTH,
> Rob Winch
> 
> On Wed, May 4, 2011 at 6:14 PM, Joern Huxhorn <[email protected]> wrote:
> I have a quite strange issue in my build and I'm not sure if it is a bug in 
> Gradle, a bug in my build configuration or both.
> 
> I'm talking about the build of https://github.com/huxi/lilith
> The main build configuration is located in the file 
> https://github.com/huxi/lilith/blob/master/config.gradle
> (Note: If you want to build this project you have to build 
> https://github.com/huxi/sulky first)
> 
> I apply 'base' to the root project and 'java' & 'maven' to all subprojects.
> The problem is that I have some sub-directories that don't contain java code 
> but sub-directories with code, instead.
> 
> Those directories are 'lilith-data', 'logback', 'log4j' and 'jul'.
> 
> My problem is that artifacts for those directories are created even though 
> they are not contained in settings.gradle. This is also the reason I had to 
> add them to the artifactMapping map.
> 
> How can I prevent the creation of those artifacts? Do I have to configure all 
> modules manually instead of using "subprojects"? That would be quite awful.
> 
> The only idea that I have right now is manually deleting the superfluous 
> artifacts before executing the syncStaging task.
> I'd still like to be able to execute gradle in one of those directories so 
> all contained subprojects are built.
> 
> Any ideas? Is this a known issue or did I misconfigure/misuse something?
> 
> Cheers,
> Joern.
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 
> 


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to