如何使javac编译器将输出写入文件和控制台? [英] How to make javac compiler write the output to both file and console?

查看:125
本文介绍了如何使javac编译器将输出写入文件和控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ant 运行javac任务,并且出于报告目的,我使用 -Xstdout 编译器参数将输出发送到日志文件中,但是我希望输出也仍然发送到控制台,以便hudson可以捕获它以便在屏幕上查看.

I am running javac task using ant and I send the output to a log file using -Xstdout compiler argument for reporting purposes, but I would like the output also still being send to the console so hudson can capture it for on screen review.

有没有办法做到这一点?

Is there a way for this to be done?

推荐答案

只是使用记录器任务遇到了另一种选择. 不必再引入新的目标了.

Just came across another alternative using the recorder task. Nearer as you don't have to introduce new targets.

<compile >
    <record name="log.txt" action="start"/>
    <javac ...
    <record name="log.txt" action="stop"/>
<compile/>

这篇关于如何使javac编译器将输出写入文件和控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