Ant任务运行Ant目标只有文件是否存在? [英] Ant task to run an Ant target only if a file exists?

查看:135
本文介绍了Ant任务运行Ant目标只有文件是否存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有将执行只有一个给定的文件存在一个块一个Ant任务?我有,我有一个通用的ant脚本应该做一些特殊处理,但问题只有在特定的配置文件是present。

Is there an ANT Task that would execute a block only if a given file exists? I have the problem that I have a generic ant script that should do some special processing but only if a specific configuration file is present.

推荐答案

可用并的状况

<target name="check-abc">
    <available file="abc.txt" property="abc.present"/>
</target>

<target name="do-if-abc" depends="check-abc" if="abc.present">
    ...
</target> 

这篇关于Ant任务运行Ant目标只有文件是否存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