Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you "refactor" ant build.xml files?

I'm working on a large C++ system built with ant+cpptasks. It works well enough, but the build.xml file is getting out of hand, due to standard operating procedure for adding a new library or executable target being to copy-and-paste another lib/exe's rules (which are already quite large). If this was "proper code", it'd be screaming out for refactoring, but being an ant newbie (more used to make or VisualStudio solutions) I'm not sure what the options are.

What are ant users' best-practices for stopping ant build files exploding ?

One obvious option would be to produce the build.xml via XSLT, defining our own tags for commonly recurring patterns. Does anyone do that, or are there better ways ?

like image 538
timday Avatar asked Apr 17 '09 16:04

timday


1 Answers

you may be interested in:

  • <import>
  • <macrodef>
  • <subant>

Check also this article on "ant features for big projects".

like image 136
dfa Avatar answered Oct 18 '22 18:10

dfa