Platform-releng-packager

From Eclipsepedia

Jump to: navigation, search

Contents

Packaging eclipse components

Repackaging Eclipse

Eclipse components are delivered as zip files. Each zip file contains a collection of features and plug-ins. Typically the zips contain all function that a particular component has to offer. It is often the case that consumers either need more than one component and/or only need parts of some components. Without assistance, consumers would have to manually fetch the zips containing the superset of the function they need and then manually extract the required features and plug-ins. This can be a laborious and error prone process.

Fortunately, PDE contains a batch oriented mechanism, the packager which can help. In short, the packager takes as input a list of zips containing features and a list of interesting features. It then fetches the zips, extracts the features (and their plug-ins) and repackages them into an output zip.

Packager configuration files:

 
packager.properties</dt>
A Java properties file that controls the packaging process</dd>
customTargets.xml</dt>
An Ant file used to customize different aspects of packaging</dd>
packaging.properties</dt>
A Java properties file that controls the files included at the root of the archives and file permissions</dd>

Quick start:

Below is a set of basic steps to get started with the packager. More information is available near the various properties in the actual packager configuration files. It is suggested that you build *nix packages on a *nix machine to ensure that file permissions are assigned correctly.

  1. Create a packaging configuration directory to host the packaging work (we'll use c:\temp\newPackaging here)
  2. Copy the packager template files into C:\temp\newPackaging
  3. Customize the packager.properties file as follows:
    • baseDirectory: the directory in which the actual packaging work will take place.
      e.g. buildDirectory = C:\temp\base
    • featureList: a comma separated list of feature ids that you wish to contribute.
      e.g. featureList = org.eclipse.platform, org.eclipse.jdt
    • componentFilter: A comma separated list of components from which your features can be found. Specifying this will avoid unnecessary downloads. Use * if you don't know the components. This lists includes eclipse, jdt, cdt, gef, emf, etc.
      e.g. componentFilter = eclipse
    • contentFilter: A comma separated list of content type you are interested in. Common content types are runtime, sdk, source, doc, etc. This is used to optimize the downloading of the archives. Leave this blank to not filter on content type.
      e.g. contentFilter = sdk, runtime, source
    • config: The configurations to package. This is an "&" separated list of comma separated triples of operating system, windowing system and architecture.
      e.g. config = win32, win32, x86 & linux, gtk, ppc
    • if you are running on linux, set zipArgs to -y

  4. Get packager map files. The following properties control downloading the map files:
    • localMaps: Set this property if you have map files locally (e.g. localMaps = true), put the map files in ${downloadDirectory} (by default this is ${baseDirectory}/toPackage) (e.g. C:\temp\base\toPackage). Comment out this property to automatically download the map file.
    • packagerMapURL: The URL from which to download the map file. Set the URL if you wish to download the map file from the web.

    The packager script will concatenate all *.map files found in ${downloadDirectory}. To download more than one map file, or to fetch them from CVS edit the customTargets.xml file and change the getMapFiles target in customTargets.xml.

  5. Run the packager using the following command:
         java 
    	-jar <eclipse install>/startup.jar –application org.eclipse.ant.core.antRunner 
        	-buildfile <<eclipse install>/plugins/org.eclipse.pde.build_<version>/scripts/package.xml> 
        	-DpackagingInfo=<path to your packaging configuration directory> 
        

Packager map file format:

The map files are used to describe the various zip, their content and where they can be fetched from. They are alike the map file for the build process. The format of a map file entry is as follow:
archiveName = url "|" [configList] "|" [directory] "|" [contentDescription] "|" [componentName]

  • archivename: represents the name of the archive
  • url: the url where to find the archive (the concatenation of url and zip points to the file to download)
  • configList: an optional "&" separated list of configurations for which the zip matches. win32,win32,86 & linux,gtk,x86. If nothing is specied, the archive content is platform independent
  • directory: the directory where the content of the archive should be go relatively to an eclipse install
  • contentDescription: flags indicating the content of the drop
  • componentName: the name of the component

Examples: