Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse Platform Plug-in Development Environment Guide
Previous Page Home Next Page

Generating Source Features and Plug-ins

PDE Build can generate a source feature or plug-in. Consider the following SDK feature:

feature.xml: <includes id="" />
<includes id="" /> [email protected] =
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 plugin 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:

[email protected]<source feature id> = <feature id> [, [email protected]<feature id>[;attribute=value]*]* [, [email protected]<plugin id>[;attribute=value]*]*
  • <source feature id>:  This is the id of the source feature and plug-in to be generated.  Normally it is something like <feature id>.source
  • <feature id>:  The feature on which to base the source feature, the source for all contained plug-ins will be collected into the <source feature id> plugin.
  • [email protected]<feature id>:  This will include the named feature in the generated source feature.
  • [email protected]<plug-in id>:  This will include the named plug-in in the generated source feature. If the plug-in is JARed specify unpack="false". If multiple versions of the plug-in are available, specify the requested version using version=<pluginVersion> followed by qualifier.
  • attribute=value : Both [email protected] and [email protected] entries can be qualified with additional attributes that should be added in the generated source feature.
    Possible attributes (with example values) for [email protected] entries are:
    • version = 1.0.0 : specify the version of the feature to include
    • optional = true : set the included feature as optional
    • ws=gtk : set the window system for the included feature
    • os=linux : set the operating system for the included feature
    • arch=x86 : set the architecture for the included feature
    Possible attributes for [email protected] entries are:
    • version = 1.0.0 : specify the version of the plug-in to include
    • unpack = true : set the included plug-in to be unpacked (ie the plug-in should be installed as a folder).
    • ws=gtk : set the window system for the included plug-in
    • os=linux : set the operating system for the included plug-in
    • arch=x86 : set the architecture for the included plug-in

Use [email protected] 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 [email protected] 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 [email protected] or by providing a template feature.xml:

sourceTemplateFeature/ [email protected] =

feature.xml: <includes id="" />
<includes id="" /> [email protected] =, [email protected]
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:

[email protected]<source plug-in id>=<feature-in id>

feature.xml: <plugin id="" />
<plugin id="" /> [email protected] =

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire