ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Tar and exec problem
Date Thu, 08 May 2003 08:57:48 GMT
On Wed, 7 May 2003, Praveen Shenoy <pshenoy1/> wrote:
>   <target name="all" depends="copy_files">
>              <exec dir="${build.root}/deploy/shopping" 
> executable="/bin/sh" failonerror="true" >
>              <arg line="tar -cvf ../../ship/package/fedeploy.tar *">
>              </arg>
>          </exec>

This would rather be

   <exec dir="${build.root}/deploy/shopping" 
         executable="/bin/sh" failonerror="true">
       <arg value="-c"/>
       <arg value="tar -cvf ../../ship/package/fedeploy.tar *"/>

You must tell the shell to execute the following stuff as command
(that's the -c) and the rest must be a single argument (that's why I
changed the line attribute to value).

BTW, you could use <apply> instead of <exec>, not use wildcards at all
and let Ant find the files for you.

  <apply executable="tar" dir="${build.root}/deploy/shopping"
         parallel="true" relative="true" failonerror="true">
     <arg value="-cvf">
     <arg file="${build.root}/ship/package/fedeploy.tar"/>

     <fileset dir="${build.root}/deploy/shopping"

should be exactly the same as the <exec> above but without using the
shell to expand the wildcard.


View raw message