Hi Frank,

Am Mi, 19.01.2011, 11:54, schrieb Frank Wilson:
> I am considering converting a set of inter-dependent modules to build
> with Gradle. These currently built with a mixture of Ant and the default
> eclipse builder. There is one ant script per project and a global ant
> script calls all of the others in (hopefully) the right order.
>
> By implementing Gradle scripts I am hoping to have the global build
> script replaced by an "agenda" that is created at runtime that is inferred
> from which projects are checked out, which project is being built and what
> their dependencies are, etc. (I think this is similar to some behaviours
> of the Maven reactor)
>
> The problem I am having with Gradle is that it seems mostly focused on
> hierarchical project layouts whereas Eclipse (which all of our developers
> use) only supports one directory full of projects. It seems that
> settings.gradle would have to be stored in the eclipse workspace root,
> which is not visible in the IDE. Is there a way around this?
>
> Also, in this flat directory structure I would like some projects to
> configure others but I am not sure how to do this. For instance say I
> have:
>
>
> WorkspaceRoot/
> + BuildCommon/
> + ModuleA/
> + ModuleB/
>
>
> What is the best way to get gradle code in BuildCommon to configure
> gradle code in ModuleA and B? I was thinking that by declaring BuildCommon
> as a dependency of ModuleA and B I could apply (for example) the java
> plugin and some configuration from BuildCommon onto Modules A and B. But
> how would I reference A and B from BuildCommon. It seems that
> "subprojects" in Gradle only refers to
> subdirectories, is there a way to override this?
We had exactly the same problem as we checkout our different eclipse
projects directly via subversive. You can specifiy the location of the
subprojects in your settings.gradle. we use the following code in our
projects:

------
include 'ModuleA'
include 'ModuleB'
include 'ModuleC'
include 'ModuleD'

rootProject.name = 'Joccis-SDK'

rootProject.children.each {project ->
    String fileBaseName = project.name.toLowerCase()
    project.buildFileName = "${fileBaseName}.gradle"
        project.projectDir = new File(settingsDir.parent, project.name)
    assert project.projectDir.isDirectory()
    assert project.buildFile.isFile()
}
------

Another good example for customizing the subprojects location is the
settings.gradle file of gradle itself at
https://github.com/gradle/gradle/blob/master/settings.gradle


regards,
René



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

    http://xircles.codehaus.org/manage_email


Reply via email to