ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <anto...@gmx.de>
Subject Re: <fileset excludes ...> only basename no filepath ?!
Date Tue, 19 Sep 2006 12:08:07 GMT
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
> fileset refid="negativMatches" contains all jar files, as if i would
> have omitted the
> exclude attribute ?
> i want all jars that are not contained in the list = ${matches}
>
> debug mode says =
>
> fileset: Setup scanner in dir Y:\bla with patternSet{ includes:
> [**/*.jar] excludes:
> y:\bla\foobar.jar;y:\bla\dir1\foobar.jar;y:\bla\foo.jar;y:\bla\dir2 
> \foo.
> jar
>
> but when using =
>
> <for param="file">
>  <path>
>         <fileset id="neg" dir="Y:/bla" includes="**/*.jar"
> excludes="${matches}"/>
>  </path>
>
>    <sequential>
> 	<echo> File ===@{file}</echo>
>    </sequential>
> </for>
>
> the Path of @{file} is stripped down to basename, the excludes don't
> work, all
> jar's are echoed.
>
>
> Any ideas how to make that work with fileset ???
>
>
> btw i found a workaround with condition / contains :
>
>         <mfscan
>          keyname="Build-By"
>          keyvalue="svcscmcs"
>          matchprop="matches"
>          delimiter=";"
>          newline="false"
>          recurse="true"
>          count="true"
>          matchcount="count"
>          info="true"
>>
>
> <var name="op1" value="0"/>
>         <var name="op2" value="1"/>
>         <var name="op" value="+"/>
>
>         <for param="file">
>             <path>
>                 <fileset dir="Y:/bla" includes="**/*.jar/>
>             </path>
>             <sequential>
>
>                 <var name="found.negmatch" unset="true" />
>                 <condition property="found.negmatch">
>                     <not>
>                         <contains string="${matches}"
> substring="@{file}" />
>                     </not>
>                 </condition>
>
>                 <if>
>                     <isset property="found.negmatch" />
>                     <then>
>                         <echo>negativ Match == @{file} !!</echo>
>                         <echo file="Y:/negativ.txt"
> append="true">@{file}${line.separator}</echo>
>                         <math result="op1" operand1="${op1}"
> operation="${op}" operand2="${op2}" datatype="int" />
>                     </then>
>                 </if>
>
>             </sequential>
>         </for>
>
>         <echo>Anzahl negative Treffer == ${op1}</echo>
>         <echo file="Y:/negativ.txt"
> append="true">${line.separator}Anzahl negative Treffer == ${op1}</ 
> echo>
>
>
> Regards, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


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


Mime
View raw message