我有问题测试文件存在与蚂蚁。我想检查目标文件是否存在test
,如果不存在,我想下载目标文件download
。但是download
目标将始终执行(如果文件存在或不存在)。任何人都可以显示什么是错的?蚂蚁资源存在检查
<!-- Test lib files if exist -->
<target name="test">
<condition property="is.resource.exists" value="true" else="false">
<and>
<resourceexists>
<file file="${lib}/jdom-2.0.5.jar" />
</resourceexists>
<resourceexists>
<file file="${lib}/miglayout-4.0-swing.jar" />
</resourceexists>
</and>
</condition>
</target>
<!-- Download lib files if not exist -->
<target name="download" if="is.resource.exists" depends="test">
<exec dir="${lib}" executable="${lib}/get-libs.sh" />
</target>
这是否修复雅http://stackoverflow.com/a/520567/1083581 – happybuddha 2013-05-06 21:30:46
这一个讲述多个文件:http://stackoverflow.com/questions/15698694/check-multiple-file-exists-or- not-using-ant – 2013-05-06 21:35:43