ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ziggy <zigg...@gmail.com>
Subject Re: Filesets
Date Wed, 23 Dec 2009 08:13:56 GMT
Thanks all for all your help.
I think i understand them better now. I will be practising with more
examples and hopefully ill get better at it.

Thanks


On Fri, Dec 18, 2009 at 4:13 PM, David Weintraub <qazwart@gmail.com> wrote:

> On Fri, Dec 18, 2009 at 9:55 AM, Ziggy <ziggy25@gmail.com> wrote:
> > In all your examples you refered to "files" but not directories. Did you
> > mean files and directories?
>
> Filesets select files and not directories. If you want to select
> directories, you use "dirset".
>
> > could you check the examples below and let me know if i got it right
> >
> >>exclude name="**/pages"/>
> >>Takes all files from any subdir called "pages" but no subdir of pages
>
> You want "<exclude name="**/pages/*">
>
> This will only select the files directly under the pages directory,
> but not files that are located in subdirectories under pages. The "**"
> is a wildcard match for files in the directory tree while the "*" is a
> wildcard match just for the files in that directory.
>
> Again: <fileset> selects files and not directories. If you must match
> on directories, you need to use <dirset>. 90% of the time, you use
> <fileset> because you're interested in the files and not the
> directories.
>
> So:
>
> <include name="**/pages/**">
> Will match
>
> * a/b/c/pages/1.txt
> * a/b/c/pages/2.txt
> * a/b/c/pages/d/1.txt
> * a/b/c/pages/d/e/f/g/h/2.txt
>
> But, it won't match:
>
> * a/b/c/pages/
> * a/b/c/pages/d/
> * a/b/c/pages/d/e/f/
> * a/b/c/pages/d/e/f/g/h/
>
> because those are DIRECTORIES.
>
> Meanwhile:
>
> <include name="**/pages/*"/>
>
> Will match
>
> * a/b/c/pages/1.txt
> * a/b/c/pages/2.txt
>
> But it won't match:
>
> * a/b/c/pages/d/1.txt
> * a/b/c/pages/d/e/f/g/h/2.txt
>
> --
> David Weintraub
> qazwart@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message