ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Antrushin <DAntrus...@mail.ru>
Subject Re: conditional include in Fileset
Date Wed, 12 Feb 2003 15:38:31 GMT
This is exactly what I have now. But second include looks superfluous
for me. Documentation for "if" attribute of <include> says
"only use this pattern if the named property is set", so I excepted
it won't affect anything if property is not set.


EXT / FOCAL MALAPRADE Roland wrote:
> Or, supposing you only want the contents of "subdir/" if the property is
> set, or everything otherwise, you could do it like this:
> 
> <fileset dir="${basedir}>
>      <include="subdir/*.java" if="some.property"/>
>      <include="*.java" unless="some.property"/>
> </fileset>
> 
>>-----Message d'origine-----
>>De : Dan Gardner [mailto:Dan.Gardner@emap.com]
>>Envoye : mercredi 12 fevrier 2003 14:49
>>A : 'Ant Users List'
>>Objet : RE: conditional include in Fileset
>>
>>
>>The following should do what you want, you have to 
>>specifically tell it to
>>include the contents of ${basedir} what ever the case.  Check 
>>the ordering
>>of the includes, I may have them the wrong way round.
>>
>><fileset dir="${basedir}>
>>     <include="subdir/*.java" if="some.property"/>
>>     <include="*.java" />
>></fileset>
>>
>>_______________________________
>>Dan Gardner        Emap IT - UK
>>
>>
>>
>>
>>>-----Original Message-----
>>>From: Denis Antrushin [mailto:DAntrushin@mail.ru]
>>>Sent: 12 February 2003 13:03
>>>To: user@ant.apache.org
>>>Subject: conditional include in Fileset
>>>
>>>
>>>Hello,
>>>
>>>I'm confused with a conditional include behaviour
>>>in FileSet.
>>>
>>>What would be result of
>>>
>>><fileset dir="${basedir}>
>>>    <include="subdir/*.java" if="some.property"/>
>>></fileset>
>>>
>>>if some.property is not set?
>>>I thought it would result in content of ${basedir},
>>>but in practice, it yields emty set.
>>>
>>>Is it bug in ant or I just misunderstood documentation?
>>>
>>>Thanks,
>>> Denis
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>>For additional commands, e-mail: user-help@ant.apache.org
>>>
>>
>>
>>** For great Emap magazine subscription & gift offers visit 
> 
> http://www.emapmagazines.co.uk **
> 
> ----------------------------------------------------------------------------
> ----
> The information in this email is intended only for the addressee(s) named
> above.
> Access to this email by anyone else is unauthorised.
> If you are not the intended recipient of this message any disclosure,
> copying, 
> distribution or any action taken in reliance on it is prohibited and may be
> unlawful. 
> 
> Emap plc and or its subsidiaries do not warrant that any attachments are
> free from 
> viruses or other defects and accept no liability for any losses resulting
> from 
> infected email transmissions.
> 
> Please note that any views expressed in this email may be those of the
> originator 
> and do not necessarily reflect those of this organisation.
> ----------------------------------------------------------------------------
> ----


Mime
View raw message