Search code examples
antjavac

How to make javac compiler write the output to both file and console?


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?


Solution

  • 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/>