如何在 Ant 的可用命令中使用通配符 [英] How to use wildcard in Ant's Available command

查看:29
本文介绍了如何在 Ant 的可用命令中使用通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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屋!

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