Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant 如何为属性的位置属性使用全局模式?_Ant_Properties_Design Patterns - Fatal编程技术网

Ant 如何为属性的位置属性使用全局模式?

Ant 如何为属性的位置属性使用全局模式?,ant,properties,design-patterns,Ant,Properties,Design Patterns,我想将属性设置为文件名,我知道该文件名的模式将匹配唯一的文件。例如,我有一个文件: 插件/doc.en_20110608.zip 我在ant文件中定义: 我知道模式只匹配一个文件。问题是ant此时不尝试匹配任何模式,并且失败了,因为没有名为plugins/doc.en.*.zip的文件 如果我没有使用文件集,那是因为在不允许使用文件集的地方可以替换属性,比如zip任务的destfile属性 我认为答案是否定的,但您可以使用将文件集“字符串化”到属性中。比如: <fileset id="d

我想将属性设置为文件名,我知道该文件名的模式将匹配唯一的文件。例如,我有一个文件:

插件/doc.en_20110608.zip

我在ant文件中定义:

我知道模式只匹配一个文件。问题是ant此时不尝试匹配任何模式,并且失败了,因为没有名为
plugins/doc.en.*.zip
的文件

如果我没有使用文件集,那是因为在不允许使用文件集的地方可以替换属性,比如zip任务的destfile属性


我认为答案是否定的,但您可以使用将文件集“字符串化”到属性中。比如:

<fileset id="doc.zip.fs" dir="plugins" includes="doc.en_*.zip"/>
<property name="doc.zip" value="${toString:doc.zip.fs}" />

只是一个警告:property doc.zip只包含文件名,而不包含完整位置。改为使用location=“plugins/${toString:doc.zip.fs}”。