[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] Plugin Java class never executed
|
> I have a plugin based on the "Plugin" class that extends
> "org.eclipse.cdt.managedbuilder.core.buildDefinitions" to drive my custom
> gcc chain. When I debug it (as "Eclipse Application" with a cleared
> workspace) it works as expected i.e. my tool chain appears in the Managed
> Make C Wizard and I can create a C project that calls my tools during a
> build.
>
> However, the Java code in my plugin never gets called e.g. I have set
> breakpoints/printouts in my start and stop methods and they are never
> called/invoked. My plugin manifest file has "Bundle-Activator" set to my
> Java Class.
>
> Questions:
>
> 1. Is this by design or am I missing something ?
Its not a bug, its a feature...
So this is by design ('lazy plugin-in initialization'), at startup only the
manifest is read. Your plugin is only activated/loaded when one of its
classes/resources is actually required, and only then the 'start()' method
of your bundle activator is called. The 'Eclipse-AutoStart: true' entry
that is probably in your manifest might be confusing in that way.
There should be a way to enforce your bundle activator to be called at
startup, but you should prevent that as much as possible.
Probably you haven't hit a point in the build process in which it was
required to call one of your plugin classes. One way to check this is by
for instance subclassing the Gnu makefile generator in your plugin and
specify the subclass in your buildDefinitions extension, then at the moment
a makefile is generated your plugin should be activated.
> 2. Is there anyway to determine the currently "activated" plugins (as
> opposed to "discovered" plugins which I think is what is shown in
> Window|Show View|Other...|PDE|Plug-ins or Help|About|Plug-in details.
The 'PDE Runtime'->'Plug-in Registry' view should provide this info.
It is part of the 'org.eclipse.pde.runtime' plugin (according to
that same view;-)
Regards,
Wieant