Building Rodin Headless

From Event-B
Revision as of 10:50, 24 October 2009 by imported>Laurent
Jump to navigationJump to search

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

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

Fetching Sources

Sources are fetched from Subversion using the script below. The script can be run on any Unix machine and takes the two parameters described above. 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=https://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" *

Building the platform

TODO: Give script and command to run it