ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Ludwig <mil...@gmx.de>
Subject Re: simplify copy with regexpmapper (mapper/regexp)
Date Fri, 17 Sep 2010 21:47:01 GMT
Stefan Bodewig schrieb am 17.09.2010 um 14:54 (+0200):
> On 2010-09-17, Niklas Matthies wrote:
> > On Fri 2010-09-17 at 14:36h, Stefan Bodewig wrote on user:
> >> On 2010-09-16, Ludwig, Michael wrote:
> 
> >>> What I'm wondering is if there isn't some option like in tools
> >>> such as wget (--cut-dirs to shorten the path) or cpio or tar,
> >>> which in Ant's case would probably translate to a mapper, like
> >>> cut-dirs-mapper.
> 
> >> flatten
> 
> >> Since you really want to remove all dirs, flatten="true" or the
> >> flattenmapper should do what you want.
> 
> > But "flatten" also cuts away all sub-directories.

Exactly. I want to preserve those.

> Absolutely, hence "since you really want to remove all dirs".
> 
> > If for example the files to copy are Java source files under
> > multiple source roots, "flatten" would also remove the Java package
> > directories from the file paths, instead of just the part above the
> > source roots.
> 
> This is correct, but this is not the case in the problem Michael is
> trying to solve.

Well, these aren't Java files, but the requirement is the same.

I may not have specified it clearly enough, but what I want is what to
preserve the structure below the directories to copy, which is the way
the following UNIX utilities do it:

* wget --cut-dirs=2
* tar --strip-components=2
* cd/find/cpio achieves the same thing

-- 
Michael Ludwig

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message