Hello all,
I'm doing something, but I'm not sure I'm doing it the best way
possible. So, I thought I'd ask the experts.
What I want to do is set a property if at least one file in a
directory tree contains a regular expression X. Here's what I'm
doing:
Create a fileset containing all files that match this condition:
<fileset dir="WebInfra/Source" id="fileset" includes="**/*">
<containsregexp expression="dg" />
</fileset>
Convert that fileset to a string that contains the filenames in the fileset:
<pathconvert pathsep="--" property="files_path" refid="fileset" />
Set the property if the filename string is longer then 0:
<condition property="prop_from_condition" value="true">
<length string="${files_path}" trim="true" when="greater" length="0" />
</condition>
So, is this the best way to set a property to true if a directory tree
contains a file that matches a RegEx? Is there a better way?
Thanks
JDG
PS: I'm limited by my current environment to ant 1.6.5.
--
Jay Dickon Glanville
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]