Bug 29271 - External tools ant output always goes to the console
Summary: External tools ant output always goes to the console
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-10 03:41 EST by ulrich köster CLA
Modified: 2003-02-01 11:14 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulrich köster CLA 2003-01-10 03:41:55 EST
An ant launch confuration allways logs to the console.

Here is a short brief what I do:

1. New config:
ILaunchConfigurationType type =
				manager.getLaunchConfigurationType(
					IExternalToolConstants.ID_ANT_LAUNCH_CONFIGURATION_TYPE);
workingCopy = type.newInstance(null, name);
Comment 1 ulrich köster CLA 2003-01-10 03:46:51 EST
2. .......... set other options.


3. In my case there is no need to log the output to the console: (There is no
need to add this stuff, both attributes are null per default.)
			workingCopy.setAttribute(
				IExternalToolConstants.ATTR_SHOW_CONSOLE,
				(String) null);
			workingCopy.setAttribute(
				IExternalToolConstants.ATTR_CAPTURE_OUTPUT,
				(String) null);

4. When I launch the config:
configuration.launch(mode, monitor);

The build is done correctly but the output goes to the console. But the defaults
are no capture no console.
Comment 2 Darin Swanson CLA 2003-01-10 16:19:20 EST
Consider for 2.1 (time permitting).
Do in conjuction with bug 27805.

Current workaround is to specify -quiet for the Ant build.
Comment 3 Darin Wright CLA 2003-01-28 13:21:03 EST
This can be done in the ant launch delegate simply by honoring the 
ATTR_CAPTURE_OUTPUT attribute. If the attribute is false (should be true by 
default), then do not assign a build logger to the AntRunner.

The "show console" attribute is now a duplicate, and should be deprecated or 
removed. The preference is now controlled by the debug preference "Debug -> 
Console -> Show when program writes to standard out/error".
Comment 4 Darin Wright CLA 2003-01-28 13:28:10 EST
For the case of a program, a process is created, which currently does not 
support suppression of output. We could define a new process attribute in 
IProcess that indicates if output should be captured. The default setting is to 
capture output. The attribute can be passed into the process on creation, via 
the map in the factory method DebugPlugin.newProcess(ILaunch, Process, String, 
Map). 

Even when output is not to be captured, the process should still read output 
from the processs as it runs (as some processes will block if their output is 
not read). However the process should return "null" to #getStreamsProxy in this 
case.
Comment 5 Darin Swanson CLA 2003-01-28 13:51:54 EST
I believe this will involve more work on the Ant side as well.
The org.apache.ant will add a default build logger for use if we do not assign 
one. We need to make a "null" logger for the ant build (which we used to have 
but deleted...maybe can be resurrected).
Comment 6 Darin Swanson CLA 2003-01-30 14:11:58 EST
I have resurrected the NullBuildLogger.
Comment 7 Jared Burns CLA 2003-01-30 14:37:29 EST
I can understand the desire to not have the console pop up when output appears
(and we currently support this), but is there really a use case for not
capturing the output at all?
Comment 8 Jared Burns CLA 2003-01-30 15:38:28 EST
Bug 27805 describes a case where this is useful. Since we can't selectively
disable the "Show when..." options for the console, this is the only way to
prevent the console from popping up for specific configs.
Comment 9 Jared Burns CLA 2003-01-30 16:36:36 EST
Implemented. The option to capture output can now be configured on all external
tool launch configs.

Please verify, DarinW.
Comment 10 Darin Wright CLA 2003-01-30 21:08:30 EST
Does not work for programs
Comment 11 Jared Burns CLA 2003-01-30 21:37:14 EST
D'oh. The buildlogger fix only applies to Ant tools types. The option
shouldn't have appeared on all external tools, only Ant configs

Fixed. Please verify.
Comment 12 ulrich köster CLA 2003-02-01 10:59:46 EST
I`ve tried it with the current nightly build. No output :-) Thanks.
Comment 13 Darin Wright CLA 2003-02-01 11:14:40 EST
Verified