You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Francis GALIEGUE <fg...@one2team.com> on 2009/12/02 10:54:44 UTC
Recording tasks output while silencing stdout
Hello everyone,
I have a system which works OK, but now I want to go a step further
and record the output to log files but silence stdout. In fact, I want
to obtain something like the KBuild output which just outputs some
things like:
CC somefile.o
CC someotherfile.o
LINK libsomething.o
ant -emacs hides the [taskname], which is good. But I cannot obtain
the tasks themselves to go silent, which I don't want. I know how to
record the output using the <record> task. I know I could also use
<exec> and record the output, but I'd like to avoid that...
I can already silence <cvs> with reallyquiet=true, but I cannot
silence any other tasks. Here is an example of what I'd like to
silence:
<target name="copy-sources" depends="download">
<mkdir dir="${flat.sources}"/>
<for list="${modulelist}" param="module">
<sequential>
<if>
<available file="${cvsdir}/@{module}/src" type="dir"/>
<then>
<copy todir="${flat.sources}" includeemptydirs="false">
<fileset dir="${cvsdir}/@{module}/src"
includes="**/*.java"/>
</copy>
</then>
</if>
</sequential>
</for>
</target>
<record> won't help, since while it will record in a file, it will
also echo to stdout...
Any hints?
--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Recording tasks output while silencing stdout
Posted by Francis GALIEGUE <fg...@one2team.com>.
On Mon, Dec 7, 2009 at 14:38, Antoine Levy Lambert <an...@gmx.de> wrote:
> Hello Francis,
>
> you might want to write your own logger, and start ant specifying your
> logger on the command line.
>
> This way, you can handle output the way you want.
>
Somehow, I feared that this was the answer :p
Well, I may as well get up to it since the "kbuild way" is gaining
steam within the C/C++ community, so why not Java ;)
Thanks,
--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Recording tasks output while silencing stdout
Posted by Antoine Levy Lambert <an...@gmx.de>.
Hello Francis,
you might want to write your own logger, and start ant specifying your
logger on the command line.
This way, you can handle output the way you want.
Regards,
Antoine
Francis GALIEGUE wrote:
> Hello everyone,
>
> I have a system which works OK, but now I want to go a step further
> and record the output to log files but silence stdout. In fact, I want
> to obtain something like the KBuild output which just outputs some
> things like:
>
> CC somefile.o
> CC someotherfile.o
> LINK libsomething.o
>
> ant -emacs hides the [taskname], which is good. But I cannot obtain
> the tasks themselves to go silent, which I don't want. I know how to
> record the output using the <record> task. I know I could also use
> <exec> and record the output, but I'd like to avoid that...
>
> I can already silence <cvs> with reallyquiet=true, but I cannot
> silence any other tasks. Here is an example of what I'd like to
> silence:
>
> <target name="copy-sources" depends="download">
> <mkdir dir="${flat.sources}"/>
> <for list="${modulelist}" param="module">
> <sequential>
> <if>
> <available file="${cvsdir}/@{module}/src" type="dir"/>
> <then>
> <copy todir="${flat.sources}" includeemptydirs="false">
> <fileset dir="${cvsdir}/@{module}/src"
> includes="**/*.java"/>
> </copy>
> </then>
> </if>
> </sequential>
> </for>
> </target>
>
> <record> won't help, since while it will record in a file, it will
> also echo to stdout...
>
> Any hints?
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org