Headless build does not resolve inter-feature dependencies [message #448564] |
Wed, 26 April 2006 11:52  |
Eclipse User |
|
|
|
Hi,
I am having problems using headless build with eclipse 3.2 (M6). It
seems like the dependencies between features are not resolved at all. As
a result the build order of features and their contained plugins is
wrong, and I get lots of
<CLASSNAME> cannot be resolved
errors, because required plugins are have not been build yet.
My setting is as follows
product <--- featurex <---+--- feature1 <------- plugin1
| | |
| |<--dependency-->|
| | |
| v v
+--- feature2 <------- plugin2
So plugin1 depends on plugin2 and that's why feature1 also depends on
feature2.
When I build the product from eclipse using the Eclipse product export
wizard on the product, everything works fine. I think that's because the
classes are already compiled in the bin folders. In the headless build
the plugin1 is compiled first and build fails, because referenced
classes from plugin2 cannot be found.
It seems like the build order of features is always alphabetically.
Inter-feature dependencies are completely ignored. Everything works fine
when I rename feature2 to x.
Is that a bug or am I missing something?
Regards
JK
|
|
|
|
Re: Headless build does not resolve inter-feature dependencies [message #449192 is a reply to message #448564] |
Thu, 11 May 2006 03:34   |
Eclipse User |
|
|
|
Hi Jan,
It looks like I encountered the same problem... Compilation inside the
the workspace and the build process during feature export differ
sometimes. I would like to share what I have discovered the hard way.
Jan Köhnlein schrieb:
> Hi,
>
> I am having problems using headless build with eclipse 3.2 (M6). It
> seems like the dependencies between features are not resolved at all. As
There is no "feature dependency" (during build time)! Plug-ins depend on
other plug-ins. Features just group them together. Probably the
dependencies in one or more plug-ins is not correct. Building in the
workspace may not show this problem. Much too clever (for its own good)!
Feature dependencies are used during an update or installation process,
to tell that feature "X" must be present/installed before you install
this feature.
> a result the build order of features and their contained plugins is
> wrong, and I get lots of
> <CLASSNAME> cannot be resolved
> errors, because required plugins are have not been build yet.
I've seen this error too. Try the following approach:
1) Put all your plug-ins into a base feature
2) Create a new feature "A" and *move* some plug-ins from base
to "A" and *include* base feature into "A"
3) Export base feature
4) Export "A" feature
5) No errors? continue with step 2)
I did that for ca. 150 plug-ins and feature hierarchy 5 levels deep. If
the dependencies are right, it works!
> My setting is as follows
>
> product <--- featurex <---+--- feature1 <------- plugin1
> | | |
> | |<--dependency-->|
> | | |
> | v v
> +--- feature2 <------- plugin2
>
> So plugin1 depends on plugin2 and that's why feature1 also depends on
> feature2.
Again: There is no Feature dependency, only plug-ins. Check that
"plugin1" depends on "plugin2".
> When I build the product from eclipse using the Eclipse product export
> wizard on the product, everything works fine. I think that's because the
> classes are already compiled in the bin folders. In the headless build
> the plugin1 is compiled first and build fails, because referenced
> classes from plugin2 cannot be found.
What extras the product build process brings along, I do not know. Maybe
a third way to build plug-ins and export them... :-)
> It seems like the build order of features is always alphabetically.
> Inter-feature dependencies are completely ignored. Everything works fine
> when I rename feature2 to x.
If all fails, have a look at the gory details: Right click on your
"plugin.xml" file, then select "PDE Tools->Create Ant Build File". Look
into the "build.xml" for missing or unexpected plug-ins/dependencies.
> Is that a bug or am I missing something?
Few dare to explore the darker areas of Eclipse. "You might be eaten by
a grue" as an old computer game warned when trying to enter a dark
place. ;-)
Bye
Günther
|
|
|
Re: Headless build does not resolve inter-feature dependencies [message #449492 is a reply to message #449192] |
Mon, 15 May 2006 08:18  |
Eclipse User |
|
|
|
Hi Guenther,
having tried a lot and now hopefully being a little bit wiser, I try a
summary
- Plugins included in the same feature are ordered before compilation
with regard to their dependencies. So the headless build always works as
long as you use a single feature.
- Features are ordered alphabetically and are then build one at a time.
If the currently compiling feature has a dependency to a plugin that is
only included in features that are compiled later, the headless build fails.
To sum it up: Feature dependencies will not be considered in the
compilation order.
I tried to fix that in the org.eclipse.pde.build plugin but it turns out
trickier than I initially assumed: As features are processed one at a
time, it is difficult to trigger the compilation of a plugin that is a
dependency but that is not included. Thus, my current solution works
only for features that depend on other features not on plugins. I can
live with that but it is no general solution to the problem.
Jan.
Guenther Koegel wrote:
> Hi Jan,
>
> It looks like I encountered the same problem... Compilation inside the
> the workspace and the build process during feature export differ
> sometimes. I would like to share what I have discovered the hard way.
>
> Jan Köhnlein schrieb:
>> Hi,
>>
>> I am having problems using headless build with eclipse 3.2 (M6). It
>> seems like the dependencies between features are not resolved at all. As
>
> There is no "feature dependency" (during build time)! Plug-ins depend on
> other plug-ins. Features just group them together. Probably the
> dependencies in one or more plug-ins is not correct. Building in the
> workspace may not show this problem. Much too clever (for its own good)!
>
> Feature dependencies are used during an update or installation process,
> to tell that feature "X" must be present/installed before you install
> this feature.
>
>> a result the build order of features and their contained plugins is
>> wrong, and I get lots of
>> <CLASSNAME> cannot be resolved
>> errors, because required plugins are have not been build yet.
>
> I've seen this error too. Try the following approach:
>
> 1) Put all your plug-ins into a base feature
> 2) Create a new feature "A" and *move* some plug-ins from base
> to "A" and *include* base feature into "A"
> 3) Export base feature
> 4) Export "A" feature
> 5) No errors? continue with step 2)
>
> I did that for ca. 150 plug-ins and feature hierarchy 5 levels deep. If
> the dependencies are right, it works!
>
>> My setting is as follows
>>
>> product <--- featurex <---+--- feature1 <------- plugin1
>> | | |
>> | |<--dependency-->|
>> | | |
>> | v v
>> +--- feature2 <------- plugin2
>>
>> So plugin1 depends on plugin2 and that's why feature1 also depends on
>> feature2.
>
> Again: There is no Feature dependency, only plug-ins. Check that
> "plugin1" depends on "plugin2".
>
>> When I build the product from eclipse using the Eclipse product export
>> wizard on the product, everything works fine. I think that's because
>> the classes are already compiled in the bin folders. In the headless
>> build the plugin1 is compiled first and build fails, because
>> referenced classes from plugin2 cannot be found.
>
> What extras the product build process brings along, I do not know. Maybe
> a third way to build plug-ins and export them... :-)
>
>> It seems like the build order of features is always alphabetically.
>> Inter-feature dependencies are completely ignored. Everything works
>> fine when I rename feature2 to x.
>
> If all fails, have a look at the gory details: Right click on your
> "plugin.xml" file, then select "PDE Tools->Create Ant Build File". Look
> into the "build.xml" for missing or unexpected plug-ins/dependencies.
>
>> Is that a bug or am I missing something?
>
> Few dare to explore the darker areas of Eclipse. "You might be eaten by
> a grue" as an old computer game warned when trying to enter a dark
> place. ;-)
>
> Bye
>
> Günther
|
|
|
Powered by
FUDForum. Page generated in 0.03542 seconds