Bug 18161 - [ExternalTools] API to access Log Console for Ant output needs to be exposed
Summary: [ExternalTools] API to access Log Console for Ant output needs to be exposed
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Simon Arsenault CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks:
 
Reported: 2002-05-29 09:06 EDT by Marco Mulder CLA
Modified: 2002-09-18 13:59 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Mulder CLA 2002-05-29 09:06:57 EDT
20020521

I use AntRunner to execute Ant tasks from our buildfile editor. I want the Ant
output to appear on the Log Console in the same way as would happen when
executing Ant tasks from External Tool config or "Run Ant..." context menu item.
I do this with the code below.

Two problems:
- ToolUtil is not publicly available
- The constant AntFileRunner.LOGGER_CLASS is not publicly available

[
AntRunner runner = new AntRunner();
runner.setBuildFileLocation(buildFileLocation);
runner.setExecutionTargets(targetNames);
runner.addBuildLogger("org.eclipse.ui.externaltools.internal.ui.ant.AntBuildLogger");
J9Plugin.getDisplay(getShell()).syncExec(new Runnable() {
	public void run() {
		ToolUtil.clearLogDocument();
		ToolUtil.showLogConsole(getSite().getWorkbenchWindow());
	}
});
runner.run(monitor);
]
Comment 1 Simon Arsenault CLA 2002-05-30 13:45:26 EDT
Nothing in the external tools plug-in is public for release 2.0 There is not 
enough time for us to properly decide what should be made public.

You could also consider creating an instance of ExternalTool and 
DefaultRunnerContext to execute the Ant build file. It will take care of all of 
this for you. Of course, it is not API also.
Comment 2 Simon Arsenault CLA 2002-09-06 14:57:13 EDT
In the new external tool support, you should create and setup an ExternalTool 
(now api) and use the run external tool action (now api).

Note: new external tool work is not yet released to the head stream and won't 
for a while yet.