ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <>
Subject Re: Asking for new feature: Self-Discovery of service to make Ant a real extensible system
Date Mon, 01 May 2006 22:12:32 GMT
--- Steve Loughran <> wrote:
> I've taken to declaring macros/presets in their own
> ns too.

I envision a world where this is not considered
remarkable.  Macros, presets, and scripts are good for
rapid prototyping, but if a task can be composed of
other tasks in Java, what is less correct about the
composite task being written in "Ant"?  I consider the
following a good example of something cool to do with
ns'd presets:  at my last job we had loads of legacy
stuff using Btrieve databases.  In trademark gross
abuse of Ant I used it for all kinds of utility jobs
in our final conversion away from all that. 
Historically Btrieve has been used a lot through a
command-line utility called BUTIL.  So I created a
BUTIL antlib along the lines of:

<presetdef name="create">
  <apply executable="BUTIL"
    <arg value="-CREATE" />
    <targetfile />
    <srcfile />

<presetdef name="copy">
  <apply executable="BUTIL"
    <arg value="-COPY" />
    <srcfile />
    <targetfile />

and so on for whichever options I needed...

so what would have been (in a batch file): 
  BUTIL -CREATE merged.btr merged.des
  FOR %%X in (foo.btr bar.btr) do (
    BUTIL -COPY %%X merged.btr

comfortably became (declaring the "butil" ns in the
calling buildfile):

  <fileset file="merged.des" />
  <mapper type="glob" from="*.des" to="*.btr" />

  <fileset dir="${basedir}" includes="*.btr" />
  <mapper type="merge" to="merged.btr" />

i.e. those familiar with the command-line tool would
have no problem understanding what was going on...



Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message