Let’s face it: Build scripts can age as badly as Steven Seagal. What do you do when yours is needing more than botox and a mud pack?
What you shouldn’t do is attempt to rewrite the whole thing from scratch. There’s no guaruntee that it’ll look any better by the time you’ve done that, and you’ll just annoy your colleagues.
If a spot of build refactoring isn’t enough, then you could try a new wrapping the whole build in another tool and swapping out chunks as you can and when you can. Here’s reader Jason’s comment on using Gradle:
when Gradle consumes an ant build it treats the tasks as actual
Gradle tasks, so you could override the ant tasks as needed and
simplify things until you’re completely ready to replace the old Ant
build with a Gradle build.
I’ve recently had some discussions with my brilliant co-workers about similar approaches with Maven: Embedding Ant code using the Maven Ant plugin seems to be for the win.
(photo via luc legay)