ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Franzen" <nfran...@gmail.com>
Subject Re: using symlink on filesets
Date Thu, 03 Aug 2006 15:15:33 GMT
On 8/3/06, Dominique Devienne <ddevienne@gmail.com> 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"/>
    <sequential>
      <apply executable="ln" dest="@{destdir}"  dir="@{destdir}">
        <arg value="-s"/>
        <arg value="-f"/>
        <arg value="--backup"/>
        <mapper type="flatten"/>
        <fileset refid="@{fsRefid}"/>
      </apply>
    </sequential>
  </macrodef>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message