You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dave Cherkassky <dc...@djinnsoft.com> on 2011/03/05 06:21:14 UTC

How to combining patternset

Dear ANT community:

I have one patternset like this:
   <patternset id='yui.compression.dirs'>
     <include name="jade/content/**"/>
   </patternset>

And a second patterset like this:
   <property name='yui.compression.js.source.suffix' value='-debug.js' />
   <patternset id='yui.compression.files'>
     <include name="**/*${yui.compression.js.source.suffix}"/>
   </patternset>


And I have the following directory tree:
   jade/content/compress-me1-debug.js
   someotherdir/do-not-compress-me-debug.js


I want to combine the two patternsets to return files that match both patterns: yui.compression.dirs and yui.compression.files.

In other words, I'd like to write the following:
   <patternset id='to.compress'>
     ...
   </patternset>
That will match:
   jade/content/compress-me1-debug.js
but won't match:
   someotherdir/do-not-compress-me-debug.js

Note:  I *don't* want to write:
   <patternset id='yui.compression.dirs'>
     <include name="jade/content/**/*${yui.compression.js.source.suffix}"/>
   </patternset>
I want the '...' to somehow refer to the two patternsets at the top of this email.


Is there a way to do this?

Thanks,
-- 
Dave Cherkassky
   VP of Software Development
   DJiNN Software Inc.
   416.504.1354

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


Re: How to combining patternset

Posted by Gilbert Rebhan <gi...@maksimo.de>.
-------- Original Message  --------
Subject: How to combining patternset
From: Dave Cherkassky <dc...@djinnsoft.com>
To: user@ant.apache.org
Date: Sat Mar 05 2011 06:21:14 GMT+0100 (CET)

> Dear ANT community:
> 
> I have one patternset like this:
>   <patternset id='yui.compression.dirs'>
>     <include name="jade/content/**"/>
>   </patternset>
> 
> And a second patterset like this:
>   <property name='yui.compression.js.source.suffix' value='-debug.js' />
>   <patternset id='yui.compression.files'>
>     <include name="**/*${yui.compression.js.source.suffix}"/>
>   </patternset>

[...]

> Note:  I *don't* want to write:
>   <patternset id='yui.compression.dirs'>
>     <include name="jade/content/**/*${yui.compression.js.source.suffix}"/>
>   </patternset>
> I want the '...' to somehow refer to the two patternsets at the top of
> this email.
> 
> 
> Is there a way to do this?


A patternset may have several nested <include name=../>,
each element contains one pattern, so why not combine your
patterns in one patternset ?

<patternset id="whatever">
 <include name="jade/content/**"/>
 <include name="**/*${yui.compression.js.source.suffix}"/>
</patternset>

note that include|exclude name="..." may be combined with
if|unless to control the use of a pattern via property, f.e
<include name="src/**"/ unless="prodbuild">

or use includes attribute with comma- or space-separated
list of patterns

<patternset
includes="jade/content/**,**/*${yui.compression.js.source.suffix}"
id="whatever"/>

or use includesfile, where each line of that file
contains one includepattern

<patternset>
 <includesfile name="foobar"/>
 <includesfile name="foobaz"
  if="testbuild"
 />
<patternset/>


Regards, Gilbert




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