ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Schmetzer" <...@exubero.com>
Subject Re: Help... how to get a value from Java and pass it to another Target in ANT
Date Thu, 12 Mar 2009 08:32:08 GMT
Hi Shylendran,

The <exec> task has the output and output outputproperty attributes. If
you get your Java program to write the data you need to stdout, the text
will appear there.

Alternatively, you could get your Java program to write a properties file
to the filesystem, and in then later use the Ant <property> task to pick
up the value that way.

Cheers,
Joe

On Thu, March 12, 2009 6:38 am, Shylendran C wrote:
> Hi All,
> Could you please help on this problem???
>
> My requirement is
> In my Java file, I have a method and it will return a value as String. I
> have to get it from ANT script (build.xml) and after that I want to pass
> this to another <target>
>
> *See below code - build.xml*
>
>     <target name="htmlCreation" depends="jar">
>         <java jar="${jar.dir}/HtmlCreation.jar" fork="true"/>
>     </target>
>
>     <target name="main" depends="htmlCreation">
>         <exec executable="${browser}" spawn="true">
>         <arg value="HOW TO GET IT FROM JAVA"/>
>         </exec>
>     </target>
>
>
> Thanks & Regards
> Shylendran.C



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


Mime
View raw message