ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Franzen" <>
Subject Re: using symlink on filesets
Date Thu, 03 Aug 2006 15:15:33 GMT
On 8/3/06, Dominique Devienne <> wrote:
> > And as far as I know, there is no reasonable iterator or foreach way
> > to wrap up a single symlink task within the fileset.
> There is. Ant-Contrib's excellent <for> task. But in your case, since
> <symlink> is forking's the OS's ln command anyway, I'd use <apply
> executable="ln">, which is an implicit for-loop, works with fileset,
> and should give you enough control on the command line. --DD

Super!  Thanks very much.  So the task I want turns out to be:

  <macrodef name="symlinkFileset">
    <attribute name="fsRefid"/>
    <attribute name="destdir"/>
      <apply executable="ln" dest="@{destdir}"  dir="@{destdir}">
        <arg value="-s"/>
        <arg value="-f"/>
        <arg value="--backup"/>
        <mapper type="flatten"/>
        <fileset refid="@{fsRefid}"/>

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

View raw message