You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by D'Arcy Smith <we...@gmail.com> on 2005/07/04 06:45:12 UTC

saving "proper" output from javac

Hi all,

I've searched on this and I am a bit stuck on how to do this...

I want to run the javac task and get the output (stdout and stderr)
saved to two different files.  I tried using the report task but I am
not able to get just stdout in one file and just stderr in another. 
Also the output has some of the ANT messages in it - I need to have
just the plain old javac messages.

I looked at using exec but that becomes painful fairly quickly.

Is it possible to do what I want (I can even live with the ANT
messages in the output and automatically strip them out - but right
now I get the error messages written to the warning file.

Here is what I tried before the javac task:

        <record name="${file.reports.javac.warnings}" 
                action="start"
                emacsmode="true"
                loglevel="info"/>
        <record name="${file.reports.javac.errors}" 
                action="start"
                emacsmode="true"
                loglevel="warn"/>

All error messages are written to both files... not what I am expecting.

Thanks,

..darcy

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


Re: saving "proper" output from javac

Posted by D'Arcy Smith <we...@gmail.com>.
I actually tweaked the report task to provide a new option "levelOnly"
that, when specified, only logs items at the particular level.  I also
wound up adding a "errorProperty" to the javac task as well so that
you do not have to have the build fail immediatly if javac fails. 
This keeps some additional failure output (stack trace) out of the
files.  Now I only get a message telling me that it is working on X
number of files but that is easy to get rid of.

Now to see about getting those changes included into the builds :-)

..darcy

On 7/4/05, Jeffrey E Care <ca...@us.ibm.com> wrote:
> Ant log level flags are cumulative, not bitwise. I'm pretty sure that
> <exec> is where you need to go for what you want to do.
> 
> --
> Jeffrey E. Care (carej@us.ibm.com)
> WebSphere Build SWAT Team Lead
> WebSphere Build Tooling Lead (Project Mantis)
> https://w3.opensource.ibm.com/projects/mantis
> 
> 
> "D'Arcy Smith" <we...@gmail.com> wrote on 07/04/2005 12:45:12 AM:
> 
> > Hi all,
> >
> > I've searched on this and I am a bit stuck on how to do this...
> >
> > I want to run the javac task and get the output (stdout and stderr)
> > saved to two different files.  I tried using the report task but I am
> > not able to get just stdout in one file and just stderr in another.
> > Also the output has some of the ANT messages in it - I need to have
> > just the plain old javac messages.
> >
> > I looked at using exec but that becomes painful fairly quickly.
> >
> > Is it possible to do what I want (I can even live with the ANT
> > messages in the output and automatically strip them out - but right
> > now I get the error messages written to the warning file.
> >
> > Here is what I tried before the javac task:
> >
> >         <record name="${file.reports.javac.warnings}"
> >                 action="start"
> >                 emacsmode="true"
> >                 loglevel="info"/>
> >         <record name="${file.reports.javac.errors}"
> >                 action="start"
> >                 emacsmode="true"
> >                 loglevel="warn"/>
> >
> > All error messages are written to both files... not what I am expecting.
> >
> > Thanks,
> >
> > ..darcy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> 
>

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


Re: saving "proper" output from javac

Posted by Jeffrey E Care <ca...@us.ibm.com>.
Ant log level flags are cumulative, not bitwise. I'm pretty sure that 
<exec> is where you need to go for what you want to do.

-- 
Jeffrey E. Care (carej@us.ibm.com)
WebSphere Build SWAT Team Lead
WebSphere Build Tooling Lead (Project Mantis)
https://w3.opensource.ibm.com/projects/mantis


"D'Arcy Smith" <we...@gmail.com> wrote on 07/04/2005 12:45:12 AM:

> Hi all,
> 
> I've searched on this and I am a bit stuck on how to do this...
> 
> I want to run the javac task and get the output (stdout and stderr)
> saved to two different files.  I tried using the report task but I am
> not able to get just stdout in one file and just stderr in another. 
> Also the output has some of the ANT messages in it - I need to have
> just the plain old javac messages.
> 
> I looked at using exec but that becomes painful fairly quickly.
> 
> Is it possible to do what I want (I can even live with the ANT
> messages in the output and automatically strip them out - but right
> now I get the error messages written to the warning file.
> 
> Here is what I tried before the javac task:
> 
>         <record name="${file.reports.javac.warnings}" 
>                 action="start"
>                 emacsmode="true"
>                 loglevel="info"/>
>         <record name="${file.reports.javac.errors}" 
>                 action="start"
>                 emacsmode="true"
>                 loglevel="warn"/>
> 
> All error messages are written to both files... not what I am expecting.
> 
> Thanks,
> 
> ..darcy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>