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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -