Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » org.apache.tools.ant.BuildListen with AntLaunchConfigurationType
org.apache.tools.ant.BuildListen with AntLaunchConfigurationType [message #211081] Mon, 15 March 2004 06:34 Go to next message
Martin Kuhn is currently offline Martin KuhnFriend
Messages: 49
Registered: July 2009
Member
Is it possible to use the org.apache.tools.ant.BuildListener when I run an
Ant-Task via Launch-Configuration. I know in background an AntRunner
instance is used but I don't how do add a BuildListener to AntRunner

My Code:

...

ILaunchConfigurationType type =
DebugPlugin.getDefault().getLaunchManager().getLaunchConfigu rationType( "org.eclipse.ant.AntLaunchConfigurationType");

DebugPlugin.getDefault().getLaunchManager().getLaunchConfigu rationType( "org.eclipse.ant.AntLaunchConfigurationType");
ILaunchConfigurationWorkingCopy config = null;
try {
config = type.newInstance(null, "ANT Task");
} catch (CoreException e) {}
....
config.setAttribute("org.eclipse.ui.externaltools.ATTR_ANT_TARGETS ",
antTarget);
config.setAttribute("org.eclipse.ui.externaltools.ATTR_CAPTURE_OUTPUT ",
showConsole);
config.setAttribute("org.eclipse.ui.externaltools.ATTR_LOCATION ",
buildFileLocation);
config.setAttribute("org.eclipse.ui.externaltools.ATTR_SHOW_CONSOLE ",
showConsole);
config.setAttribute("org.eclipse.ui.externaltools.ATTR_ANT_PROPERTIES ",
propMap);

Please help

TIA Martin
Re: org.apache.tools.ant.BuildLister with AntLaunchConfigurationType [message #211364 is a reply to message #211081] Mon, 15 March 2004 16:28 Go to previous message
Darin Swanson is currently offline Darin SwansonFriend
Messages: 2386
Registered: July 2009
Senior Member
There are several ways to do this.
The easiest is:
AntRunner.addBuildListener(String)

Using the configuration you specify

config.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMEN TS, arguments);
where arguments would look like:
"-listener your.listener.type.BuildListener"

HTH
Darins

"Martin Kuhn" <martin.kuhn@gmx.at> wrote in message
news:c33ipb$lkv$1@eclipse.org...
> Is it possible to use the org.apache.tools.ant.BuildListener when I run an
> Ant-Task via Launch-Configuration. I know in background an AntRunner
> instance is used but I don't how do add a BuildListener to AntRunner
>
> My Code:
>
> ..
>
> ILaunchConfigurationType type =
>
DebugPlugin.getDefault().getLaunchManager().getLaunchConfigu rationType( "org.
eclipse.ant.AntLaunchConfigurationType");
>
>
DebugPlugin.getDefault().getLaunchManager().getLaunchConfigu rationType( "org.
eclipse.ant.AntLaunchConfigurationType");
> ILaunchConfigurationWorkingCopy config = null;
> try {
> config = type.newInstance(null, "ANT Task");
> } catch (CoreException e) {}
> ...
> config.setAttribute("org.eclipse.ui.externaltools.ATTR_ANT_TARGETS ",
> antTarget);
> config.setAttribute("org.eclipse.ui.externaltools.ATTR_CAPTURE_OUTPUT ",
> showConsole);
> config.setAttribute("org.eclipse.ui.externaltools.ATTR_LOCATION ",
> buildFileLocation);
> config.setAttribute("org.eclipse.ui.externaltools.ATTR_SHOW_CONSOLE ",
> showConsole);
> config.setAttribute("org.eclipse.ui.externaltools.ATTR_ANT_PROPERTIES ",
> propMap);
>
> Please help
>
> TIA Martin
>
>
Previous Topic:Strange Behavior on "Open Declaration"
Next Topic:How to use findMenuUsingPath(argument)?again
Goto Forum:
  


Current Time: Mon Nov 04 22:41:59 GMT 2024

Powered by FUDForum. Page generated in 0.03445 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top