Build Pattern: Facade

facade

by admin on March 2, 2010

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)

Share with the group:
  • Digg
  • del.icio.us
  • Facebook
  • DZone
  • LinkedIn
  • Slashdot
  • StumbleUpon

Related posts:

  1. Build Pattern: Green-lit build Continuous Integration should be a highway, not a parking...
  2. Ant Refactoring Ant isn’t what the hip kids are using right...

Related posts brought to you by Yet Another Related Posts Plugin.

  • admin
    @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!
  • EJC
    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.
  • MikeNereson
    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.
blog comments powered by Disqus

Previous post: Links for 2010-03-01

Next post: Links for 2010-03-02