This section presents information concerning the JWT 1.3.0 build for eclipse Kepler on Hudson and would be considered as a very useful resource for JWT's future release engineers (starting with Eclipse Luna scheduled for release in 2014). Some of the information/steps that follow might be not necessary for future JWT builds using Maven Tycho since they have already been done but we illustrate them anyway so that we would have a comprehensive and complete documentation of the whole building process. We start by explaining how to prepare the JWT project for the build and then follow by explaining how to configure Hudson to build JWT.

+

This section presents information concerning the JWT 1.3.0 build for eclipse Kepler on Hudson and would be considered as a very useful resource for JWT's future release engineers (starting with Eclipse Luna scheduled for release in 2014). Some of the information/steps that follow might be not necessary for future JWT builds using Maven Tycho since they have already been done but we illustrate them anyway so that we would have a comprehensive and complete documentation of the whole building process. We start by explaining how to prepare the JWT project for the build and then follow by explaining how to configure Hudson to build JWT. Please, note that newly assigned release engineers might have to contact the eclipse webmaster (webmaster@eclipse.org) in case they are missing any permissions that they might require.

== Helpful resources ==

== Helpful resources ==

Line 7:

Line 7:

The following link includes an Eclipse Tycho tutorial that would serve as a very useful resource demonstrating how to build Eclipse plug-ins, features and how to create Eclipse p2 update sites with Maven Tycho.

The following link includes an Eclipse Tycho tutorial that would serve as a very useful resource demonstrating how to build Eclipse plug-ins, features and how to create Eclipse p2 update sites with Maven Tycho.

This section provides information concerning preparing JWT to be built using Maven Tycho and preparing the p2 update site contents to be signed by the eclipse signature after the build is done and the jars generated.

+

This section provides information concerning preparing JWT to be built using Maven Tycho and preparing the p2 update site contents to be signed by the eclipse signature after the build is done and the jars generated.

−

== Master project for the build ==

+

=== Master project for the build ===

The current master project for the JWT build is a project of type '''''General'''''<b>mvn-jwt-builder</b> found at&nbsp;[http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/mvn-jwt-builder/ http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/mvn-jwt-builder/].&nbsp;This project contains the master pom.xml for building the plug-ins. This pom.xml file contains all modules that are related to the build. Modules are the features and plugins to be built in addition to the p2update site of the project.&nbsp;The master pom.xml file also contains general information about the build like the project's repositories in addition to links to any external plugin dependencies the build might need.<br>

The current master project for the JWT build is a project of type '''''General'''''<b>mvn-jwt-builder</b> found at&nbsp;[http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/mvn-jwt-builder/ http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/mvn-jwt-builder/].&nbsp;This project contains the master pom.xml for building the plug-ins. This pom.xml file contains all modules that are related to the build. Modules are the features and plugins to be built in addition to the p2update site of the project.&nbsp;The master pom.xml file also contains general information about the build like the project's repositories in addition to links to any external plugin dependencies the build might need.<br>

−

== Add new Features/plugins to the build ==

+

=== Add new Features/plugins to the build ===

Future release engineers should add the paths to any new features/plugins in the master pom.xml file. In addition, they should also add any new plugins to one of the features and include any new features needed in the p2update site to the category definition of the p2update site project found at [[Future release engineers should add the paths to any new features/plugins in this file. In addition, they should also add any new plugins to one of the features and include any new features needed in the p2update site to the category definition of the p2update site project found at http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/.|http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/]].&nbsp;Please, note that any new features or plugins have to have their own pom.xml files as well as described in the tutorial recommended above.

Future release engineers should add the paths to any new features/plugins in the master pom.xml file. In addition, they should also add any new plugins to one of the features and include any new features needed in the p2update site to the category definition of the p2update site project found at [[Future release engineers should add the paths to any new features/plugins in this file. In addition, they should also add any new plugins to one of the features and include any new features needed in the p2update site to the category definition of the p2update site project found at http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/.|http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/]].&nbsp;Please, note that any new features or plugins have to have their own pom.xml files as well as described in the tutorial recommended above.

