Community
Participate
Working Groups
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); ]
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.
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.