Bug 415602 - Generated source features should have the same content as their origin.
Summary: Generated source features should have the same content as their origin.
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Buckminster (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: buckminster.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-21 11:28 EDT by Tobias Bertelsen CLA
Modified: 2019-02-25 14:40 EST (History)
0 users

See Also:


Attachments
Patch to solve this bug (11.02 KB, patch)
2013-08-21 11:28 EDT, Tobias Bertelsen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Bertelsen CLA 2013-08-21 11:28:00 EDT
Created attachment 234617 [details]
Patch to solve this bug

------------------
The problems
------------------
This bug contains two related problems.
 1. When a source feature is generated it includes all transitive inclusions of the original feature. It should only include the first level, i.e., the same as the origin.
 1b. Any platform filters in transitive inclusions is not written to the source feature.
 2. Binary features never reference any source features, i.e. the source.feature.jar attribute is always empty. This should reference the jar of the source feature, if it is available in the target platform.

Example:
We have a project with this set-up. '->' is inclusion and "org.eclipse.rcp" is a feature:
-------------
a.feature
   ->b.feature
      ->x.plugin
   ->org.eclipse.rcp
      ->org.eclipse.ui.cocoa (with filter)
-------------  
When we generate source features we this situation.
Inclusions do not correspond the the original feature.
-------------
a.source.feature
   ->x.plugin.source
   ->org.eclipse.ui.cocoa (without filter)
   ->b.source.feature
      ->x.plugin.source
-------------  
Solving problem 1 will give the situation below.
b.source.feature is correctly included, but sources from the target platform are missing.
-------------
a.source.feature
   ->b.source.feature
      ->x.plugin
-------------  
Solving problem 1 and 2 will give us;
Desired inclusion of source features.
-------------
a.source.feature
   ->b.source.feature
      ->x.plugin.source
   ->org.eclipse.rcp.source
      ->org.eclipse.ui.cocoa.source (with filter)
-------------  



------------------
The reasons
------------------
The reason of problem 1. is that the attribute "source.feature.references" is passed to the source feature generator. This includes all transitive dependencies, which seems to be required for other parts of the build process.

Problem 1b is because the source feature generator only looks for platform filters in the original feature. This is therefore only a problem when all transitive dependencies are included.

The source.feature.jar always returns an empty group for binary features, which causes problem 2.



------------------
A solution
------------------
I have created a patch that fixes this. It includes these changes listed below. It works in my setup, but it would be awesome if others could verify this also works as expected for them.

A. Feature components gets two new attributes "source.bundle.inclusions" and "source.feature.inclusions".
   "source.bundle.inclusions" is similar to "source.bundle.jars" but without the references to included features. I.e. it only contains directly included bundles.
   "source.feature.inclusions" is similar to "source.feature.references", but depends on the attribute "source.feature.jar" (without 's') instead of "source.feature.jars". I.e. it only contains directly included features.

B. The two new properties are passed to the source feature generator, instead of source.bundle.jars and source.feature.refs.

C. CSpecFromBinary.createFeatureSourceJarAction() now finds existing source features, in much the same way as CSpecFromFeature.addPlugins() finds existing source plugins.

D. "source.feature.jar" is made public to allow for A. "feature.jar" is made public to allow for B.



------------------
More info
------------------
This problem was originally posted in:
http://www.eclipse.org/forums/index.php/m/1085052/#msg_1085052

It results in an error message like this:
Installing a.source.feature.feature.group 1.0.0.
Installation failed.

Cannot complete the install because one or more required items could not be found.
Software being installed: Source for A feature 1.0.0 (a.source.feature.feature.group 1.0.0)
Missing requirement: Source for A feature 1.0.0 (a.source.feature.feature.group 1.0.0) requires 'org.eclipse.ui.cocoa.source [1.1.1.v20120523-1956]' but it could not be found