Many projects all built in a similar way

Hi, I’m trying to port over an existing ant build that contains 50 or so applications. They’re all built in a similar way except for application names and file paths.

Do I bite the bullet and create 50 individual build files thinking that I’ll be better prepared for when parallelisation comes along?

Or should I create a master build file with 50 projects and use methods to cut down on defining tasks over and over again. Something similar to this:


Parallelisation is not a concern here. Whether to use a multi-project build or not depends on how you want them orchestrated.

Some questions:

  • Do they have the same versioning lifecycle?

  • Are there dependencies between the projects?

  • Are all projects active? * Are they all components of the same logical thing? Or completely separate?

There are options either way. If you want to keep them all completely separate, you can use plugins to reuse build logic.


Each one is an application that makes up one large logical application so they’re all active and fortunately, have no dependencies between them. There’s also no requirement to version them separately. I’m in Websphere BPEL land here.

The main reason for using Gradle is because it feels like the mechanism for checking up-to-date tasks is much better than doing it in Ant. What I’ve ended up doing so far is wrap our Ant build in Gradle and loop through all the targets to create corresponding Gradle tasks where I can determine the inputs and outputs.

All the logic’s still in Ant for now but I’m happy with that because it’s still a big step forward.

That’s a valid strategy for non trivial ant builds, and one that we recommend a lot.

If you’re using the ant import ability, be aware that you can make ant targets incremental without needing to “rewrite” it into a Gradle task. If you add the appropriate ‘inputs.files’ and ‘outputs.files’ for the imported ant target it will still be incremental.

You might want to check out the upcoming webinar on migration to Gradle.

Oh yeah…because they become tasks when they’re imported.

Just killed half the code, that works much better!