ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Ficker <>
Subject Re: checksum task: how can you use hash in a separate directory
Date Wed, 13 Feb 2008 22:13:53 GMT

pathconvert  can be used to perform "String manipulation" on filesets or

The following would echo a linebreak seperated list of the files:

       (append after the  previous example)
        <pathconvert property ="result.prop" refid="result"
            <globmapper from="${basedir}/checksums/*.MD5"

For further  manipulation as a fileset you could pathconvert to a comma
seperated list an stuff it back into a fileset.
For example to copy the changed files to backupDir:

        <pathconvert property="backup.prop" refid="result" pathsep=",">
            <globmapper from="${basedir}/checksums/*.MD5" to="*"/>
        <copy todir="backupDir">
           <fileset dir="src" includes="${backup.prop}"/>

I don't know of o easier way to convert pathes into filesets.  

Best regards


Bill Milbratz schrieb:
> Hi all,
> Thanks for the resposnes. Martin, that's an elegant example and belongs in
> the ant documentation.
> As a follow up to Martin's example:
> once you have the list of 'result" files (which lists all the .md5 files
> which differ), how in ant can you generate a list of the *original* files.
> i.e. so you can send a message telling the user that he changed
> 'src/jsp/foo.jsp' and not just that 'checksums/jsp/foo.jsp.md5' doesn't
> match 'newchecksums/jsp/foo.jsp.md5'
> Or better yet, so that your ant target can "act on those changes", i.e. and
> backup src/jsp/foo.jsp before overwriting it....
> This may simply be an exercise in string manipulation with Ant or "advanced
> use of filesets",
> thanks,
> bill

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

View raw message