views:

51

answers:

2

We have a number of products that consist of a large number of modules, some of which are shared between some of the products. They are spread out over a few version control repositories.

Products are built by master Ant scripts that are responsible for checking out all modules and building them in the correct order. The modules don't have release cycles of their own.

Now, I'd very much like to go to declarative dependency management, but it seems that all solutions (Maven, Ivy) depend on artifacts rather than on source code under version control. Depending on artifacts would turn things on the head for us, so I'd rather not. I'd like something like Ivy, but where I can say that my product depend on modules foo, bar and baz (branch 2.0) and it would check out the source code from one or more source code managers (specified in some configuration) to a flat workspace.

I plan to use gradle for building, so a solution that fits with that would be much appreciated...

A: 

Gradle embeds the ivy project for it's dependency management so you'll be facing the same sorts of issues.

Dependency management is a mechanism that enables a large monolithic build to be broken up into smaller component builds, each publishing their output into a common repository for use by other dependent modules.

So this means you must first make a concious decision to break up your large build, or simply settle for using dependency management to control 3rd party open source libraries.

Assuming you have no control over the fact that you have multiple SCM repositories I can recommend the following approach to create a centralized build (I'm assuming you're using ANT + subversion):

1) Create a master project that contains your child modules

2) Each child module is added to the master project as an external definition. This enables one checkout of the master to, in turn, checkout each child project automatically

3) The build.xml master project contains a build file that uses the ivy buildlist task to build the child projects in the correct order based on the declared dependencies within the various child project ivy.xml files.

An example of a multi-project build is here

Mark O'Connor
Gradle's "project dependencies" is what I need (I think) to build modules in the correct order and reference built jars, once everything is checked out.svn:externals would probably work, but I am not really happy with having to specify dependencies in more than one place. Also, it is static and doesn't allow checkout time magic like "get the same named branch as I am of that other module, if it exists, otherwise get trunk".I am taking more suggestions before I make up my mind here... :)
simon
Mult-project builds in Gradle work the same wayhttp://www.gradle.org/0.9-preview-3/docs/userguide/multi_project_builds.html
Mark O'Connor
A: 

I think Refix is what you are after: http://refix.codeplex.com/

Daniel Dyson