How to use a glob pattern for a location attribute of a property?
I want to set a property to a filename, for which I know a pattern that will match a unique file. For example, I have the file:
plugins/doc.en_20110608.zip
I define in my ant file:
<property name="doc.zip" location="plugins/doc.en_*.zip" />
I know the pattern will match only one file. The problem is that ant doesn't try to match any pattern at this point, and fails because there is no file named plugins/doc.en_*.zip
.
If I'm not using a fileset, it's because the property can be substituted where a fileset is not allowed, like destfile attribut开发者_JS百科e of zip task.
<zip destfile="${doc.zip}" update="true"> ... </zip>
The answer is no I think, but you can use reference/path shortcuts to 'stringify' a fileset into a property. Something like:
<fileset id="doc.zip.fs" dir="plugins" includes="doc.en_*.zip"/>
<property name="doc.zip" value="${toString:doc.zip.fs}" />
精彩评论