−

== P2 update Site project ==

+

=== P2 update Site project ===

−

The p2 update site project includes jars generated from the build and that are required for installing JWT. The current p2 update site project is a project of type '''''General&nbsp;'''''called&nbsp;'''org.eclipse.jwt.p2updatesite '''and can be found at&nbsp;[http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/ http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/]. This project also has it's own pom.xml file and it includes a profile that signs the JWT jars using the eclipse signature. This is prerequisite for eclipse projects and the details of signing the jars will be explained in the following section.

+

The p2 update site project includes jars generated from the build and that are required for installing JWT. The current p2 update site project is a project of type '''''General&nbsp;'''''called&nbsp;'''org.eclipse.jwt.p2updatesite '''and can be found at&nbsp;[http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/ http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/]. This project also has it's own pom.xml file and it includes a profile that signs the JWT jars using the eclipse signature. This is prerequisite for eclipse projects and the details of signing the jars will be explained in the following section.<br>

−

<br>

+

=== Signing the JWT jars using the eclipse signature<br> ===

−

+

−

== Signing the JWT jars using the eclipse signature<br> ==

+

First, the proper maven.eclipse.org repository was added to the master pom.xml.&nbsp;<br>

First, the proper maven.eclipse.org repository was added to the master pom.xml.&nbsp;<br>

&lt;inputFile&gt;${project.build.directory}/signed/site_assembly.zip&lt;/inputFile&gt; &lt;!-- this is output from signer mojo --&gt;

+

&lt;inputFile&gt;${project.build.directory}/signed/site_assembly.zip&lt;/inputFile&gt; &lt;!-- this is output from signer mojo --&gt;

−

&lt;/configuration&gt;

+

&lt;/configuration&gt;

−

&lt;phase&gt;package&lt;/phase&gt;

+

&lt;phase&gt;package&lt;/phase&gt;

−

&lt;goals&gt;

+

&lt;goals&gt;

−

&lt;goal&gt;pack&lt;/goal&gt;

+

&lt;goal&gt;pack&lt;/goal&gt;

−

&lt;/goals&gt;

+

&lt;/goals&gt;

−

&lt;/execution&gt;

+

&lt;/execution&gt;

−

&lt;!--

+

&lt;!--

−

Signing and packing alters checksums so fix them

+

Signing and packing alters checksums so fix them

−

--&gt;

+

--&gt;

−

&lt;execution&gt;

+

&lt;execution&gt;

−

&lt;id&gt;fixCheckSums&lt;/id&gt;

+

&lt;id&gt;fixCheckSums&lt;/id&gt;

−

&lt;phase&gt;package&lt;/phase&gt;

+

&lt;phase&gt;package&lt;/phase&gt;

−

&lt;goals&gt;

+

&lt;goals&gt;

−

&lt;goal&gt;fixCheckSums&lt;/goal&gt;

+

&lt;goal&gt;fixCheckSums&lt;/goal&gt;

−

&lt;/goals&gt;

+

&lt;/goals&gt;

−

&lt;/execution&gt;

+

&lt;/execution&gt;

−

&lt;/executions&gt;

+

&lt;/executions&gt;

−

&lt;/plugin&gt;

+

&lt;/plugin&gt;

−

&lt;/plugins&gt;

+

&lt;/plugins&gt;

−

&lt;/build&gt;

+

&lt;/build&gt;

−

&lt;/profile&gt;

+

&lt;/profile&gt;

&lt;/profiles&gt;

&lt;/profiles&gt;

−

=== <br> ===

+

== Configuring Hudson to build JWT ==

−

=== Handle automated testing ===

+

To build JWT on Hudson using Maven, a build step has to be added that uses Maven. The following screenshot presents the details of this build step as used for the Kepler release.

−

Another main point was to have the ability to run unit test on the just build JWT plugins, to avoid silent regressions. Our steps to do so were:

