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
Post a Comment