Ant check if a directory (and sub directories) contains a certain file -


i'm trying check in ant if directory (and sub directories) contains file

i'm using ant contrib :

<if>   <available>     <filepath>       <fileset dir="mydir">         <include name="**/*.aef" />       </fileset>     </filepath>   </available> <then>   <fail/> </then> </if> 

i want fail if there @ least file ending "aef" in mydir or 1 of sub-directories. fails if no "*.aef" file found

this should job, without need of ant-contrib:

<fail message="at least 1 .aef file found">   <condition>     <resourcecount when="greater" count="0">       <fileset dir="mydir" includes="**/*.aef" />     </resourcecount>   </condition> </fail> 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -