How to aggregate several multi-project builds?

(Stephane Galles) #1

We are currently in the process of migrating our projects from Ant+Ivy to Gradle. At this point, we have several Gradle multi-project builds spread among several teams. A multi-project build of one team may have fixed revision dependencies on the artifacts published by an other team.

I must now create a ‘snapshot build’ that will try to rebuild all the multi-project builds ignoring the fixed revisions and trying to integrate the most recent code of each team.

With Ant+Ivy I used to use the ‘force’ feature of the Ivy resolvers. Let me quote the Ivy documentation : In force mode, the resolver attempts to find a dependency whatever the requested revision is (internally it replace the requested revision by ‘latest.integration’). AFAICT this feature does not exist for Gradle.

I guess it is a rather common use case and I’m wondering how to emulate this.

(Peter Niederwieser) #2

You can introduce a variable for the version number(s) and set it to ‘latest.integration’ for a snapshot build.

(Stephane Galles) #3

Thanks Peter, actually I was intending to do something like this, but I was not sure that it had to be handled by the build, or if there was a baked in feature that could help.

In detail, For my use case, I can not really hardcode in each project the list of the dependencies that must be switched to dynamic revision during a snapshot build (the projects should not know what dependency is part of the snapshot recompilation or not, in this regard the Ivy ‘force’ feature allowed this decoupling)

So I think that I’m going to introduce a variable with the list of the names of the projects that are part of the snapshot build, and inject this list in each project, hence each project will be able to generically infer when a local fixed revision dependency must be switched to ‘latest.integration’.

Thanks again for your fast answer.