BuildDoctor

Build Doctor

Continuous Integration, Delivery and Devops Consulting

Contact Us

(+44) 207 183 0323
hello@build-doctor.com
@builddoctor

Get in touch!

Ant Best Practices: Prefer a single buildfile

Posted on by Julian Simpson

This is the third post in my series about Eric M Burke’s Top 15 Ant Best Practices from December 2003. Today’s practice is “Prefer a single buildfile”. To paraphrase Eric, it’s easier to understand a single file rather than a clever hierarchy of files. Having presided over several multi-file builds, I’m only too aware that you can easily hang yourself. On the other hand, sometimes it makes sense to extract something to a different file to achieve a separation of concerns.

If you are trying to map complex dependencies across many build files, or do amazing things in Ant or Nant, then perhaps you need to try and simplify things in your project. I once worked on a project where the frontend was written by my team, and the backend by other. The frontend team branched the work of the backend team, and the backend team kept on trucking with their work. I came to the belated conclusion that we had fallen prey to Conway’s Law; really we had one project, and we should have written it like that. The build on that project was a nightmare: two projects pretending they were free agents, but in reality hopelessly dependent on each other.

I’m torn on this practice, but I’m going to agree with Eric. Ideally you shouldn’t need multiple files. Though it does keep me in a job.


About Julian Simpson

Founder and Editor of The Build Doctor. Drinks Flat Whites. View all posts by Julian Simpson →

2 Responses to Ant Best Practices: Prefer a single buildfile

Michael Kloss says: March 20, 2008 at 11:05 am

I really made the same experience. Having multiple build files a couple of years ago, I now prefer more single build files. But I have noticed that a my preference started by having ant macros in place. So it is very easy to have short and clean single build files and macros doing most of the magic part. Just as you often tried to solve with multiple build files. Ok, macros could be seen also as build file but much more easier to maintain in my opinion because these are more general. My five cents, Michael

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

The Build Doctor Ltd, Suite 17189, Lower Ground Floor, 145-157 St John Street, London, EC1V 4PW

© Build Doctor 2007-2012