You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by altern <al...@bigmir.net> on 2009/09/28 18:12:04 UTC
Setting ant property with bash command result
How could I set ant property the value which is the result of bash script
execution? For example, I need to have target which utilizes svn and bash
utilities in order to control build execution. Speaking more specifically,
target that I'm trying to create will be used to define, whether there are
modified files in deployed application via command:
svn stat | awk -F '' ' $1=="A" || $1 == "C" || $1=="M" || $1 == "D" || $1
== "R"
--
View this message in context: http://www.nabble.com/Setting-ant-property-with-bash-command-result-tp25646616p25646616.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Setting ant property with bash command result
Posted by supareno <re...@free.fr>.
altern a écrit :
> How could I set ant property the value which is the result of bash script
> execution? For example, I need to have target which utilizes svn and bash
> utilities in order to control build execution. Speaking more specifically,
> target that I'm trying to create will be used to define, whether there are
> modified files in deployed application via command:
>
> svn stat | awk -F '' ' $1=="A" || $1 == "C" || $1=="M" || $1 == "D" || $1
> == "R"
>
altern,
i don't really understand the command but did you try "| xargs" like this
svn stat <your_svn_project> | awk -F '' ' $1=="A" || $1 == "C" ||
$1=="M" || $1 == "D" || $1 == "R"' | xargs -t -i ant -Dsrc='{}'
the xargs command will launch your ant build file with the result of the
awk command as property for src....
i tried with this build file and it works ;-)
<project name="fooProject" default="echoproperty" basedir=".">
<description>
simple example build file launched with xargs
</description>
<!-- set global properties for this build -->
<property name="src" value=""/>
<target name="echoproperty">
<echo>the property send to the build file is: ${src}</echo>
</target>
</project>
more links on xargs:
http://sidvind.com/wiki/Xargs_by_example
http://en.wikipedia.org/wiki/Xargs
http://www.computerhope.com/unix/xargs.htm
hope this help
supareno
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org