ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: capture java output to variable
Date Wed, 01 Jun 2005 17:37:30 GMT
--- Srikrishna_Parthasarathy@timeinc.com wrote:

> Hello Matt
> 
> I am kind of new to Ant. Can you explain with an
> example ?

Please keep communications on the list for the benefit
of the community.  As for an example of I/O
redirection, be sure to read the "I/O redirectors"
page accessible in the Ant manual under "Concepts and
types".  Now, you can capture the output of the java
task to a property in this way:

<java outputproperty="outputproperty"
classname="whatever" />

The following is equivalent:

<java classname="whatever">
  <redirector outputproperty="outputproperty" />
</java>

To add filtering:

<java classname="whatever">
  <redirector outputproperty="outputproperty">
    <outputfilterchain>
      <trim /> <!-- remove all blank lines -->
    </outputfilterchain>
  </redirector>
</java>

HTH,
Matt

> 
> Thanks
> srikrishna
> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> Sent: Wednesday, June 01, 2005 11:16 AM
> To: Ant Users List
> Subject: Re: capture java output to variable
> 
> 
> --- Matt Benson <gudnabrsam@yahoo.com> wrote:
> > --- Mark Lybarger <mlybarger@gmail.com> wrote:
> > > the output property contains more than i'd like.
> > how
> > > can i "substring" the 
> > > output?
> > 
> > In addition to ant-contrib's propertyregex
> mentioned
> > elsewhere, when using <java>, <exec>, or <apply>
> you
> > can use a nested I/O <redirector> with filtering.
> 
> In Ant >= 1.6.2, that is.
> 
> -Matt
> 
> > 
> > -Matt
> > 
> > > 
> > > On 5/26/05, Dominique Devienne
> > <ddevienne@gmail.com>
> > > wrote:
> > > > 
> > > > How about <java outputproperty>? --DD
> > > >
> > > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > http://mail.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> > 
> 
> 
> 		
> __________________________________ 
> Discover Yahoo! 
> Use Yahoo! to plan a weekend, have fun online and
> more. Check it out! 
> http://discover.yahoo.com/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



		
__________________________________ 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html

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


Mime
View raw message