Re: simplify copy with regexpmapper (mapper/regexp)

2010-09-22 Thread Michael Ludwig
Stefan Bodewig schrieb am 20.09.2010 um 17:55 (+0200): > On 2010-09-17, Niklas Matthies wrote: > > Anyway, I'd be interested in a solution that really only removes a > > prefix of the path. > >

Re: simplify copy with regexpmapper (mapper/regexp)

2010-09-20 Thread Stefan Bodewig
On 2010-09-17, Niklas Matthies wrote: > On Fri 2010-09-17 at 14:54h, Stefan Bodewig wrote on user: >> On 2010-09-17, Niklas Matthies wrote: >>> But "flatten" also cuts away all sub-directories. >> Absolutely, hence "since you really want to remove all dirs". >>> If for example the files to copy

RE: simplify copy with regexpmapper (mapper/regexp)

2010-09-18 Thread Ludwig, Michael
> Here's working code: > > > > > > > > > > >from="^[-_a-zA-Z0-9]+/lib/(.*)" > to="\1" /> > > > One more observation is that the is also a "grepper" (as in "map" and "grep" in Perl), i.e. a filter defining a match c

RE: simplify copy with regexpmapper (mapper/regexp)

2010-09-18 Thread Ludwig, Michael
> And this is hardly surprising as I was confounding shell patterns and > regular expressions. The following, while not working, is at least a > suitable regular expression: > >from="${source.dir}/[-_a-zA-Z0-9]+/lib/(.*)" > to="\1" /> But of course, just for the fun of it, I had i

RE: simplify copy with regexpmapper (mapper/regexp)

2010-09-18 Thread Ludwig, Michael
> The following does not work for me, though: > > > > > > > > > > >handledirsep="1"/> And this is hardly surprising as I was confounding shell patterns and regular expressions. The following, while not working, is at least a suitable regular

RE: simplify copy with regexpmapper (mapper/regexp)

2010-09-18 Thread Ludwig, Michael
> From: Ludwig, Michael > Unfortunately, however, the task in Ant 1.8.1 does not support > a nested . > > copy doesn't support the nested "regexmapper" element. Fortunately, however, it starts supporting it once you spell it correctly: The following does not work for me, though:

RE: simplify copy with regexpmapper (mapper/regexp)

2010-09-18 Thread Ludwig, Michael
> Now I want to copy the files below src/*/lib, or most of them. > And I want to strip the leading two directories. I came up with > the following solution, but it is clumsy and I think there is > a better way that I'm missing. It appears to me from the documentation of the Mapper Type [1] that re

RE: simplify copy with regexpmapper (mapper/regexp)

2010-09-18 Thread Ludwig, Michael
> What about something like this: > > > > > > > > > > > > > I stole this from the ANTLR build script for actionscript target. It > does have a couple other replacestring elements, but this is the one > you would be interes

Re: simplify copy with regexpmapper (mapper/regexp)

2010-09-17 Thread Wayne Hassman
What about something like this: I stole this from the ANTLR build script for actionscript target. It does have a couple other replacestring elements, but this is the one you would be interested in "removing" high level

Re: simplify copy with regexpmapper (mapper/regexp)

2010-09-17 Thread Michael Ludwig
Niklas Matthies schrieb am 17.09.2010 um 15:08 (+0200): > Well, Michael wrote "I want to strip the leading two directories", and > also "/lib/**/*.*", which suggests that there can be directories below > "lib", and his regex just strips the directories up to "lib". Right. > Anyway, I'd be intere

Re: simplify copy with regexpmapper (mapper/regexp)

2010-09-17 Thread Michael Ludwig
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-

Re: simplify copy with regexpmapper (mapper/regexp)

2010-09-17 Thread Niklas Matthies
On Fri 2010-09-17 at 14:54h, Stefan Bodewig wrote on user: > On 2010-09-17, Niklas Matthies wrote: : > > But "flatten" also cuts away all sub-directories. > > Absolutely, hence "since you really want to remove all dirs". > > > If for example the files to copy are Java source files under multiple

Re: simplify copy with regexpmapper (mapper/regexp)

2010-09-17 Thread Stefan Bodewig
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

Re: simplify copy with regexpmapper (mapper/regexp)

2010-09-17 Thread Niklas Matthies
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, li

Re: simplify copy with regexpmapper (mapper/regexp)

2010-09-17 Thread Stefan Bodewig
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 dir

simplify copy with regexpmapper (mapper/regexp)

2010-09-16 Thread Ludwig, Michael
Consider this filtered view of my directory tree: src/HTML-XForm/lib src/ResPath/lib src/XML-MSXML6/lib You get the idea, it is: src/*/lib Now I want to copy the files below src/*/lib, or most of them. And I want to strip the leading two directories. I came up with the following solution, but i