ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: <fileset excludes ...> only basename no filepath ?!
Date Tue, 19 Sep 2006 12:17:44 GMT
Would be a Selector or a ResourceSelector?

<fileset...>
    <!-- selector -->
    <mycheck>
        <param key="foo" value="bar"/>
        <param key="john" value="doe"/>
    </mycheck>
</fileset>


<resources>
    <fileset...>
    <restrict>
        <!-- ResourceSelector -->
        <mycheck>
            <param key="foo" value="bar"/>
            <param key="john" value="doe"/>
        </mycheck>
    </restrict>
</resources>


Jan

>-----Urspr√ľngliche Nachricht-----
>Von: Antoine Levy-Lambert [mailto:antoine@gmx.de] 
>Gesendet: Dienstag, 19. September 2006 14:08
>An: Ant Users List
>Betreff: 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
>> 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
>
>

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


Mime
View raw message