Declarative dependency handling for multi-module source projects in version-control
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 fo开发者_运维知识库o, 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...
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
I think Refix is what you are after: http://refix.codeplex.com/
精彩评论