Antを使用して javac タスクを実行しており、レポート目的で-Xstdoutコンパイラ引数を使用してログ ファイルに出力を送信していますが、hudson がオンスクリーン レビュー用にキャプチャできるように、出力も引き続きコンソールに送信したいと考えています。
これを行う方法はありますか?
レコーダータスクを使用して別の代替手段に出くわしました。新しいターゲットを導入する必要がないため、より近くに。
<compile >
<record name="log.txt" action="start"/>
<javac ...
<record name="log.txt" action="stop"/>
<compile/>
出力属性を持つantタスクを使用して、javacタスクを持つターゲットを呼び出します。
例えば
<target name="javac" depends="libs" description="Compile java source">
<mkdir dir="${classes.dir}" />
<ant target="actual-javac" output="javac.log"/>
</target>
<target name="actual-javac">
<javac .../>
</javac>
</target>
コマンドラインの任意のプロセスで tee を使用して、コンソールとファイルに出力できます。
>myprocess.sh | tee myprocess.log
myprocess.sh の出力をコンソールと myprocess.log の両方に出力します。