You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Patrick Waugh <pt...@gmail.com> on 2008/11/22 18:58:20 UTC

Can't get output of exec to property

Hi,

This is what I'm trying to to:

	<!-- Get Hg Revision -->
    <target name="id" description="Get the current hg revision">
        <exec executable="hg" output="hg.txt" outputproperty="hg">
        	<arg value="id" />
        	<arg value="-i" />
    	</exec>
    	<echo message="hg = ${hg}" />
    </target>

The output is coorrect in the text file, same as the command:

patrick@berrysoft:~/repo/dib/dib_8800$ hg id -i
c75f860db478+

but the "echo" during the build shows this:

id:
     [echo] hg =
[propertyfile] Updating property file:
/home/patrick/repo/dib/dib_8800/build.properties

In other words, the property is never getting set!  What am I missing????

Thanks, patrick

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


Re: Can't get output of exec to property

Posted by Patrick Waugh <pt...@gmail.com>.
Not sure how exactly, but I fixed it and it works now.

Basically, I changed hg.rev to "revision" and it seems that was the problem.

Patrick

On Sat, Nov 22, 2008 at 11:58 AM, Patrick Waugh <pt...@gmail.com> wrote:
> Hi,
>
> This is what I'm trying to to:
>
>        <!-- Get Hg Revision -->
>    <target name="id" description="Get the current hg revision">
>        <exec executable="hg" output="hg.txt" outputproperty="hg">
>                <arg value="id" />
>                <arg value="-i" />
>        </exec>
>        <echo message="hg = ${hg}" />
>    </target>
>
> The output is coorrect in the text file, same as the command:
>
> patrick@berrysoft:~/repo/dib/dib_8800$ hg id -i
> c75f860db478+
>
> but the "echo" during the build shows this:
>
> id:
>     [echo] hg =
> [propertyfile] Updating property file:
> /home/patrick/repo/dib/dib_8800/build.properties
>
> In other words, the property is never getting set!  What am I missing????
>
> Thanks, patrick
>

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