JWT Automatic Build

From Eclipsepedia

Jump to: navigation, search

Contents

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.

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.

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/.%7Chttp://dev.eclipse.org/svnroot/soa/org.eclipse.jwt/trunk/releng/org.eclipse.jwt.p2updatesite/]]. 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

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. 

<pluginRepositories>
<pluginRepository>
<id>maven.eclipse.org</id>
<url>http://maven.eclipse.org/nexus/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>

After that, a profile was added to do the signing. To sign the jars, the following has to be done:

  1. Pack the p2 repository
  2. Sign the p2 repository
  3. Repack the p2 repository
  4. Fix checksums because signing and packing alters them.

The following profile performs the mentioned steps.

  <profiles>
<profile>
<id>build-server</id>
<build>
 <plugins>
   <plugin>
     <groupId>org.eclipse.dash.maven</groupId>
     <artifactId>eclipse-signing-maven-plugin</artifactId>
     <version>1.0.4</version>
     <executions>
       <!-- 
       Pack the p2 repository.
        -->
       <execution>
         <id>pack</id>
         <configuration>
          <inputFile>${project.build.directory}/org.eclipse.jwt.p2updatesite-1.3.0.qualifier.zip</inputFile>
        </configuration>
         <phase>package</phase>
         <goals>
           <goal>pack</goal>
         </goals>
       </execution>
       <!-- 
       Sign the p2 repository
       -->
       <execution>
         <id>sign</id>
         <configuration>
           <inputFile>${project.build.directory}/org.eclipse.jwt.p2updatesite-1.3.0.qualifier.zip</inputFile>
           <signerInputDirectory>/home/data/httpd/download-staging.priv/technology/jwt</signerInputDirectory>
         </configuration>
         <phase>package</phase>
         <goals>
           <goal>sign</goal>
         </goals>
       </execution>
       <!-- 
       Repack the p2 repository
       -->
       <execution>
         <id>repack</id>
         <configuration>
           <inputFile>${project.build.directory}/signed/site_assembly.zip</inputFile> <!-- this is output from signer mojo -->
         </configuration>
         <phase>package</phase>
         <goals>
           <goal>pack</goal>
         </goals>
       </execution>
       <!-- 
       Signing and packing alters checksums so fix them
       -->
       <execution>
         <id>fixCheckSums</id>
         <phase>package</phase>
         <goals>
           <goal>fixCheckSums</goal>
         </goals>
       </execution>
     </executions>
   </plugin>
   </plugins>
</build>
</profile>
</profiles>
 

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.

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.

  • Download a platform that is OK with you build host architecture => ~/downloads/eclipse/downloads/[buildId]/eclipse-SDK-[version]-linux-gtk-ppc.tar.gz from http://download.eclipse.org/eclipse/downloads/
  • Transfer to the /base directory on build.eclipse.org (e.g. with SCP) and expand
  • Go into the new eclipse folder, then type
    • export LAUNCHER="java -jar plugins/org.eclipse.equinox.launcher_*.jar -application org.eclipse.equinox.p2.director"
    • $LAUNCHER -metadataRepository http://download.eclipse.org/releases/galileo -artifactRepository http://download.eclipse.org/releases/galileo -installIU org.eclipse.pde.feature.group -installIU org.eclipse.jdt.feature.group -installIU org.eclipse.emf.feature.group -installIU org.eclipse.gef -installIU org.eclipse.m2m.atl.feature.group (dependency list to be updated following JWT deps)

In case you want to install a feature from a repository that is not p2-ready, you can use

  • java -jar plugins/org.eclipse.equinox.launcher_*.jar -application org.eclipse.update.core.standaloneUpdate -command install -featureId [FEATURE_ID] -from [SITE_URL] -version [VERSION]

Creating the base using drops (not fair)

To create a build base, you'll need to expand the following project in the directory you want to use ase the eclipse base:

  • Eclipse platform linux/ppc/gtk => ~/downloads/eclipse/downloads/[buildId]/eclipse-platform-[version]-linux-gtk-ppc.tar.gz
  • Eclipse PDE => ~/downloads/eclipse/downloads/[buildId]/eclipse-PDE-[version].zip
  • Eclipse JDT => ~/downloads/eclipse/downloads/[buildId]/eclipse-JDT-[version].zip
  • EMF Runtime => ~/downloads/modeling/emf/emf/downloads/drops/[version]/[buildId]/emf-runtime-[buildId].zip
  • GEF Runtime => ~/downloads/tools/gef/downloads/drops/[version]/[buildId]/GEF-runtime-[buildId].zip
  • ATL Runtime (for transformations) => ~/downloads/modeling/m2m/atl/downloads/drops/[version]/[buildId]/m2m-atl-runtime-[version].zip

Choosing the version of each project:

  • 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.

How to use it

Update sites organisation

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

Releasing Policy

When releasing JWT, here are the steps to follow:

  1. Tag the feature and all plugins included into the release with tag R{releaseVersion} (for example R0.5.0)
  2. Build on build.eclipse.org the feature to release (./build.sh R). The update site is automatically updated.
  3. Increment the feature version number (See Version Numbering)
  4. Increment all plugins versions that will be modified in next release)
  5. Create a buzz about this release!

Adding new plugins to the JWT release

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.

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.

  • Ensure it conforms to Eclipse.org legal and technical requirements
    • Plugin version must endswith .qualifier (see Version Numbering)
    • Message strings must be externalized and messaging must be based on NLS (See Message Bundle Conversion Tool and related docs)
    • More generally, it must conform with Eclipse requirements (See list on Galileo Simultaneous Release)
    • Ensure it conforms to legal Eclipse requirements
      • Provider must be Eclipse.org
      • Plugin must include license and about files
      • License headers are necessary on all source files
      • More generally, see [2]
  • Add those plugins to the top-level feature (currently releng/jwt-feature) with version 0.0.0 (automatically chosen at build time)
  • Add those plugins CVS path to the builder map file (currently releng/builder/maps/jwt.map)
  • If your new plugin depends on other plugins (eg EMFT or M2M projects) that are not included in the build base, add its dependencies to the build base
  • Add the test plugins as dependencies to the top-level test plugin (currently jwt-tests-plugin)
    • Add them as dependencies to the MANIFEST.MF
    • Add them into the AllTests testSuite of the plugin
    • Add them to the top-level test feature (so that they will be fetched from CVS at build time, currently jwt-tests-feature, edit the feature.xml)
    • Add those plugins CVS path to the builder map file (currently releng/maps/jwt.map)