ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: how to set a property based on the contents of files in a tree?
Date Wed, 07 Nov 2007 07:23:34 GMT
 
Hi,


-----Original Message-----
From: David Weintraub [mailto:qazwart@gmail.com] 
Sent: Tuesday, November 06, 2007 5:52 PM
To: Ant Users List
Subject: Re: how to set a property based on the contents of files in a
tree?

/*
I'd just use <property name="files_path" refid="fileset"> and then
check if property "files_path" is greater than zero.

 <fileset dir="WebInfra/Source" id="fileset" includes="**/*">
   <containsregexp expression="dg" />
 </fileset>

<property name="files_path" refid="fileset">

<condition property="prop_from_condition">
    <equals arg1="${files_path}" arg2=""/>
</condition>
*/

or a bit shorter =

<fileset dir="Y:/test" id="fileset" includes="**/*">
  <containsregexp expression="dg" />
</fileset>

<condition property="prop_from_condition">
  <equals arg1="${toString:fileset}" arg2=""/>
</condition>

as already said, if it doesn't get more complicated
i would stick with the 'normal' ant solution, if i need
more i would go with <script>, <scriptdef> or an own task.


Regards, Gilbert


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


Mime
View raw message