Gilbert, are you basically saying you need all the
files from a certain directory that are NOT already in
the path you've constructed? In Ant 1.7, you
would/could/should do this:
<fileset id="bla_jars" dir="y:/bla"
includes="**/*.jar" />
<path id="matched_jars" path="${matches}" />
<!-- find all files in bla and ${matches} -->
<intersect id="matched_bla">
<fileset refid="bla_jars" />
<path refid="matched_jars" />
</intersect>
<!-- subtract the intersection -->
<difference id="unmatched_bla">
<fileset refid="bla_jars" />
<intersect refid="matched_bla" />
</difference>
This is longer than it has to be. I assumed that
${matches} might contain files not in the bla
directory. If you know that ${matches} contains only
members of bla, you could just use the <difference>
without the prior <intersect>. Also note that
wherever refids were used I used the original type of
the resource collection, because I knew what it was.
You can and may wish to simply use the <resources
refid="" /> construct which is useful when you do not
know or care about the concrete collection type.
HTH,
Matt
--- "Rebhan, Gilbert" <[EMAIL PROTECTED]>
wrote:
>
> Hi Antoine,
>
> thanks for your response.
> I thought fileset could handle full pathes too.
> Is there a way to get that into fileset ?!
>
> my problem is like that =
>
> i have my ManifestScanner task that gives me a
> property with a ; separated list with full file
> pathes
>
> C:/dir1/file1.jar;C:/dir1/file2.jar;C:/file1.jar
> ....
>
> Fileset needs relative pathes, but i need the whole
> path
> for other stuff in my script, and there are also
> files with
> the same name but different manifests.
>
> So how to get rid of C:/ for the whole list ?
>
> <basename> gives me only the filename
>
> Is there a way with <pathconvert> or a simple
> scripting
> solution ?
>
> Regards, Gilbert
>
>
> -----Original Message-----
> From: Antoine Levy-Lambert [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 19, 2006 2:08 PM
> To: Ant Users List
> Subject: Re: <fileset excludes ...> only basename no
> filepath ?!
>
> Hello Gilbert,
>
> remember that include/exclude patterns are relative
> to the fileset
> directory.
>
> so
>
excludes="foobar.jar;dir1\foobar.jar;foo.jar;dir2\foo.jar"
> should
> be the right thing.
>
> Regards,
>
> Antoine
>
> On Sep 19, 2006, at 2:01 PM, Rebhan, Gilbert wrote:
>
> >
> > Hi,
> >
> > i have a selfwritten task that scans the manifests
> of jar files
> > in 1 - n filesets for specific key=value patterns
> and writes the
> > matches to a separated list of filenames with
> whole path, f.e.
> >
> >
>
y:\bla\foobar.jar;y:\bla\dir1\foobar.jar;y:\bla\foo.jar;y:\bla\dir2
>
> > \foo.
> > jar
> >
> > this ; separated list is put into a property,
> let's say ${matches}
> >
> >
> > Now i wanted to use ${matches} with a fileset like
> that =
> >
> > <fileset id="negativMatches" dir="Y:/bla"
> excludes="${matches}"
> > includes="**/*.jar">
> > </fileset>
> >
> > but that didn't work
>
> [...]
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]