You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Tom Dimock <ta...@cornell.edu> on 2000/06/30 21:59:14 UTC

Some Ant 1.0 ideas

I've been going over Arnout's Tasks spec, along with some of the other
comments, and want to throw out for discussion some possibilities.  I've
incorporated ideas from a lot of people - if I fail to give correct credit,
please forgive me.  A lot of them I remember seeing but have not been able
to find the original reference again.

Enhanced properties

Currently Ant only allows strings as properties.  There have been a number
of suggestions for enhanced properties, mostly variants on lists.

String properties - probably leave pretty much as is, any real changes here
will dramatically break backward compatability.  The ${} substitution
syntax is not terribly elegant, but it is servicible and already in a lot
of build files. Possible deprecate "name=" in favor of "id=" for
compatibility with the rest of these suggested property types, and to
reduce the number of ways "name" is used.

Pattern sets (suggested by Mark Brouwer, one of the few credits I was able
to find :P  )

  <patternset id="foo">
    <include name="**/*.java" />
  </patternset>

  patternsets would be referenced via a patternset="foo" attribute.

File sets 

  <fileset id="foofiles" dir="bar">
    <include  ....   />
    <exclude ....    />
  </fileset>

  <fileset id="foufiles" fileset="foo" />
  
  <fileset id="myfiles">
    <fileset dir="firstdir" />
    <fileset dir="src">
      <include name="*.java" />
    </fileset>
  </fileset>
 
  May be used without the id as nested tags.
  
Path sets

  Similar to above, but builds a path.  
  Carefull attention here to platform problems!

------------
Task attributes

I tend to be a fan of relatively regular grammars, and it would seem to be
a good time to start using reasonably similar names across the various
tasks.  I personnaly like the idea of using a dotted notation, so that
rather than having srcdir and srcfile, we would have src.dir and src.file.
This can then be very easily extended to handle the enhanced property
types, such as src.fileset=

Some of the task now assume the "src" and "dest", I'd make them explicit.
Thus:

  <jar src.fileset="foo" dest.file="foo.jar" />

  <jar dest.file="foo.jar">
    <src.fileset dir="klong">
      <include ...   />
    </fileset>
  </jar>

  Not sure about that "src." in the second example.  Maybe not...

Sam Ruby's request to be able to have to output of one task be the input of
another could be handled like this:

<javac src.fileset="foo" dest.dir="build" dest.id="outfoo" />
<jar src.fileset="outfoo" dest.file="foo.jar">

Well, that's it for now.  In one of my other lives I'm a pyrotechnician,
and this is the busy season.  Gotta go blow things up!!!
----------------------------------------------------------------------------
       Tom Dimock  ----  Cornell University  ----  tad1@cornell.edu
"There go my people.  I must follow them, for I am their leader."  M. Gandhi