* While the PDE build is able to automatically create the Ant build script for the plugins with source code, you will need to hard code and maintain [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf/doc/org.eclipse.emf.doc/?root=Modeling_Project the scripts] for the documentation plugins.

* While the PDE build is able to automatically create the Ant build script for the plugins with source code, you will need to hard code and maintain [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf/doc/org.eclipse.emf.doc/?root=Modeling_Project the scripts] for the documentation plugins.

−

+

::'''UPDATE:''' Instead of using a custom build.xml (by marking it as such in build.properties), you can customize a particular build step. See [[#Customizing Doc Build]].

* If you don't already have a doc plugin/feature, you can use [http://dev.eclipse.org/viewcvs/index.cgi/releng-common/templates/?root=Modeling_Project these templates] as a starting point.

* If you don't already have a doc plugin/feature, you can use [http://dev.eclipse.org/viewcvs/index.cgi/releng-common/templates/?root=Modeling_Project these templates] as a starting point.

Line 214:

Line 214:

*# Open the ''build.properties'' editor and select the "Custom Build" check box at the top of the page

*# Open the ''build.properties'' editor and select the "Custom Build" check box at the top of the page

*# Every time you start code a new release, you will need to manually update this build script. See the "[[#Release Process|Release Process]]" section for more details on new releases.

*# Every time you start code a new release, you will need to manually update this build script. See the "[[#Release Process|Release Process]]" section for more details on new releases.

+

+

====Customizing Doc Build====

+

+

PDE Build provides a mechanism for customizing plugin build process. This allows you to perform custom actions during the build while letting PDE take care of the rest (i.e., you don't have to maintain the entire build.xml file). See [http://help.eclipse.org/ganymede/topic/org.eclipse.pde.doc.user/tasks/pde_custom_callbacks.htm Feature and Plug-in Custom Build Steps] for more information.

+

+

In order to inject custom steps into your documentation plugin's build you must provide an Ant script with the required callbacks, such as [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf.mint/plugins/org.eclipse.emf.mint.doc/customBuildCallbacks.xml?root=Modeling_Project&view=markup Mint's Doc] plugin. When building the doc plugin you need to invoke an external shell scripts to build your Javadoc content. You can do this before the plugin's bin parts are gathered:

+

<target name="pre.gather.bin.parts">

+

<property name="eclipseDir" location="../.."/>

+

<chmod perm="754" file="build/antJavadoc.sh"/>

+

<exec executable="bash" dir="build">

+

<arg line="./antJavadoc.sh ${eclipseDir}"/>

+

</exec>

+

<help.buildHelpIndex manifest="plugin.xml" destination="."/>

+

</target>

+

Note that the other callback targets must be defined but may remain empty.

+

+

Next, you must tell the builder that you wish to receive callbacks during the build. Add the following lines to your build.properties:

+

customBuildCallbacks=customBuildCallbacks.xml

+

customBuildCallbacks.failonerror=true

+

+

That's it! If you are migrating from a custom build.xml, don't forget to remove it from CVS. Also, make sure you update your build.properties (see [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf.mint/plugins/org.eclipse.emf.mint.doc/build.properties?root=Modeling_Project&view=markup Mint's build.properties] for an example).

Plugin and Feature Files

The contents of your features and plugins directories should mimic what is available in the EMF and UML2 projects. Although this section tries to summarize the important points, "learning by example" is the recommended approach.

Incubation Status

New components must be tagged as "incubating", until such time as they graduate. This is mandatory. To conform to incubation rules and learn more about component graduation, see Incubation Status.

The build.properties file is extremely important and must be accurate to allow PDE to build your plugins and features. Please review other components' build.properties files for plugins with code, documentation and branding plugins, and features. To learn more about how to configure this file, search the help system.

The PDE build process is based on features, so all your plugins must be referenced by a feature.

A feature directory can contain the definition of other features and plugins. As you can see in the example, we use this to define "derived" elements, like EMF's SDK feature, source feature and source plugin.

A feature's build.properties file can specify that the source plugin and feature should be generated. In EMF, this is done in the SDK feature's build.properties.

Qualifiers (1.0.0.qualifier)

To add qualifiers to features and plugins, you must have 3 (or more) pieces set up correctly.

Append .qualifier as the 4th field of the feature version in every feature.xml file.

Ensure that if you have comments before the <feature> tag, they do NOT include the word "feature". If they do, 1.0.0.qualifier will not be replaced by PDE with the build's timestamp/id. This is documented in bug 129868.

Change the versions in all plugins included in feature.xml files to 0.0.0. PDE will replace 0.0.0 by the appropriate version during the build.

3. Doc

Ensure that org.eclipse.[subproject].doc/build.xml uses ${pluginVersion}.${forceContextQualifier} instead of ${pluginVersion} or a hard-coded version like 1.0.0. You may need to add a new property. <example>

<property name="pluginVersion" value="1.0.0"/>

Add these lines to the end of the gather.bin.parts target in org.eclipse.[subproject].doc/build.xml (line break added in path attribute). <example>

OPTIONAL: If you want all your features and plugins to have the SAME qualifier, eg., v200804251234, rather than qualifiers specific to the released tags in your map file(s), add the following lines to the create.label.properties target of releng/[subproject]/buildAll.xml. <example>

OPTIONAL: If you would like your features' versions to be suffixed with a dash followed by a random string of letters and numbers, you must also add a line to your build.properties files. Why would you want this? It is apparently calculated from the CVS tags to ensure that the version for the features will change if the source changes in the build.

Add generateFeatureVersionSuffix=true to all build.properties files in every releng/[subproject]/builder/ directory. <example>

If available, add generateFeatureVersionSuffix=true to any build.properties.template files in releng/[subproject]/templateFiles/.

NOTE: due to property file parser limitations in Eclipse, it is recommended that you always leave an empty line at the end of .properties (and .properties.template) files.

Core Plugins

For plugins with code:

The EMF artifacts and model specifications (XML schema, for example) should be located in a models directory in the root of the plugin. Don't forget to include the genmodel to allow users to regenerate your code.

DO commit all generated code. This makes it easier to run your plugin from the workspace.

The source files should be placed in "source folders" and each "source folder" should have a different "output folder".

The plugins with code should be deployed as jarred plugins. In order to tip the PDE build to jar a plugin, you need to set the MANIFEST.MF's Bundle-ClassPath attribute to . and use . in the build.properties file. As an example, look at the ecore's manifest and build.properties mentally replacing ecore.jar by ..

Right now you are probably asking yourself why the ecore files are declaring a jar instead of using .. To make a long story short, this is necessary for EMF to bootstrap itself during development (required when you use EMF to develop EMF). When developing, we can easily zip the contents of the output folder into the appropriate jar and restart Eclipse. Our build "fixes" the files before the plugins are packaged.
Btw, to jar your plugin, you will also need to add unpack="false" to the plugin reference in your feature. <example>

Almost all files should have a copyright. This is what is used for the Java files in EMF (please check the other types of files in the example):

/**
* <copyright>
*
* Copyright (c) 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
*
* </copyright>
*/

The META-INF/MANIFEST.MF must end with an empty line. Also, don't forget to add the following line to the manifest to ensure the plugin classes are properly initialized:

Bundle-ActivationPolicy: lazy

The .classpath files should only contain references to the JDK and PDE container and the definition of the source and output folders.

In order to ensure that your plugin.properties files can be translated, you will need to add the following "directives" to them. All strings after a given directive are supposed to conform to its rules:

NLS_MESSAGEFORMAT_ALL

Each string is assumed to be processed by the MessageFormat class (single quote must be coded as 2 consecutive single quotes '').

NLS_MESSAGEFORMAT_NONE

All strings are assumed to NOT be processed by the MessageFormat class (single quote must be coded as 1 single quote ').

NLS_MESSAGEFORMAT_VAR

Strings which contain replacement variables are processed by the MessageFormat class (single quote must be coded as 2 consecutive single quotes ''). Strings which do NOT contain replacement variables are NOT processed by the MessageFormat class (single quote must be coded as 1 single quote ').

Add a schema for each extension point you define in your plugin. <example>

Core Features

Features are used to group functionality. This can be very simple (runtime, sdk, doc, examples, tests) or very complex (see EMF).

For every group of functionality, you need a corresponding feature to collect that function, which must be in turn contributed (included) in its parent feature(s). For example, you might have a ui and a core feature, both of which are part of the runtime feature, and that runtime feature (along with doc, source, and optionally examples) needs to be included in your SDK feature. For more on how Update Manager behaves with respect to feature nesting, see this page.

This is a stub. Contribute to this wiki by adding content here.

Documentation Plugin & Feature

While the PDE build is able to automatically create the Ant build script for the plugins with source code, you will need to hard code and maintain the scripts for the documentation plugins.

UPDATE: Instead of using a custom build.xml (by marking it as such in build.properties), you can customize a particular build step. See #Customizing Doc Build.

If you don't already have a doc plugin/feature, you can use these templates as a starting point.

If you already have a doc plugin/feature, here's how to quickly creating your build.xml script:

After adding all the files to the plugin directory and configuring the build.properties file, right click the plugin.xml file and select PDE Tools->Create Ant Build File.

Open the build.xml file and delete the tasks in the gather.bin.parts; target.

In the build.jars, use the zip ant tasks to zip up the content of the plugin - this is required since Eclipse expects the documentation files to be in an archive file.

Open the build.properties editor and select the "Custom Build" check box at the top of the page

Every time you start code a new release, you will need to manually update this build script. See the "Release Process" section for more details on new releases.

Customizing Doc Build

PDE Build provides a mechanism for customizing plugin build process. This allows you to perform custom actions during the build while letting PDE take care of the rest (i.e., you don't have to maintain the entire build.xml file). See Feature and Plug-in Custom Build Steps for more information.

In order to inject custom steps into your documentation plugin's build you must provide an Ant script with the required callbacks, such as Mint's Doc plugin. When building the doc plugin you need to invoke an external shell scripts to build your Javadoc content. You can do this before the plugin's bin parts are gathered:

Note that unless you have images, references, or tutorials at the time you're creating these files, you'll have to toss a placeholder into them so they won't be pruned (ignored) when extracting from CVS. A simple (blank) .cvsignore file will do nicely.

Javadoc Indexed By Eclipse Help

To get Eclipse to index your javadoc in the Help system, you must revise the following files (see also bug 142558):

1. Specify where extra topics_*.xml files are attached to the main table of contents entry: toc.xml

<topic label="Reference">
<link toc="topics_Reference.xml"/>
</topic>

2. Specify which files to include in the doc plugin (custom build script, not PDE-generated): build.xml

Tests Plugin & Feature

Until there is a test plugin/feature template, the best approach is to check out an existing working component's tests' plugin(s) and feature and clone what they have, replacing "query" in the above example with "foo", the name of your component.

This is a stub. Contribute to this wiki by adding content here.

Examples Plugin & Feature

Until there is an examples plugin/feature template, the best approach is to check out an existing working component's examples' plugin(s) and feature and clone what they have, replacing "query" in the above example with "foo", the name of your component.

This will define which *src.zip files will be created - one per plugin include in the feature. If you want source for your examples, do the same in your [subproject].examples-feature.

[update] NOTE: you must include your branding plugin (eg., org.eclipse.net4j) in your branding feature (eg., org.eclipse.net4j-feature/feature.xml), even if it contains NO source, in order to properly suppress unpacking src/* in the .source plugin. Ensure that you've set that plugin to be unpack="false":

Note that [Bundle-ClassPath] is the jar name defined in the matching MANIFEST.MF, such as:

Bundle-ClassPath: eodmeditor.jar

These define what gets packaged in the *src.zip files. You should NOT use src.includes = src/ unless you want your source plugin to include BOTH a *src.zip (containing *.java source files) and the unpacked *.java source files themselves.

Multiple Namespaces

If you want to contribute sources to your SDK, you must create a source plugin and feature for every feature that will contribute source. If you only have one main feature, eg, org.eclipse.emf.[subproject]-feature, there will be one src.zip created for every plugin listed in that feature's feature.xml. If you have more than one, as in the case with org.eclipse.emf.transaction, containing both org.eclipse.emf.transaction-feature and org.eclipse.emf.workspace-feature, each must contain its own sourceTemplateFeature and sourceTemplatePlugin. (???)

You can also use the generate.feature directive in your SDK's build.properties, if you have source for more than one namespace. (???)