Multi Project configuration where Projects owned by different teams and using ant build scripts

Hi, I have question on multi-project configuration. Let’s assume that Project A has dependancy on Project B, C, D. All these projects are using ant build scripts. Project A is owned by team X, and Project B, C, D is owned by team Y. Team X wants to configure Project A using gradle scripts. What is the best approach to configure Project A using gradle? Team X don’t has no ownership to make any code/script changes for Project B,C,D. All these projects are currently using clearcase and planning to move to GitHub repository.

How is the dependency currently handled?

Are they all separate projects with separate build.xml’s and share only through as-built artifacts?

If they’re all completely separate, you might be able to keep B, C, D exactly the same and declare dependencies in A like

dependencies {
     compile files("path/to/B.jar", "path/to/C.jar", "path/to/D.jar")

And just use an Exec-task to call the old build scripts.

You may be lucky and be able to import the build.xml directly for the B, C, D projects and “use” Gradle to build (under the covers Gradle uses the Ant build.xml). But that may cause problems with Team Y.

Of course, the more you can show how Gradle helps you get something done better (higher quality, more tests, etc), the easier it will be to get Team Y to come along…

Thanks Sterling!!! this helps!!

One technique to use is importing the ant build into a gradle project.

The problem is that if you import it directly into your primary gradle projects you’ll have name collision issues. The best way around this is to wrap all of your ant tasks inside of a separate gradle project where you can control what is exposed. This is done by calling ant.importBuild inside of a [GradleBuild task] (http://www.gradle.org/docs/current/userguide/organizing_build_logic.html).

Once you have the ant build tasks available, you can define the inputs, outputs, and artifacts to start leveraging the incremental build feature for all of your ant tasks. You can do this without modifying a single character in the build.xml files.

I used this technique on a project with over 70 separate ant build.xml files.