+

[[Image:Screenshot from 2013-05-07 02-42-20.png|Maven build step on Hudson for the Kepler release.]]

−

*Copied an example tester (we used GEF and Platform ones as examples)

+

As illustrated by the screenshot, the only build goals needed are "clean install". Moreover, the path to the master pom.xml file had to be specified in the POM file field. Finally, the signing profile added earlier had to be triggered to sign the jars using the eclipse signature. The profile added was called "build-server" and it is enough to simply write its name in the "Profiles" field.

−

*Same strategy as for the builder: externalize strings from the test.xml to the builder build.properties file, and then adapt values to JWT

+

−

*Added the automated fetching of the test feature in the customTargets.xml

+

−

*Added test plugins and features to the map file

+

−

*In the master test plugin, copied a test.xml from another test ''plugin'' (not a test.xml from a tester)

+

−

*In the tester's test.xml, adapt the creation of the runtime we'll use for testing

+

−

**The test runtime is created dynamically as a copy of the build base

+

−

**And we add the JWT plugins and JWT tests plugins in it (expanding zips into the test runtime directory)

+

−

*Update the createUpdateSite.xml so that it copies test results into the update site

+

−

=== P2 ===

+

<br>

−

+

−

We encountered a problem with p2 file generation: Indeed, setting the generate.p2.metadata to true made metadate generated also for the test feature, whereas we do not expect to deliver them.

+

−

Then the solution was to set generate.p2.metadata to false, and then to run the p2 generator on the generated update site. The p2.generate ant task does not seem to support the ''site'' attribute, thus we simply used an Ant ''exec'' task calling the eclipse p2 generator application as we would have done with command-line.

+

Now everything is ready and the final step would be to click "Build now" from the main page of the build on Hudson.

−

=== What can still be done ===

+

= <span style="line-height: 1.5em;">What can still be done</span> =

*Try to use a build/continuous integration server

*Try to use a build/continuous integration server

*Try to have nightly build

*Try to have nightly build

−

*Merge builder and tester: Move the test.xml from tester to builder, test and replace references to tester by builder.

+

*Merge builder and tester: Move the test.xml from tester to builder, test and replace references to tester by builder.

+

*Enable automatic deployment of JWT to the update site through after the build is run

+

*Run JUnit tests on Hudson

+

*Take care of the stable build on Hudson&nbsp;

−

== What we have ==

+

<br>

+

+

= What we have =

=== JWT build minimal Eclipse base ===

=== JWT build minimal Eclipse base ===

Line 186:

Line 185:

*From the ''eclipse'' directory, try command ''ls plugins/ | grep org.eclipse.swt'', then you should get a list of plugins, and one of them specifies a os/ws/arch 3-uplet in its name. It must be match your server platform.

*From the ''eclipse'' directory, try command ''ls plugins/ | grep org.eclipse.swt'', then you should get a list of plugins, and one of them specifies a os/ws/arch 3-uplet in its name. It must be match your server platform.

−

If you don't have the same eclipse target and server platforms, then you might be able to build, but testing will be impossible for you.

+

If you don't have the same eclipse target and server platforms, then you might be able to build, but testing will be impossible for you.

−

== How to use it ==

+

= Update sites organisation =

−

+

−

=== Update sites organisation ===

+

First, as it is the case in most of "one feature" projects (such as GEF), JWT now has 3 update sites:

First, as it is the case in most of "one feature" projects (such as GEF), JWT now has 3 update sites:

Line 196:

Line 193:

*http://download.eclipse.org/technology/jwt/update-site is the update-site that contains the '''current release of JWT'''

*http://download.eclipse.org/technology/jwt/update-site is the update-site that contains the '''current release of JWT'''

*http://download.eclipse.org/technology/jwt/integration-update-site is the update-site the could contain any '''development or nightly build of JWT'''. Contents of this update-site should only be used by JWT contributors for testing.

