2009年2月23日星期一

Check directories and files existence in Ant

Well, it's common to check whether a directory or file exists before using it in Ant scripts. I just did some quick searches and find out a general solution in here.

Taks <available>is used.

Just copy from that post.

<available file=\"${your.file.path.here}\" property=\"your.file.path.here.present\"/>

<if>
<equals arg1=\"${your.file.path.here.present}\" arg2=\"true\"/>
<then>
</then>
<else>
</else>
</if>

没有评论:

Technology changes life