org.apache.tools.ant.BuildListen with AntLaunchConfigurationType [message #211081] |
Mon, 15 March 2004 01:34  |
Eclipse User |
|
|
|
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 11:28  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02268 seconds