Build Pattern: Facade

Build Pattern: FacadeLet’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)

Tagged ,

3 thoughts on “Build Pattern: Facade

  1. MikeNereson says:

    The first thing that came to mind to me was something that you pointed out — using the Maven Ant Plugin to call ant tasks from a maven build. Another option for maven users to to write your own plugin to extend build process steps or create new ones.

  2. EJC says:

    I agree whole heartedly with the maven-calls-ant bit (and vice versa).

    We went whole hog and faced pitchforks and torches (I’ll admit to carrying some of them as well).

    In hindsight, adopting a smoother transition would have been better. I look at things like this now with an eye toward evolution, NOT revolution.

  3. admin says:

    @mike – good call on writing your own plugins – I think that’s the way to make simple Ant or Maven tools, with less XML.

    @ej – glad you got outta town okay!

Comments are closed.

%d bloggers like this: