Generating Source Features and Plug-ins

Starting in 3.4, Eclipse has shipped with individual source bundles which allow for more flexible delivery of source. See the "Individual Source Bundles" page for details. Traditional folder-shaped source plug-ins can still be built as outlined below.

Consider the following SDK feature:

feature.xml: <includes id="" />
<includes id="" /> =
feature.xml: <plugin id="" />
<plugin id="" />
<plugin id="" fragment="true" os="win32" />

The idea of the SDK is that it includes a feature as well as the source for that feature.  Notice the generate.feature property in the feature's file.  This property tells PDE Build to generate a feature named "" based on the contents of the feature "".  PDE build will generate an feature, a plug-in that will contain the source code, and fragments containing the source of any platform specific bundles that were included in the feature:

feature.xml: <plugin id=""/>
<plugin id="" fragment="true" os="win32" />

Customizing the Generated Source Feature

The generate.feature property has the following form:

generate.feature@<source feature id> = <feature id> [, feature@<feature id>[;attribute=value]*]* [, plugin@<plugin id>[;attribute=value]*]*

Use plugin@ to add additional plug-ins that weren't part of the original feature to the generated source feature.  This is useful for documentation plug-ins.  The feature@ together with a source template can be used to nest source features (see below).

Source Templates

The feature from which the source feature is being generated can provide template files to be included in the generated source feature:

sourceTemplateFeature/<files to be included in generated source feature>
sourceTemplatePlugin/<files to be included in generated source plugin>
sourceTemplateFragment/<files to be included in generated platform specific fragments>

Any files located in these sourceTemplate folder will be included in the appropriate generated feature/plug-in/fragment.  Specifically, files from these directories will replace files generated by PDE build.  This can be used to provide a custom feature.xml if there are requirements for your source feature that PDE build does not support.

Nesting Generated Source Features

You can nest source features by providing a sourceTemplateFeature/ file for your generated source feature that contains a generate.feature property for the nested source feature.  You will also need to ensure that your top source feature.xml includes the nested source feature, do this either by using feature@ or by providing a template feature.xml:

sourceTemplateFeature/ =

feature.xml: <includes id="" />
<includes id="" /> =,
In the above example, contains a generated source feature named  This generated source feature will get the template sourceTemplateFeature/ file.  It will also include in its feature.xml.  So when PDE build is processing the generated, it sees the inclusion of the feature and the generate.feature property and then generates the

Generating a Source Plug-in

It is also possible to generate a single source plug-in based on a feature instead of generating an entire source feature.  The property to do this is:

generate.plugin@<source plug-in id>=<feature-in id>

Be aware that these old-style source plug-ins (one plug-in containing the source for all plug-ins of the feature) must be installed in folder form. Therefore you have to set the unpack="true" attribute in the file feature.xml.

feature.xml: <plugin id="" />
<plugin id="" unpack="true" /> =