Bug 309178 - Respect source feature/plug-in templates
Summary: Respect source feature/plug-in templates
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Buckminster (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: buckminster.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 305878
  Show dependency tree
 
Reported: 2010-04-14 13:39 EDT by Kenn Hussey CLA
Modified: 2019-02-25 14:40 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenn Hussey CLA 2010-04-14 13:39:18 EDT
Buckminster should respect the same template files that PDE Build uses to influence the structure and format of generated source bundles.

In the case of the EMF SDK, for example, these templates can be found at org.eclipse.emf/org.eclipse.emf/features/org.eclipse.emf.sdk-feature/sourceTemplateFeature and org.eclipse.emf/org.eclipse.emf/features/org.eclipse.emf.sdk-feature/sourceTemplatePlugin.
Comment 1 Thomas Hallgren CLA 2010-04-15 00:30:26 EDT
I want to flag that this is not trivial. The current source generation is fairly simplistic and in order to support templates, we need to implement some kind of downstream advice function so that a feature can advice its included bundles on how to generate the source. It's certainly doable but it's an effort that will take several days to implement.
Comment 2 Thomas Hallgren CLA 2010-04-15 03:23:11 EDT
I've been thinking a bit more about this and I want to ask the question, why are templates at all needed? Could it be that this in fact, is an old relic, or at least stems from old ways of doing things?

Take the generated source feature first.

First and foremost, today a feature is a publishing vehicle for p2. It serves as input to the publisher so that it in turn can generate the correct meta-data. This meta-data, an IU, contains the license, copyright, all dependencies, and the feature properties (id, version, label, etc.). The IU will also have an optional dependency to a jar file. This property must be set in order for the jar file to be installed:

eclipse.update.install.feature=true

The IDE sets it to true by default. But not by the director application. Point is, you may, if you so please, refrain from installing the actual jar file because it's not really needed. I'd argue that for a source feature, it should never be needed and the jar shouldn't be included at all in the repository. Given what's in the meta-data, who needs it anyway, and why?

The meta-data (license, copyright, id, version, and label) is all derived from the original feature. So where does that leave the template?

Second, the generated source bundle.

A source bundle will automatically register itself with the IDE, thus giving you a convenient way to directly attach the correct source when debugging. For this purpose, there can be no reason at all to use a template because whatever it provides is in no way visible anyway.

You may also import the bundle into your workspace "as source". When you do, the files checked under "Source Build" in the bundle manifest editor of the original bundle, will show up. That may well include about files, icons, etc. The only thing I can see that a source bundle template would bring into the equation are files that are not present in the original bundle. When is that needed?

Please note that I'm not trying to avoid the extra work of implementing support for templates. I just that I have a hard time to see the benefits and I want to make sure that it is worth the effort.
Comment 3 Kenn Hussey CLA 2010-04-15 09:11:12 EDT
Thomas, I think it's a good idea to question the need for template support. Ultimately what we need is a way to influence the content of source features and plug-ins. Like you say, this can largely be done based on the content of the original bundle and what's specified in the build.properties file. We should perhaps poll others to see if there is a use case which really justifies the need for these templates. In the meantime, it's certainly not a gating factor for switching over to Buckminster for EMF builds.