如何在 Ant 的可用命令中使用通配符 [英] How to use wildcard in Ant's Available command
问题描述
我正在使用 Ant 构建脚本来整理基于 Eclipse 的应用程序以进行分发.
I'm using an Ant build script to collate my Eclipse-based application for distribution.
构建的一个步骤是检查构建文件夹中是否存在正确的库.我目前为此使用 Ant 命令.不幸的是,每次切换到新的 Eclipse 版本时我都必须修改脚本(因为版本号会更新).
One step of the build is to check that the correct libraries are present in the build folders. I currently use the Ant command for this. Unfortunately, I have to amend the script each time I switch to a new Eclipse build (since the version numbers will have updated).
我不需要检查版本号,我只需要检查文件是否在那里.
I don't need to check the version numbers, I just need to check that the file's there.
那么,我该如何检查:
org.eclipse.rcp_3.5.0.*
代替:
org.eclipse.rcp_3.5.0.v20090519-9SA0FwxFv6x089WEf-TWh11
使用蚂蚁?
干杯,伊恩
推荐答案
You mean, something like (based on the pathconvert task, after this idea):
<target name="checkEclipseRcp">
<pathconvert property="foundRcp" setonempty="false" pathsep=" ">
<path>
<fileset dir="/folder/folder/eclipse"
includes="org.eclipse.rcp_3.5.0.*" />
</path>
</pathconvert>
</target>
<target name="process" depends="checkEclipseRcp" if="foundRcp">
<!-- do something -->
</target>
这篇关于如何在 Ant 的可用命令中使用通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!