Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6-beta-1
-
Component/s: Ant integration
-
Labels:None
-
Number of attachments :
Description
There is a problem in AntBuilder - output from some tasks is not redirected to Ant, but is stilll printed out to STDERR.
Thus it is impossible to use Ant logging subsystem to redirect output to log file.
For instance, javac warnings are printed directly to console (actually, to STDERR).
Ant itself uses DemuxOutputStream for STDOUT and STDERR redirection.
AntBuilder uses DemuxInputStream for input handling, but it does not redirect output streams.
Consider the following sample:
CompilationWarning is java class that forces javac to print warnings to stderr.
Let's look how Ant handles stderr:
$ ant 1>out.log 2>err.log
out.log:
----------
Buildfile: build.xml
compile:
[javac] Compiling 1 source file to L:\111\2008-06-05\Demo
[javac] Note: L:\111\2008-06-05\Demo\CompilationWarning.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
BUILD SUCCESSFUL
Total time: 4 seconds
----------
err.log - empty
Then let's look how AntBuilder handles stderr:
$ groovy Build.groovy 1>out.log 2>err.log
out.log:
----------
[javac] Compiling 1 source file to L:\111\2008-06-05\Demo
----------
err.log:
----------
Note: L:\111\2008-06-05\Demo\CompilationWarning.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
----------
Here you can see AntBuilder does not redirect StdErr to StdOut, while Ant does.
It makes hard to redirect output, generated by AntBuilder's tasks, to logging system.