ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Janes <>
Subject Relative FileSet?
Date Thu, 05 Apr 2001 06:15:45 GMT
I'm curious if such a thing as a "relative" FileSet exists, or if 
there's some way to use a Mapper to produce similar results.

I'm attempting to implement a wrapper for a tool that needs to access 
the relative pathnames of the files in its FileSet.  For example, given:

<toolWrapper destdir="dest">
     <fileset dir="src" includes="a/b/bar c/d/baz"/>

I'd like to run the command lines:

tool src/a/b/bar dest/a/b/bar
tool src/c/d/baz dest/c/d/baz

As it stands with the standard FileSet, all I'm able to get is:

tool /full/path/to/src/a/b/bar /full/path/to/dest/a/b/bar
tool /full/path/to/src/c/d/baz /full/path/to/dest/c/d/baz

which is what I was able to get with a simple regexp Mapper rule.

On the assumption that I'll have to do this by writing my own Task, I've 
extended Copy and overridden the necessary methods to get to the latter 
command lines.  I've also tried extending MatchingTask, using Zip as a 
jumping-off point, with similar results.

I'm still stuck on how to get Ant to stop providing absolute paths, 
though.  Is creating a new subclass of FileSet (RelativeFileSet?) 
appropriate?  Would it be of use to anyone else?

Any suggestions or pointers are most appreciated.

Peter J.
fix, n., v.  What one does when a problem has been reported too many
times to be ignored.
   --The New Hacker's Dictionary, 3rd ed.

View raw message