Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ant-dev] Problem with AntRunner...

Vincent,

I can't reproduce your problem...but you did not tell me what build you are
working on?

I created a plugin (using the PDE Plugin development project wizard; Hello,
world sample).
I then set that plugin to require the Ant Core plugin. In the
SampleAction#run method I pasted your code.
Worked fine when I invoked the action.

Does you plugin specify that it requires the Ant Core plugin?

Ant Core plugin is not deprecated...external tools and ant are just trying
to work
together to provide the "best" for all

Darins


|---------+---------------------------------->
|         |           "Vincent Massol"       |
|         |           <vmassol@xxxxxxxx>     |
|         |           Sent by:               |
|         |           platform-ant-dev-admin@|
|         |           eclipse.org            |
|         |                                  |
|         |                                  |
|         |           10/23/02 07:05 AM      |
|         |           Please respond to      |
|         |           platform-ant-dev       |
|         |                                  |
|---------+---------------------------------->
  >--------------------------------------------------------------------------------------------------------|
  |                                                                                                        |
  |        To:      <platform-ant-dev@xxxxxxxxxxx>                                                         |
  |        cc:      <jru@xxxxxxxx>                                                                         |
  |        Subject: [platform-ant-dev] Problem with AntRunner...                                           |
  >--------------------------------------------------------------------------------------------------------|



Hi,

I'd like to execute an Ant script programmatically from a plugin I am
writing. I have followed the online documentation and here is my code
snippet:

                         AntRunner runner = new AntRunner();
                         runner.setBuildFileLocation(
                                     "path/to/build.xml");
                         runner.setArguments("-Dmessage=Building
-verbose");
                         try {
                                     runner.run();
                         }
                         catch (Exception e) {
                                     e.printStackTrace();
                         }

When I run it I get a NPE. Debugging shows that the NPE comes from the
following line in AntRunner:

ClassLoader loader = AntCorePlugin.getPlugin().getClassLoader();

The problem is that AntCorePlugin.getPlugin() returns null, which seems
to mean that the AntCorePlugin was not initialized in the workbench.

I can see an "Ant Build Tool Core" in the list of loaded plugins? Is
that this one? One many Ant plugins are there? Does it have to do with
the fact that Ant was moved to be an external tool? If so, does it mean
the AntCorePlugin is now deprecated? If so, how can I now call an Ant
script programatically?

Thanks a lot!
-Vincent



_______________________________________________
platform-ant-dev mailing list
platform-ant-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ant-dev






Back to the top