ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: for task with inline exec?
Date Mon, 20 Aug 2007 13:33:12 GMT
Why not use shellscript?
  <typedef uri="antlib:net.sf.antcontrib">
    <classpath>
      <fileset dir="${user.home}/apps/ant-contrib" includes="*.jar"/>
    </classpath>
  </typedef>
  <typedef uri="antlib:net.sf.antcontrib">
    <classpath>
      <fileset dir="${user.home}/apps/ant-contrib" includes="*.jar"/>
    </classpath>
  </typedef>

    <ac:shellscript shell="bash" outputproperty="form.list">
      cat deploy.properties | grep .js-version| sed
s/.js-version=v.[0-9]*/,/g | tr -d '\n' | sed s/,$//g
    </ac:shellscript>
    <echo>Form list: ${form.list}</echo>

Peter

On 8/20/07, Vihan Pandey <vihanpandey@gmail.com> wrote:
> > Have you tried execs outputproperty or redirectors?
>
> I'm having some trouble getting the pipes within the arg line :
>
> i.e
> ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
> <exec executable="cat">
>     <arg value="${deployroot}/deploy.properties" />
>     <redirector outputproperty="redirector.out">
>         <outputmapper type="merge" to="redirector.out"/>
>     </redirector>
> </exec>
>
> <echo message="this is ${redirector.out}" />
> ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
>
> will show me all of the contents of my deploy.properties
>
> But something like this :
>
> ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
> <exec executable="cat">
>     <arg value="${deployroot}/deploy.properties" />
>     <arg value="|" />
>     <arg value="/bin/gerp .js" />
>     <redirector outputproperty="redirector.out">
>         <outputmapper type="merge" to="redirector.out"/>
>     </redirector>
> </exec>
>
> <echo message="this is ${redirector.out}" />
> ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
>
> fails.
>
> I tried arg line via bash :
>
> ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
> <exec executable="/bin/bash">
>   <arg line='-f "cat ${deployroot}/deploy.properties | grep .js | sed
> s/.js-version=v.[0-9]*/,/g | tr -d \n"' />
>     <redirector outputproperty="redirector.out">
>         <outputmapper type="merge" to="redirector.out"/>
>     </redirector>
> </exec>
>
> <echo message="this is ${redirector.out}" />
> ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
>
> that gives a no "No such file or directory"
>
> If i try :
>
> ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
> <exec executable="/bin/cat">
>   <arg line="${deployroot}/deploy.properties | /bin/grep .js |
> /bin/sed s/.js-version=v.[0-9]*/,/g | tr -d '\n' " />
>     <redirector outputproperty="redirector.out">
>         <outputmapper type="merge" to="redirector.out"/>
>     </redirector>
> </exec>
> ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
>
> This fails as well.
>
> Any suggestions?
>
> Regards,
>
> - vihan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message