ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bailey, Darragh" <>
Subject Set property using part of a filename
Date Thu, 12 Aug 2010 18:31:48 GMT

Basically I'm looking to extract the version of a package file from the filename. So far I've
come up with the following, but I'm just wondering if this is the best way to accomplish what
I want, given that it seems a bit of a kludge to use the pathconvert task to extract a string
from filenames and put it in a property.

<pathconvert property="project.version.full" >
    <fileset dir="${src.dir}" >
      <include name="**/*.rpm" />
      <exclude name="**/*debuginfo*.rpm" />
      <replaceregex pattern="${}-(.+)\.(.+)\.rpm" replace="\1"/>

Darragh Bailey

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message