Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set ant property by invoking a shell script?

Tags:

properties

ant

Is there any way to set an ant property by capturing the output of a shellscript? (or another ant task)

Something like this:

<property name="foo">
    <value>
        <exec executable="bar" />
    </value>
</property>

Thanks!

like image 373
Nim Avatar asked Sep 11 '12 07:09

Nim


2 Answers

It seems that exec task has an outputproperty-property, like so:

<exec executable="bar" outputproperty="foo" />
like image 187
Nim Avatar answered Feb 16 '23 06:02

Nim


From the ANT exec task

  1. Set the output attribute : Name of a file to which to write the output.
  2. As Marble has suggested - set the outputproperty

When I tested they came out to be mutually exclusive. So set only 1 of them at a time.

like image 24
Pulak Agrawal Avatar answered Feb 16 '23 05:02

Pulak Agrawal