*http://download.eclipse.org/technology/jwt/integration-update-site is the update-site the could contain any '''development or nightly build of JWT'''. Contents of this update-site should only be used by JWT contributors for testing.

−

*http://download.eclipse.org/technology/jwt/stable-update-site is the update-site for stable development build, and also for '''Galileo milestones'''

+

*http://download.eclipse.org/technology/jwt/stable-update-site is the update-site for stable development build, and also for '''Galileo milestones'''<br>

−

+

−

=== Building on build.eclipse.org ===

+

−

+

−

==== Requirements ====

+

−

+

−

Since testing requires the ability to start the eclipse UI, an X server must be started and the DISPLAY environment variable must be correctly set on the build server. See [[EMF Build Server Setup#Verify_X_Server|EMF advices about X configuration]] for more details.

+

−

+

−

On build.eclipse.org, you can use the Xvfb server started by root on localhost:1.0 (DISPLAY is automatically set to this value when running build.sh)

+

−

+

−

If you there is a problem with X server, you'll have the bahavior described above:

+

−

+

−

*In the build trace, the Java Result: 13 tells you that eclipse could not start

*In the eclipse log (tester/results/org.eclipse.jwt.we.tests.AllTests.txt), you can see a message telling you that a problems occurs with display:

+

−

+

−

<source lang="text">

+

−

org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]

+

−

at org.eclipse.swt.SWT.error(SWT.java:3803)

+

−

</source>

+

−

+

−

==== Start a build ====

+

−

+

−

Anyone who has access to build.eclipse.org can now start a build of cvs HEAD by browsing to JWT home folder (''/shared/technology/jwt''), going into the ''builder'' folder and typing ''./build.sh [buildType]'' where build type is I (default), S or R, respectively for integration, stable or release build.

+

−

+

−

This script will start the whole build process and update the update-site for the specified build type.

If you want to build locally JWT, simply checkout the org.eclipse.jwt/releng CVS module and write a script that starts the build with your local configuration (please '''do not modify build.sh or build.properties''', that are build.eclipse.org files). See build.mistria.openwide.sh for example.

+

−

+

−

=== Continuous integration ===

+

−

+

−

'''TODO''' Note that the PDE build process supports unit testing. I've read about several Eclipse projects that used a continuous integration tool (such as cruise, continuum or hudson) to monitor their builds and test results. I'll try to choose if one of these solutions is fine for JWT.

+

−

+

−

= Releasing Policy =

+

−

When releasing JWT, here are the steps to follow:

+

= Releasing Policy =

−

# Tag the feature and all plugins included into the release with tag R{releaseVersion} (for example R0.5.0)

+

−

# Build on build.eclipse.org the feature to release (''./build.sh R''). The update site is automatically updated.

+

−

# Increment the feature version number (See [[Version Numbering]])

+

−

# Increment all plugins versions that will be modified in next release)

+

−

# Create a buzz about this release!

+

−

= Adding new plugins to the JWT release =

+

When releasing JWT, here are the steps to follow:

−

This section describes the steps to follow to add a new plugin to JWT release and get the build working with this add-ons. We'll use an example to facilitate the explanations.

+

#Tag the feature and all plugins included into the release with tag R{releaseVersion} (for example R0.5.0)

+

#Build on build.eclipse.org the feature to release (''./build.sh R''). The update site is automatically updated.

+

#Increment the feature version number (See [[Version Numbering]])

+

#Increment all plugins versions that will be modified in next release)

+

#Create a buzz about this release!

−

Assume that jwt-we (plugin) now depends on a new plugin (jwt.we.conf.model) that was not part of the automated build before. In such case, some things needs to be updated to build the jwt-we automatically, else you'll get a "missing bundle" error telling you that the build cannot find the jwt.we.conf.model.

Build of JWT Features and Plugins

This section presents information concerning the JWT 1.3.0 build for eclipse Kepler on Hudson and would be considered as a very useful resource for JWT's future release engineers (starting with Eclipse Luna scheduled for release in 2014). Some of the information/steps that follow might be not necessary for future JWT builds using Maven Tycho since they have already been done but we illustrate them anyway so that we would have a comprehensive and complete documentation of the whole building process. We start by explaining how to prepare the JWT project for the build and then follow by explaining how to configure Hudson to build JWT. Please, note that newly assigned release engineers might have to contact the eclipse webmaster (webmaster@eclipse.org) in case they are missing any permissions that they might require.

Helpful resources

The following link includes an Eclipse Tycho tutorial that would serve as a very useful resource demonstrating how to build Eclipse plug-ins, features and how to create Eclipse p2 update sites with Maven Tycho.

Preparing JWT to be built by Maven Tycho

This section provides information concerning preparing JWT to be built using Maven Tycho and preparing the p2 update site contents to be signed by the eclipse signature after the build is done and the jars generated.

Master project for the build

The current master project for the JWT build is a project of type Generalmvn-jwt-builder found at http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/mvn-jwt-builder/. This project contains the master pom.xml for building the plug-ins. This pom.xml file contains all modules that are related to the build. Modules are the features and plugins to be built in addition to the p2update site of the project. The master pom.xml file also contains general information about the build like the project's repositories in addition to links to any external plugin dependencies the build might need.

P2 update Site project

The p2 update site project includes jars generated from the build and that are required for installing JWT. The current p2 update site project is a project of type General called org.eclipse.jwt.p2updatesite and can be found at http://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/. This project also has it's own pom.xml file and it includes a profile that signs the JWT jars using the eclipse signature. This is prerequisite for eclipse projects and the details of signing the jars will be explained in the following section.

Signing the JWT jars using the eclipse signature

First, the proper maven.eclipse.org repository was added to the master pom.xml.

Configuring Hudson to build JWT

To build JWT on Hudson using Maven, a build step has to be added that uses Maven. The following screenshot presents the details of this build step as used for the Kepler release.

As illustrated by the screenshot, the only build goals needed are "clean install". Moreover, the path to the master pom.xml file had to be specified in the POM file field. Finally, the signing profile added earlier had to be triggered to sign the jars using the eclipse signature. The profile added was called "build-server" and it is enough to simply write its name in the "Profiles" field.

Now everything is ready and the final step would be to click "Build now" from the main page of the build on Hudson.

What can still be done

Try to use a build/continuous integration server

Try to have nightly build

Merge builder and tester: Move the test.xml from tester to builder, test and replace references to tester by builder.

Enable automatic deployment of JWT to the update site through after the build is run

Run JUnit tests on Hudson

Take care of the stable build on Hudson

What we have

JWT build minimal Eclipse base

In order for the build and automated testing to be working as fast as possible, it is necessary to maintain a build base (in /shared/technology/jwt/base on build.eclipse.org), that contains only the projects that are necessary to build and test JWT, and to ensure that these project are built for for the build server you are using.

Creating the base with from repositories (recommended)

P2 is the recommended way to install feature since it checks dependencies and avoids to forget some bundles that are necessary at runtime for testing.

Currently, JWT build on Eclipse server uses the latest version that contains a Maintenance or Release build (ie buildId starting with R or M)

However, we could discuss about trying to build usng stable or milestone builds, to ensure the compatibility with the latest versions of projects. But this would require much more work until we succeed to automate the creation of the base with the latest drops...

Check an existing base

There are 2 ways to check that an eclipse installation matches your machine platform:

Try to run the eclipse launcher program (./eclipse). If eclipse starts, it is OK

From the eclipse directory, try command ls plugins/ | grep org.eclipse.swt, then you should get a list of plugins, and one of them specifies a os/ws/arch 3-uplet in its name. It must be match your server platform.

If you don't have the same eclipse target and server platforms, then you might be able to build, but testing will be impossible for you.

Update sites organisation

First, as it is the case in most of "one feature" projects (such as GEF), JWT now has 3 update sites: