Building Rodin Headless

From Event-B
Revision as of 06:54, 25 October 2009 by imported>Laurent
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This page documents the procedure followed for building the binary packages of the Rodin platform that are distributed on SourceForge. The build is done in two steps

  1. Fetch the sources from Subversion and make a source archive with them.
  2. Build the platform headless from this set of sources using Apache Ant.

Build Parameters

Three parameters need to be defined for each build:

  1. the platform version, that is the user-visible version which is displayed in About Rodin Platform. Example of versions are 1.0 and 1.0RC1.
  2. the Subversion revision number, which permits to know very precisely which source versions are used for the build.
  3. the full platform version used for provisioning. This version is made of three digits separated by dots. Example of full versions are 1.0.0 and 1.1.0.

Fetching Sources

Sources are fetched from Subversion using the script below. The script can be run on any Unix machine and takes the first two parameters described above (i.e., platform version and subversion revision). For instance, to build Rodin 1.1, the script was invoked as

fetchSources 1.1 7661

The script itself is

#!/bin/sh
#
#  Fetch sources of the Rodin Platform from the Subversion repository on
#  SourceForge.
#

SVNROOT=http://rodin-b-sharp.svn.sourceforge.net/svnroot/rodin-b-sharp
SVNURL=$SVNROOT/trunk/RodinCore
export SVNROOT SVNURL

fatal() {
    echo "$@" >&2
    exit 1
}

checkRevision() {
    if expr "$SVNREV" : '^[0-9][0-9]*$' >/dev/null; then
	: OK
    else
	fatal "Invalid SVN revision number: $SVNREV"
    fi
}

fetchSources() {
    mkdir sources || fatal "Some sources have already been checked out."
    cd sources
    fetchProject org.rodinp.releng
    cat org.rodinp.releng/rodin-core.psf |
	sed -e '\,trunk/RodinCore/,!d' \
	    -e 's,.*RodinCore/,,'  \
	    -e 's/,.*//' |
	while read m; do
	    fetchProject "$m"
	done
}

fetchProject() {
    m="$1"
    echo "Fetching $m"
    svn -q export -r "$SVNREV" "$SVNURL/$m" "$m"
}


[ $# -eq 2 ] || fatal "Usage: $0 <Rodin_version> <SVN_revision>"
VERSION="$1"
SVNREV="$2"
checkRevision
fetchSources
zip -q -r "../rodin-${VERSION}-sources.zip" *

Installing Eclipse for Headless Build

Building the Platform

TODO: Give script and command to run it