new scripts for building and testing the OTDT on build.eclipse.org.
diff --git a/releng/build-scripts/build/OT-Compiler/build.properties b/releng/build-scripts/build/OT-Compiler/build.properties
new file mode 100644
index 0000000..d965ebb
--- /dev/null
+++ b/releng/build-scripts/build/OT-Compiler/build.properties
@@ -0,0 +1,11 @@
+# The location underwhich all of the build output will be collected.
+# This is a subdirectory of $buildDirectory
+# Set collectingFolder and archivePrefix to . if you want to create archives without
+# trailing eclipse in the paths of the included files
+collectingFolder=.
+
+# The prefix that will be used in the generated archive.
+# Does not make sense to use a different archivePrefix than collectingFolder,
+# because zip wouldn't find any files to include into the target zip otherwise
+archivePrefix=.
+
diff --git a/releng/build-scripts/build/OT-Compiler/customTargets.xml b/releng/build-scripts/build/OT-Compiler/customTargets.xml
new file mode 100644
index 0000000..87c3372
--- /dev/null
+++ b/releng/build-scripts/build/OT-Compiler/customTargets.xml
@@ -0,0 +1,147 @@
+<!--
+ Copyright (c) 2010 Stephan Herrmann and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Stephan Herrmann - initial API and implementation
+-->
+<project name="Build specific targets and properties" default="noDefault" >
+
+
+ <condition property="isNightlyBuild">
+ <equals arg1="${buildType}" arg2="N"/>
+ </condition>
+ <property file="${buildDirectory}/version.properties"/>
+ <property name="buildLabel" value="${buildType}-${featureVersion}"/>
+ <property name="buildId" value="${featureVersion}"/>
+
+
+ <!-- ===================================================================== -->
+ <!-- Run a given ${target} on all elements being built -->
+ <!-- Add on <ant> task for each top level element being built. -->
+ <!-- ===================================================================== -->
+ <target name="allElements">
+
+ <ant antfile="${genericTargets}" target="${target}" >
+ <property name="type" value="feature" />
+ <property name="id" value="org.eclipse.objectteams.otdt" />
+ </ant>
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Targets to assemble the built elements for particular configurations -->
+ <!-- These generally call the generated assemble scripts (named in -->
+ <!-- ${assembleScriptName}) but may also add pre and post processing -->
+ <!-- Add one target for each root element and each configuration -->
+ <!-- ===================================================================== -->
+ <target name="assemble.org.eclipse.objectteams.otdt">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="zipargs" value="" />
+ </ant>
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Check out map files from correct repository -->
+ <!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->
+ <!-- ===================================================================== -->
+ <target name="getMapFiles">
+ <delete dir="${buildDirectory}/maps"/>
+ <mkdir dir="${buildDirectory}/maps"/>
+ <property name="svn.map.url" value="${svn.repository.url}/${mapVersionTag}/${pathToMapFile}/${mapFileName}" />
+
+ <svn command="export" url="${svn.map.url}" dest="${buildDirectory}/maps/${mapFileName}" />
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before setup -->
+ <!-- ===================================================================== -->
+ <target name="preSetup">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after setup but before starting the build proper -->
+ <!-- ===================================================================== -->
+ <target name="postSetup">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before fetching the build elements -->
+ <!-- ===================================================================== -->
+ <target name="preFetch">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after fetching the build elements -->
+ <!-- ===================================================================== -->
+ <target name="postFetch">
+ <property name="meta.dir" value="${buildDirectory}/plugins/org.eclipse.jdt.core/META-INF"/>
+ <echo message="### Use Bootstrap_MANIFEST.MF in ${meta.dir} ###" />
+ <move file="${meta.dir}/Bootstrap_MANIFEST.MF" tofile="${meta.dir}/MANIFEST.MF" overwrite="yes" />
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before generating the build scripts. -->
+ <!-- ===================================================================== -->
+ <target name="preGenerate">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after generating the build scripts. -->
+ <!-- ===================================================================== -->
+ <target name="postGenerate">
+ </target>
+
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before running the build.xmls for the elements being built. -->
+ <!-- ===================================================================== -->
+ <target name="preProcess">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after running the build.xmls for the elements being built. -->
+ <!-- ===================================================================== -->
+ <target name="postProcess">
+ </target>
+
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before running assemble. -->
+ <!-- ===================================================================== -->
+ <target name="preAssemble">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after running assemble. -->
+ <!-- ===================================================================== -->
+ <target name="postAssemble">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the build is done. -->
+ <!-- ===================================================================== -->
+ <target name="postBuild">
+ <copy file="${buildDirectory}/${buildLabel}/org.eclipse.objectteams.otdt-${buildId}.zip" tofile="${build.root.dir}/org.eclipse.objectteams.otdt-${buildId}.zip" />
+
+ <echo message="### Insert OT Compiler in ${baseLocation} ###"/>
+ <unzip src="${build.root.dir}/org.eclipse.objectteams.otdt-${buildId}.zip" dest="${baseLocation}"/>
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do to publish the build results -->
+ <!-- ===================================================================== -->
+ <target name="publish">
+ </target>
+
+
+ <!-- ===================================================================== -->
+ <!-- Default target -->
+ <!-- ===================================================================== -->
+ <target name="noDefault">
+ <echo message="You must specify a target when invoking this file" />
+ </target>
+
+</project>
diff --git a/releng/build-scripts/build/OTDT-Build/build.properties b/releng/build-scripts/build/OTDT-Build/build.properties
new file mode 100644
index 0000000..97700f5
--- /dev/null
+++ b/releng/build-scripts/build/OTDT-Build/build.properties
@@ -0,0 +1,18 @@
+# The location underwhich all of the build output will be collected.
+# This is a subdirectory of $buildDirectory
+# Set collectingFolder and archivePrefix to . if you want to create archives without
+# trailing eclipse in the paths of the included files
+collectingFolder=.
+
+# The prefix that will be used in the generated archive.
+# Does not make sense to use a different archivePrefix than collectingFolder,
+# because zip wouldn't find any files to include into the target zip otherwise
+archivePrefix=.
+
+# The list of {os, ws, arch} configurations to build. This
+# value is a '&' separated list of ',' separate triples. For example,
+# configs=win32,win32,x86 & linux,motif,x86
+# By default the value is *,*,*
+
+configs=linux,gtk,ppc64
+
diff --git a/releng/build-scripts/build/OTDT-Build/customTargets.xml b/releng/build-scripts/build/OTDT-Build/customTargets.xml
new file mode 100644
index 0000000..252b433
--- /dev/null
+++ b/releng/build-scripts/build/OTDT-Build/customTargets.xml
@@ -0,0 +1,185 @@
+<!--
+ Copyright (c) 2010 Stephan Herrmann and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Stephan Herrmann - initial API and implementation
+-->
+<project name="Build specific targets and properties" default="noDefault" >
+
+
+ <condition property="isNightlyBuild">
+ <equals arg1="${buildType}" arg2="N"/>
+ </condition>
+ <property file="${buildDirectory}/version.properties"/>
+ <property name="buildLabel" value="${buildType}-${featureVersion}"/>
+ <property name="buildId" value="${featureVersion}"/>
+
+ <!-- ===================================================================== -->
+ <!-- Run a given ${target} on all elements being built -->
+ <!-- Add on <ant> task for each top level element being built. -->
+ <!-- ===================================================================== -->
+ <target name="allElements">
+
+ <!-- org.eclipse.objectteams.otdt.core.patch is included from otdt -->
+
+ <ant antfile="${genericTargets}" target="${target}" >
+ <property name="type" value="feature" />
+ <property name="id" value="org.eclipse.objectteams.otequinox" />
+ </ant>
+
+ <ant antfile="${genericTargets}" target="${target}" >
+ <property name="type" value="feature" />
+ <property name="id" value="org.eclipse.objectteams.otdt" />
+ </ant>
+
+ <condition property="really.run.tests">
+ <istrue value="${do.run.tests}"/>
+ </condition>
+
+ <antcall target="testElements" />
+
+ </target>
+
+ <target name="testElements" if="really.run.tests">
+ <ant antfile="${genericTargets}" target="${target}" >
+ <property name="type" value="feature" />
+ <property name="id" value="org.eclipse.objectteams.otdt-tests" />
+ </ant>
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Targets to assemble the built elements for particular configurations -->
+ <!-- These generally call the generated assemble scripts (named in -->
+ <!-- ${assembleScriptName}) but may also add pre and post processing -->
+ <!-- Add one target for each root element and each configuration -->
+ <!-- ===================================================================== -->
+
+ <!-- org.eclipse.objectteams.otdt.core.patch is included from otdt -->
+
+ <target name="assemble.org.eclipse.objectteams.otequinox">
+ <echo message="Not assembling org.eclipse.objectteams.otequinox, will create update.jars instead (later during the build)" />
+ </target>
+ <target name="assemble.org.eclipse.objectteams.otequinox.linux.gtk.ppc64">
+ <echo message="Not assembling org.eclipse.objectteams.otequinox.linux.gtk.ppc64, will create update.jars instead (later during the build)" />
+ </target>
+ <target name="assemble.org.eclipse.objectteams.otdt">
+ <echo message="Not assembling org.eclipse.objectteams.otdt, will create update.jars instead (later during the build)" />
+ </target>
+ <target name="assemble.org.eclipse.objectteams.otdt.linux.gtk.ppc64">
+ <echo message="Not assembling org.eclipse.objectteams.otdt.linux.gtk.ppc64, will create update.jars instead (later during the build)" />
+ </target>
+
+ <target name="assemble.org.eclipse.objectteams.otdt-tests">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="zipargs" value="" />
+ </ant>
+ </target>
+ <target name="assemble.org.eclipse.objectteams.otdt-tests.linux.gtk.ppc64">
+ <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+ <property name="zipargs" value="" />
+ </ant>
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Check out map files from correct repository -->
+ <!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->
+ <!-- ===================================================================== -->
+ <target name="getMapFiles">
+ <delete dir="${buildDirectory}/maps"/>
+ <mkdir dir="${buildDirectory}/maps"/>
+ <property name="svn.map.url" value="${svn.repository.url}/${mapVersionTag}/${pathToMapFile}/${mapFileName}" />
+
+ <svn command="export" url="${svn.map.url}" dest="${buildDirectory}/maps/${mapFileName}" />
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before setup -->
+ <!-- ===================================================================== -->
+ <target name="preSetup">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after setup but before starting the build proper -->
+ <!-- ===================================================================== -->
+ <target name="postSetup">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before fetching the build elements -->
+ <!-- ===================================================================== -->
+ <target name="preFetch">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after fetching the build elements -->
+ <!-- ===================================================================== -->
+ <target name="postFetch">
+ <echo message="Inserting OTRE into source tree"/>
+ <copy file="${otre.lib}/otre.jar" todir="${buildDirectory}/plugins/org.eclipse.objectteams.runtime/lib" />
+ <copy file="${otre.lib}/otre_min.jar" todir="${buildDirectory}/plugins/org.eclipse.objectteams.otdt/lib" />
+ <copy file="${otre.lib}/otre_agent.jar" todir="${buildDirectory}/plugins/org.eclipse.objectteams.otdt/lib" />
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before generating the build scripts. -->
+ <!-- ===================================================================== -->
+ <target name="preGenerate">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after generating the build scripts. -->
+ <!-- ===================================================================== -->
+ <target name="postGenerate">
+ </target>
+
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before running the build.xmls for the elements being built. -->
+ <!-- ===================================================================== -->
+ <target name="preProcess">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after running the build.xmls for the elements being built. -->
+ <!-- ===================================================================== -->
+ <target name="postProcess">
+ </target>
+
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before running assemble. -->
+ <!-- ===================================================================== -->
+ <target name="preAssemble">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after running assemble. -->
+ <!-- ===================================================================== -->
+ <target name="postAssemble">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the build is done. -->
+ <!-- ===================================================================== -->
+ <target name="postBuild">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do to publish the build results -->
+ <!-- ===================================================================== -->
+ <target name="publish">
+ </target>
+
+
+ <!-- ===================================================================== -->
+ <!-- Default target -->
+ <!-- ===================================================================== -->
+ <target name="noDefault">
+ <echo message="You must specify a target when invoking this file" />
+ </target>
+
+</project>
diff --git a/releng/build-scripts/build/build.xml b/releng/build-scripts/build/build.xml
new file mode 100644
index 0000000..0c174fe
--- /dev/null
+++ b/releng/build-scripts/build/build.xml
@@ -0,0 +1,99 @@
+<!--
+ Copyright (c) 2010 Stephan Herrmann and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Stephan Herrmann - initial API and implementation
+-->
+<project default="main">
+
+ <!--
+ Expected args:
+
+ component.short:what's building? Defined by where build.properties and customTargets.xml are found
+
+ OTScriptDir: where most build scripts are found (build)
+
+ build.root.dir: (testrun/build-root)
+ baseLocation: from where eclipse is running (testrun/build-root/eclipse)
+ run.eclipseScriptDir: relative location of pde.build's scripts
+ buildDirectory: where sources shall be built (testrun/build-root/src)
+
+ configs: what to build
+ baseos, basews, basearch: what platform we're on
+
+ -->
+ <loadproperties srcfile="${OTScriptDir}/buildVersions.properties" />
+ <loadproperties srcfile="${builder}/build.properties" />
+
+ <target name="main">
+ <!--Default values for required properties-->
+ <property name="buildDirectory" value="${build.root.dir}/src" />
+ <echo message="BUILDDIR: ${buildDirectory}" />
+ <delete failonerror="true" dir="${buildDirectory}" />
+ <antcall target="create.label.properties" />
+ <property file="${buildDirectory}/label.properties" />
+
+ <!--fetch the HEAD stream of all projects if build type specified as N-->
+ <condition property="fetchTag" value="HEAD">
+ <equals arg1="${buildType}" arg2="N" />
+ </condition>
+ <property name="fetchTag" value="" />
+
+ <!--set the compiler and compiler arguments-->
+ <!--the default compiler is set to the one used by eclipse rel. eng. -->
+ <loadproperties srcfile="${OTScriptDir}/compiler.${component.short}.properties" />
+
+ <!--this property required as of Eclipse 3.0 stream builds > 20031126 -->
+ <property name="buildingOSGi" value="true" />
+
+ <!--run the pde-build for the specified ${builder} (OT-Compiler or OTDT-Build) -->
+ <ant antfile="build.xml" dir="${baseLocation}/${run.eclipseScriptDir}" />
+
+ <!--and call our custom post- action -->
+ <antcall target="post${component.short}"/>
+ </target>
+
+ <target name="postOTDT-Build">
+ <!-- Export the build into an update site suitable to install by using the p2 director: -->
+ <ant antfile="${OTScriptDir}/p2helper.xml" target="createLocalUpdateSite" dir="${buildDirectory}"/>
+ <!-- add the bcel jar to the update site: -->
+ <copy file="${bcel.jar}" todir="${otdtUpdatesDir}/plugins"/>
+ </target>
+
+ <target name="postOT-Compiler">
+ <echo message="Nothing to do post OT-Compiler"/>
+ </target>
+
+ <target name="create.label.properties" unless="label.properties.exists">
+ <mkdir dir="${buildDirectory}" />
+ <tstamp/>
+ <property name="date" value="${DSTAMP}" />
+ <property name="time" value="${TSTAMP}" />
+ <property name="timestamp" value="${date}${time}" />
+ <property name="buildId" value="${buildType}${date}" />
+
+ <!--this naming convention used by php scripts on download server-->
+ <property name="buildLabel" value="${buildType}-${buildId}-${timestamp}" />
+
+ <!--store the build label information in a file-->
+ <echo file="${buildDirectory}/label.properties" append="true" >
+ buildType=${buildType}
+ </echo>
+ <echo file="${buildDirectory}/label.properties" append="true" >
+ buildId=${buildId}
+ </echo>
+ <echo file="${buildDirectory}/label.properties" append="true" >
+ timestamp=${timestamp}
+ </echo>
+ <echo file="${buildDirectory}/label.properties" append="true" >
+ buildLabel=${buildLabel}
+ </echo>
+
+ <available file="${buildDirectory}/label.properties" property="label.properties.exists" />
+ </target>
+
+</project>
diff --git a/releng/build-scripts/build/buildVersions.properties b/releng/build-scripts/build/buildVersions.properties
new file mode 100644
index 0000000..516672e
--- /dev/null
+++ b/releng/build-scripts/build/buildVersions.properties
@@ -0,0 +1,4 @@
+#fetchTag=SVN=v20100127
+#fetchTag=SVN=trunk
+buildType=I
+
diff --git a/releng/build-scripts/build/compiler.OT-Compiler.properties b/releng/build-scripts/build/compiler.OT-Compiler.properties
new file mode 100644
index 0000000..5c8cf56
--- /dev/null
+++ b/releng/build-scripts/build/compiler.OT-Compiler.properties
@@ -0,0 +1,10 @@
+# Configure the build compiler for phase 1.
+# This file is read from build/build.xml
+build.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
+compilerArg=-enableJavadoc -encoding ISO-8859-1
+javaSource=1.5
+javacSource=1.5
+javacTarget=1.5
+javacDebugInfo=true
+javacFailOnError=true
+
diff --git a/releng/build-scripts/build/compiler.OTDT-Build.properties b/releng/build-scripts/build/compiler.OTDT-Build.properties
new file mode 100644
index 0000000..8d5a6e7
--- /dev/null
+++ b/releng/build-scripts/build/compiler.OTDT-Build.properties
@@ -0,0 +1,10 @@
+# Configure the build compiler for phase 2.
+# This file is read from build/build.xml
+build.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
+compilerArg=-enableJavadoc -encoding ISO-8859-1 -warn:+inferredcallout
+javaSource=1.5
+javacSource=1.5
+javacTarget=1.5
+javacDebugInfo=true
+javacFailOnError=true
+
diff --git a/releng/build-scripts/build/otdt_prerequisites.sh b/releng/build-scripts/build/otdt_prerequisites.sh
new file mode 100644
index 0000000..8f57543
--- /dev/null
+++ b/releng/build-scripts/build/otdt_prerequisites.sh
@@ -0,0 +1,66 @@
+###############################################################################
+# Copyright (c) 2010 Stephan Herrmann and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Stephan Herrmann - initial API and implementation
+###############################################################################
+
+# Environment variables for the script otdt_runtests.sh
+
+# EXPORT: Root location on build.eclipse.org:
+BASEDIR=/shared/tools/objectteams
+
+# EXPORT: root directory for building and testing:
+OT_TESTSUITE_DIR=${BASEDIR}/testrun
+
+# EXPORT: tmp directory for logging:
+TMPDIR="${BASEDIR}/tmp"
+
+# EXPORT: directory for metadata from previous builds:
+METADATA="${BASEDIR}/metadata}"
+
+# EXPORT: mail address to receive notification about build result (currently only build failures):
+OT_RECIPIENT="stephan@cs.tu-berlin.de"
+
+# Configure ANT:
+ANT_HOME=/shared/common/apache-ant-1.7.1/
+PATH=${ANT_HOME}/bin:${PATH}
+
+# EXPORT: additional arguments to pass to Ant:
+ANT_PROFILE="-verbose"
+
+# EXPORT: Nice-level for the Ant process:
+NICE="10"
+
+# EXPORT: virtual or real X server (XVFB or X11):
+X11=XVFB
+
+# VERSIONS:
+# Eclipse SKD build identifier:
+EVERSION=I20100423-0906
+# Architecture (as used by OSGi):
+ARCH="-ppc64"
+# used only locally:
+DROP=${BASEDIR}/drops/I20100423-0906
+
+# EXPORT: archive file of the base eclipse SDK build:
+ECLIPSE_SDK_TGZ=${DROP}/eclipse-SDK-${EVERSION}-linux-gtk${ARCH}.tar.gz
+
+# EXPORT: archive file of the eclipse test framework:
+ECLIPSE_TESTLIB_ZIP=${DROP}/eclipse-test-framework-${EVERSION}.zip
+
+# used only below:
+ORBIT_DROP=/home/data/httpd/download.eclipse.org/tools/orbit/downloads/drops/S20100308015149
+
+# EXPORT: bcel jar file from orbit:
+BCEL_JAR=${ORBIT_DROP}/bundles/org.apache.bcel_5.2.0.v200803061811.jar
+
+# EXPORT: directory holding various otre jar files:
+OTRE_LIB=${BASEDIR}/lib
+
+
+
diff --git a/releng/build-scripts/build/otdt_runtests.sh b/releng/build-scripts/build/otdt_runtests.sh
new file mode 100755
index 0000000..2990695
--- /dev/null
+++ b/releng/build-scripts/build/otdt_runtests.sh
@@ -0,0 +1,162 @@
+#! /bin/sh
+# Copyright (c) 2010 Stephan Herrmann.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Stephan Herrmann - initial API and implementation
+###############################################################################
+
+# =============================================================================
+# MAIN BUILD AND TEST SCRIPT FOR THE OBJECT TEAMS DEVELOPMENT TOOLING (OTDT)
+# =============================================================================
+# INPUT: Variables from otdt_prerequisites:
+# -----------------------------------------------------------------------------
+# TMPDIR for log output
+# OT_TESTSUITE_DIR root directory for building and testing
+# METADATA directory for metadata from previous builds
+# OT_RECIPIENT mail address for failure messages
+# ECLIPSE_SDK_TGZ archive file of the base eclipse SDK build (full path)
+# ECLIPSE_TESTLIB_ZIP archive file of the eclipse test framework (full path)
+# BCEL_JAR jar file of the bcel jar from orbit
+# OTRE_LIB directory holding various otre jar files
+# ANT_PROFILE configure the ant process
+# X11 XVFB or X11
+# NICE niceness value for nice -n ${NICE}
+# =============================================================================
+# OUTPUT: Variables passed to the toplevel ant script
+# -----------------------------------------------------------------------------
+## As Environment Variables:
+## ANT_OPTS configure Ant
+## As Ant Arguments (from ANT_PROFILE):
+## -verbose configure Ant
+## As Java Properties:
+## -Declipse-app.tgz path of eclipse SDK
+## -Declipse.tests.zip path of eclipse test framework
+## -Dbcel.jar path of bcel jar
+## -Dotre.lib directory to otre jars
+## -Ddo.build.all true|false: should OTDT and tests be built?
+## -Ddo.run.tests true|false: should test be run?
+# =============================================================================
+
+usage()
+{
+ echo "Usage:"
+ echo "$0 [-b|-nobuild]"
+ echo " -b: build OTDT only, no testing."
+ echo " -nobuild: don't build OTDT, directly invoke testing."
+}
+
+notifyTestRunFailure()
+{
+ echo "Running the test-cases failed!";
+ local subject="OT Testsuite: Failure!"
+ local message="See the attached log to fix the problems."
+ local cmdLogfiles="-a ${OT_SUITE_LOG}-tail.gz"
+
+ grep -q "\[java\] BUILD FAILED" "$OT_SUITE_LOG" && { subject="OT Testsuite: Compile/Build Failure!"; }
+ grep -q "svn.*connection timed out" "$OT_SUITE_LOG" && { subject="OT Testsuite: SVN timeout"; message="Nothing to fix, next run hopefully works"; }
+ tail -1000 "$OT_SUITE_LOG" | gzip -f - > "${OT_SUITE_LOG}-tail.gz"
+ echo -e "$message" | mutt -s "$subject" $cmdLogfiles $OT_RECIPIENT
+ exit 1;
+}
+
+_prefix=`dirname $0`
+_prefix=`readlink -f $_prefix`
+. "${_prefix}/otdt_prerequisites.sh"
+
+#LOCAL: log file:
+OT_SUITE_LOG=$TMPDIR/ot-testsuite.log
+
+# LOCAL: the initial ant build file:
+BUILDFILE="${_prefix}/run.xml"
+
+#LOCAL: main ant target:
+MAIN_TARGET=${MAIN_TARGET:="ot-junit-all"}
+
+#LOCAL: should OTDT and tests be built?
+DO_BUILD="true"
+
+#LOCAL: should the tests be run?
+DO_RUN="true"
+
+while test $# -gt 0; do
+ case "$1" in
+ -b)
+ MAIN_TARGET="ot-junit-build"
+ DO_RUN="false"
+ shift
+ ;;
+ -nobuild)
+ DO_BUILD="false"
+ shift
+ ;;
+ -x11)
+ X11=X11
+ shift
+ ;;
+ *)
+ echo "Unknown argument: $1"
+ usage
+ exit 1
+ esac
+
+done
+
+# start working:
+
+test -d "$TMPDIR" || mkdir -p "$TMPDIR"
+test -d "$OT_TESTSUITE_DIR" || mkdir -p "$OT_TESTSUITE_DIR"
+cd "$OT_TESTSUITE_DIR"
+
+# cleanup previous:
+if [ "$DO_BUILD" == "true" ]
+then
+ rm -rf build-root
+ rm -rf test-root
+ rm -rf updateSite
+ rm -rf updateSiteTests
+ rm -rf metadata
+fi
+
+# preload metadata for appending:
+if [ -f "${METADATA}/content.xml" ]
+then
+ mkdir -p metadata
+ cp ${METADATA}/*.xml metadata
+fi
+
+trap "echo Aborting by SIGTERM; cleanup; exit 130" INT
+
+# Assemble the Ant call:
+ANT_OPTIONS="${ANT_PROFILE} \
+ -Declipse-app.tgz=${ECLIPSE_SDK_TGZ} \
+ -Declipse.tests.zip=${ECLIPSE_TESTLIB_ZIP} \
+ -Dbcel.jar=${BCEL_JAR} \
+ -Dotre.lib=${OTRE_LIB} \
+ -Ddo.run.tests=${DO_RUN} \
+ -Ddo.build.all=${DO_BUILD}"
+
+ANT_OPTS="-Xmx1024m"
+export ANT_OPTS
+
+CMD="nice -n ${NICE} ant -f ${BUILDFILE} ${ANT_OPTIONS} ${MAIN_TARGET}"
+
+if test "$X11" = "XVFB" && test `which xvfb-run` > /dev/null; then
+ echo "Running xvfb-run $CMD"
+
+ # make sure that xauth can be found
+ export PATH="$PATH:/usr/bin/X11"
+ # try to start with DISPLAY=10 instead of default 99 -- seems to not work everywhere
+ exec xvfb-run -n 10 -e xvfb.log --auto-servernum $CMD < /dev/null > ${OT_SUITE_LOG} 2>&1 || { notifyTestRunFailure; }
+else
+ echo "##### You don't have xvfb-run, the GUI tests will appear on your display... ####"
+ echo "Running $CMD"
+ eval "$CMD" < /dev/null
+fi
+
+trap - INT
+
+
diff --git a/releng/build-scripts/build/p2helper.xml b/releng/build-scripts/build/p2helper.xml
new file mode 100644
index 0000000..87805b1
--- /dev/null
+++ b/releng/build-scripts/build/p2helper.xml
@@ -0,0 +1,140 @@
+<!--
+ Copyright (c) 2010 Stephan Herrmann and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Stephan Herrmann - initial API and implementation
+-->
+<project name="p2.helper">
+
+ <!-- The following tasks prepare a local update site to install the OTDT from -->
+ <target name="createLocalUpdateSite">
+ <echo message="Creating local update site in ${otdtUpdatesDir}"/>
+
+ <!-- Create the directory structure -->
+ <mkdir dir="${otdtUpdatesDir}"/>
+ <mkdir dir="${otdtUpdatesDir}/features"/>
+ <mkdir dir="${otdtUpdatesDir}/plugins"/>
+ <!-- Build the jar files -->
+ <ant antfile="${builder}/customTargets.xml" target="allElements" dir="${otdtUpdatesDir}">
+ <property name="genericTargets" value="${OTScriptDir}/p2helper.xml"/>
+ <property name="target" value="updateSiteExport"/>
+ </ant>
+<!-- better to do this from run.xml (outside eclipse) -->
+<!-- <antcall target="generateMetadata"/> -->
+ </target>
+
+ <target name="updateSiteExport">
+ <condition property="isTestFeature">
+ <contains string="${id}" substring="tests"/>
+ </condition>
+ <antcall target="doUpdateSiteExport"/>
+ </target>
+
+ <target name="doUpdateSiteExport" unless="isTestFeature">
+ <echo message="Creating content for updateSite, feature ${id}"/>
+
+ <ant antfile="build.xml" dir="${buildDirectory}/features/${id}/" target="build.update.jar">
+ <property name="feature.destination" value="${otdtUpdatesDir}/features"/>
+ <property name="plugin.destination" value="${otdtUpdatesDir}/plugins"/>
+ </ant>
+ </target>
+
+ <target name="generateMetadata">
+ <echo message="Generating metadata for features and plugins in ${otdtUpdatesDir}"/>
+ <java
+ inputstring=""
+ dir="${baseLocation}"
+ fork="true"
+ classname="org.eclipse.equinox.launcher.Main"
+ classpath="${baseLocation}/plugins/${org.eclipse.equinox.launcher_jar}">
+ <arg value="-consoleLog"/>
+ <arg value="-nosplash"/>
+ <arg value="-arch"/>
+ <arg value="ppc64"/> <!-- FIXME -->
+ <arg value="-application"/>
+ <arg value="org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher" />
+ <arg value="-source"/>
+ <arg value="${otdtUpdatesDir}"/>
+ <arg value="-metadataRepository" />
+ <arg value="file:${otdtUpdatesDir}" />
+ <arg value="-metadataRepositoryName" />
+ <arg value="Object Teams Updates" />
+ <arg value="-artifactRepository" />
+ <arg value="file:${otdtUpdatesDir}" />
+ <arg value="-append" />
+ <!-- arg value="-compress" /-->
+ <!-- don't categorize features at this stage! -->
+ </java>
+
+ <!-- patch feature version in content.xml -->
+ <property name="patch-content.xsltFile" value="${OTScriptDir}/patch-content-xml.xsl" />
+ <property name="content.origFile" value="content.xml" />
+ <property name="content.transFile" value="content-patched.xml" />
+ <xslt basedir="${otdtUpdatesDir}" destdir="${otdtUpdatesDir}" includes="${content.origFile}" style="${patch-content.xsltFile}" force="true">
+ <outputproperty name="method" value="xml"/>
+ <outputproperty name="encoding" value="UTF-8"/>
+ <outputproperty name="indent" value="yes"/>
+ <mapper type="glob" from="${content.origFile}" to="${content.transFile}"/>
+ </xslt>
+ <move file="${otdtUpdatesDir}/${content.transFile}" tofile="${otdtUpdatesDir}/${content.origFile}" overwrite="yes"/>
+ </target>
+
+ <target name="installFeature">
+ <echo message="Installing ${feature} from ${sourceUpdatesDir} to ${targetEclipseDir}"/>
+ <java
+ inputstring=""
+ dir="${targetEclipseDir}"
+ fork="true"
+ classname="org.eclipse.equinox.launcher.Main"
+ classpath="${targetEclipseDir}/plugins/${org.eclipse.equinox.launcher_jar}">
+ <jvmarg value="-Declipse.p2.MD5Check=false" />
+ <arg value="-consoleLog"/>
+ <arg value="-arch"/>
+ <arg value="ppc64"/> <!-- FIXME -->
+ <arg value="-application"/>
+ <arg value="org.eclipse.equinox.p2.director"/>
+ <arg value="-metadataRepository" />
+ <arg value="file:${sourceUpdatesDir}" />
+ <arg value="-artifactRepository" />
+ <arg value="file:${sourceUpdatesDir}" />
+ <arg value="-installIU" />
+ <arg value="${feature}" />
+ </java>
+ </target>
+
+ <target name="installOTDT">
+ <echo message="Installing the OTDT from ${otdtUpdatesDir} into ${test.eclipseDir}"/>
+ <antcall target="installFeature">
+ <param name="feature" value="org.eclipse.objectteams.otequinox.feature.group"/>
+ <param name="sourceUpdatesDir" value="${otdtUpdatesDir}"/>
+ <param name="targetEclipseDir" value="${test.eclipseDir}"/>
+ </antcall>
+ <antcall target="installFeature">
+ <param name="feature" value="org.eclipse.objectteams.otdt.feature.group"/>
+ <param name="sourceUpdatesDir" value="${otdtUpdatesDir}"/>
+ <param name="targetEclipseDir" value="${test.eclipseDir}"/>
+ </antcall>
+ <echo message="Generating accumulating metadata in ${otdtUpdatesDir}" />
+ <!-- existing meta data are pre-loaded from build.xml -->
+ <antcall target="generateMetadata" />
+ </target>
+
+ <target name="installTests">
+ <echo message="Installing the Tests from ${testsUpdatesDir} into ${test.eclipseDir}"/>
+ <antcall target="installFeature">
+ <param name="feature" value="org.eclipse.test.feature.group"/>
+ <param name="sourceUpdatesDir" value="${testsUpdatesDir}"/>
+ <param name="targetEclipseDir" value="${test.eclipseDir}"/>
+ </antcall>
+ <antcall target="installFeature">
+ <param name="feature" value="org.eclipse.objectteams.otdt-tests.feature.group"/>
+ <param name="sourceUpdatesDir" value="${testsUpdatesDir}"/>
+ <param name="targetEclipseDir" value="${test.eclipseDir}"/>
+ </antcall>
+ </target>
+
+</project>
diff --git a/releng/build-scripts/build/patch-content-xml.xsl b/releng/build-scripts/build/patch-content-xml.xsl
new file mode 100644
index 0000000..5706870
--- /dev/null
+++ b/releng/build-scripts/build/patch-content-xml.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2004/07/xpath-functions" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes" exclude-result-prefixes="xs fn xdt">
+ <xsl:template match="@range[../@name='org.eclipse.jdt.feature.group' and starts-with(.,'[3.6.0.v20100308-1800')]">
+ <xsl:attribute name="range">[3.6.0.v20100308-1800,3.6.0.v20100308-1801)</xsl:attribute>
+ </xsl:template>
+ <!-- Whenever you match any node or any attribute -->
+ <xsl:template match="node()|@*">
+ <!-- Copy the current node -->
+ <xsl:copy>
+ <!-- Including any attributes it has and any child nodes -->
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/releng/build-scripts/build/run.properties b/releng/build-scripts/build/run.properties
new file mode 100644
index 0000000..f516f6b
--- /dev/null
+++ b/releng/build-scripts/build/run.properties
@@ -0,0 +1,33 @@
+###############################################################################
+# Copyright (c) 2010 Stephan Herrmann and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Stephan Herrmann - initial API and implementation
+###############################################################################
+
+# Note: for some reason, only one vm-argument is possible.
+#vm.args=-Xmx256m
+
+# this one is used by eclipse junit tests:
+vmargs=-Xmx512m
+
+# SVN repository information:
+svn.repository.url=svn://localhost/svnroot/tools/org.eclipse.objectteams/
+mapVersionTag=trunk
+pathToMapFile=releng/map
+svn.devel.branch=trunk
+
+# Version dependent names:
+
+# Details of the Eclipse SDK build upon:
+run.eclipseScriptDir=plugins/org.eclipse.pde.build_3.6.0.v20100421/scripts
+org.eclipse.equinox.launcher_jar=org.eclipse.equinox.launcher_1.1.0.v20100419.jar
+
+# SVN Support for PDE BUILD:
+# (Note: this file must be provided in ${OTScriptDir}/lib)
+svn.pde.build=org.eclipse.team.svn.pde.build_0.7.8.I20090525-1500.jar
+
diff --git a/releng/build-scripts/build/run.xml b/releng/build-scripts/build/run.xml
new file mode 100644
index 0000000..bb4ec70
--- /dev/null
+++ b/releng/build-scripts/build/run.xml
@@ -0,0 +1,336 @@
+<?xml version="1.0"?>
+<!--
+ Copyright (c) 2010 Stephan Herrmann and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Stephan Herrmann - initial API and implementation
+-->
+<project name="Main Object Teams Build and Test Automation" default="INFO">
+
+ <target name="showGivenProperties"
+ description="Show values of all properties that should be passed from our caller.">
+ <echo>Properties passed into this script:
+------------------------------------------------------------------------------
+path of eclipse SDK:
+ eclipse-app.tgz = ${eclipse-app.tgz}
+path of eclipse test framework:
+ eclipse.tests.zip= ${eclipse.tests.zip}
+path of bcel jar:
+ bcel.jar = ${bcel.jar}
+directory to otre jars:
+ otre.lib = ${otre.lib}
+should sources be built (true|false)?
+ do.build.all = ${do.build.all}
+should test be run (true|false)?
+ do.run.tests = ${do.run.tests}
+------------------------------------------------------------------------------
+ </echo>
+ </target>
+
+ <target name="setupProperties" depends="showGivenProperties">
+
+ <dirname property="_toplevelDir" file="${ant.file}"/>
+
+ <!-- main configuration file (version dependent names etc.): -->
+ <loadproperties srcfile="${_toplevelDir}/run.properties" />
+
+ <!-- versions of test plugins, also find org.eclipse.test here: -->
+ <loadproperties srcfile="${_toplevelDir}/test.properties" />
+
+ <!-- ======== Directories (indentation shows structure): ======== -->
+ <!-- build scripts: -->
+ <property name="OTScriptDir" value="${_toplevelDir}" />
+ <property name="buildfile" value="${OTScriptDir}/build.xml" />
+ <property name="builder-otcompiler" value="${OTScriptDir}/OT-Compiler" />
+ <property name="builder-otdt" value="${OTScriptDir}/OTDT-Build" />
+
+ <!-- directories for the build: -->
+ <property name="build.root.dir" value="${user.dir}/build-root" />
+ <!-- Both these names are hard coded in pde-build: -->
+ <property name="buildDirectory" value="${build.root.dir}/src" />
+ <property name="baseLocation" value="${build.root.dir}/eclipse" />
+
+ <!-- directories for testing: -->
+ <property name="test.root.dir" value="${user.dir}/test-root" />
+ <!-- This name is used in individual test.xml of test plugins: -->
+ <property name="test.eclipseDir" value="${test.root.dir}/eclipse" />
+
+ <!-- directories for update sites: -->
+ <property name="otdtUpdatesDir" value="${user.dir}/updateSite"/>
+ <property name="testsUpdatesDirBase" value="${user.dir}/updateSiteTests"/>
+ <property name="testsUpdatesDir" value="${testsUpdatesDirBase}/eclipse"/>
+
+ <!-- ======== More Configuration Details: ======== -->
+ <!-- maybe obsolete: file prefix to distinguish output files. -->
+ <property name="file-id" value="XXX" />
+
+ <!-- Configure Java for STAGE 1 and STAGE 2 building: -->
+ <property name="vm" value="java" />
+ <property name="vm.args" value="-Xmx912m" />
+ <property name="vm.args2" value="-XX:MaxPermSize=128m" />
+
+ <property name="installmode" value="clean" />
+
+ <property name="saxon.jar.name" value="saxon8.jar" />
+ <property name="saxon.jar.path" value="${user.home}/.ant/lib/${saxon.jar.name}" />
+ <available file="${saxon.jar.path}" property="_hasSaxon.jar" />
+
+ <!-- ant's os.arch is slightly different than osgi's arch -->
+ <condition property="arch" value="x86">
+ <os arch="i386" />
+ </condition>
+ <condition property="arch" value="ppc64"> <!-- HACK: hard coding 64-bit architecture -->
+ <os arch="ppc" />
+ </condition>
+ <!-- if not set above, set it to os.arch -->
+ <property name="arch" value="${os.arch}" />
+
+ </target>
+
+
+ <target name="INFO">
+ <echo>Usage:
+ ant -f run.xml ot-junit-all -> runs OTDT Build and Testprocess
+ ant -f run.xml ot-junit-build -> runs just OTDT Buildprocess
+ ant -f run.xml ot-junit-run -> runs just OTDT Tests w/o TestSetup
+ </echo>
+ </target>
+
+ <target name="ot-junit-all" depends="setupProperties,checkOS" description="Build all and run all tests.">
+ <echo message="Starting BuildProcess and Testrun in ${build.root.dir}"/>
+ <antcall target="verifyAntInstall"/>
+ <antcall target="setupTests" />
+ <antcall target="runAllTests"/>
+ </target>
+
+ <target name="ot-junit-build" depends="setupProperties,checkOS" description="build everything without running tests">
+ <echo message="Starting BuildProcess in ${build.root.dir}"/>
+ <antcall target="verifyAntInstall"/>
+ <antcall target="createOTDTEclipse"/>
+ </target>
+
+ <target name="ot-junit-run" depends="setupProperties,checkOS" description="Run tests without building">
+ <echo message="Starting Testrun ${test.root.dir}"/>
+ <antcall target="runAllTests" />
+ </target>
+
+ <!-- =================== END Public Targets ==================== -->
+
+ <!-- === Setup Targets: === -->
+
+ <target name="verifyAntInstall" unless="_hasSaxon.jar">
+ <copy failonerror="true" overwrite="false" file="${OTScriptDir}/${saxon.jar.name}" tofile="${saxon.jar.path}"></copy>
+ <echo message="Needed to copy saxon8.jar to ${saxon.jar.path}. Please restart the build." />
+ <echo message="For an explanation, see http://ant.apache.org/faq.html#delegating-classloader-1.6" />
+ <fail message="See above. Please restart the build."/>
+ </target>
+
+ <!-- checks on which os ant is run, set ${os} and ${ws} accordingly -->
+ <target name="determineOS">
+ <condition property="os.isWindows">
+ <os family="windows"/>
+ </condition>
+
+ <condition property="os.isLinux">
+ <os name="Linux" />
+ </condition>
+ </target>
+
+ <target name="checkOS" depends="determineOS,windows,linux"/>
+
+ <target name="windows" if="os.isWindows">
+ <echo message="OS is Windows"/>
+ <property name="os" value="win32" />
+ <property name="ws" value="win32" />
+ </target>
+
+ <target name="linux" unless="os.isWindows" >
+ <echo message="OS is Linux"/>
+ <!-- eclipse-app.tgz is already passed from the calling script -->
+ <property name="os" value="linux" />
+ <property name="ws" value="gtk" />
+ </target>
+
+ <target name="setupForCompile" depends="checkOS" unless="_hasCreatedOTDTEclipse">
+ <antcall target="UnzipEclipse"/>
+ <antcall target="AddPluginsToEclipse"/>
+ </target>
+
+ <target name="UnzipEclipse">
+ <echo message="Extracting Eclipse (${eclipse-app.tgz}) in ${build.root.dir}..."/>
+ <mkdir dir="${build.root.dir}"/>
+ <untar compression="gzip" src="${eclipse-app.tgz}" dest="${build.root.dir}"/>
+ </target>
+
+ <target name="AddPluginsToEclipse" description="Add bcel and svn.pde.build plugins to the base Eclipse">
+ <mkdir dir="${baseLocation}/dropins/plugins"/>
+ <copy file="${bcel.jar}" todir="${baseLocation}/dropins/plugins"/>
+ <copy file="${OTScriptDir}/lib/${svn.pde.build}" todir="${baseLocation}/dropins/plugins" />
+ </target>
+
+ <!-- ==== BUILDING AND RUNNING: ==== -->
+
+ <!-- ==== BUILD STAGE 1: ==== -->
+ <!-- setting an empty inputstring is a workaround for http://issues.apache.org/bugzilla/show_bug.cgi?id=34461 -->
+ <target name="createOTCompilerEclipse" depends="setupForCompile" description="create the bootstrapping Eclipse with OT/J compiler">
+ <echo message="Invoke pdebuild for creating the OT-Compiler"/>
+ <java
+ inputstring=""
+ dir="${baseLocation}"
+ fork="true"
+ classname="org.eclipse.equinox.launcher.Main"
+ classpath="${baseLocation}/plugins/${org.eclipse.equinox.launcher_jar}">
+ <arg value="-Dosgi.ws=${ws}"/>
+ <arg value="-Dosgi.os=${os}"/>
+ <arg value="-Dosgi.arch=${arch}"/>
+ <arg value="-application"/>
+ <arg value="org.eclipse.ant.core.antRunner"/>
+ <arg value="-buildfile"/>
+ <arg value="${buildfile}"/>
+ <arg value="-Dbuild.root.dir=${build.root.dir}"/>
+ <arg value="-DbaseLocation=${baseLocation}"/>
+ <arg value="-DOTScriptDir=${OTScriptDir}"/>
+ <arg value="-Drun.eclipseScriptDir=${run.eclipseScriptDir}"/>
+ <arg value="-Dbuilder=${builder-otcompiler}"/>
+ <arg value="-D${installmode}=true"/> <!-- <- obsolete? -->
+ <arg value="-Dcomponent.short=OT-Compiler"/>
+ <arg value="-Dconfigs=*,*,*"/>
+ <arg value="-Dbaseos=${os}"/>
+ <arg value="-Dbasews=${ws}"/>
+ <arg value="-Dbasearch=${arch}"/>
+ <arg value="-Dtest.root.dir=${test.root.dir}"/>
+ <arg value="-Dtest.eclipseDir=${test.eclipseDir}"/>
+ <arg value="-DmapVersionTag=${mapVersionTag}"/>
+ <arg value="-DpathToMapFile=${pathToMapFile}"/>
+ <arg value="-DmapFileName=ot-compiler.map"/>
+ <arg value="-Dsvn.repository.url=${svn.repository.url}"/>
+ <arg value="-Declipse-app.tgz=${eclipse-app.tgz}"/>
+ <arg value="-Declipse.tests.zip=${eclipse.tests.zip}"/>
+ <arg value="-verbose" />
+ <jvmarg value="${vm.args}"/>
+ <jvmarg value="${vm.args2}"/>
+ </java>
+ <!-- At this point a zip file containing the new jdt.core-plugin exists in
+ ${build.root.dir}/org.eclipse.objectteams.otdt-${buildId}.zip
+ which has already been installed into ${baseLocation} as to replace the
+ original plugin jar of exact same name (see OT-Compiler/customTargets.xml#postBuild)..
+ -->
+ </target>
+
+ <!-- ==== BUILD STAGE 2: ==== -->
+ <!-- setting an empty inputstring is a workaround for http://issues.apache.org/bugzilla/show_bug.cgi?id=34461 -->
+ <target name="createOTDTEclipse" depends="createOTCompilerEclipse" unless="_hasCreatedOTDTEclipse">
+
+ <!-- Make org.eclipse.test.performance available while compiling test projects: -->
+ <echo message="Pre-installing Eclipse Test Framework into OTCompilerEclipse..."/>
+ <mkdir dir="${testsUpdatesDir}"/>
+ <unzip dest="${testsUpdatesDirBase}" src="${eclipse.tests.zip}"/>
+ <ant antfile="${OTScriptDir}/p2helper.xml" target="installFeature" dir="${baseLocation}">
+ <property name="feature" value="org.eclipse.test.feature.group"/>
+ <property name="sourceUpdatesDir" value="${testsUpdatesDir}"/>
+ <property name="targetEclipseDir" value="${baseLocation}"/>
+ </ant>
+
+ <echo message="Invoke pdebuild for creating a full OTDT"/>
+ <java
+ inputstring=""
+ dir="${baseLocation}"
+ fork="true"
+ classname="org.eclipse.equinox.launcher.Main"
+ classpath="${baseLocation}/plugins/${org.eclipse.equinox.launcher_jar}">
+ <arg value="-clean"/>
+ <arg value="-Dosgi.ws=${ws}"/>
+ <arg value="-Dosgi.os=${os}"/>
+ <arg value="-Dosgi.arch=${arch}"/>
+ <arg value="-application"/>
+ <arg value="org.eclipse.ant.core.antRunner"/>
+ <arg value="-buildfile"/>
+ <arg value="${buildfile}"/>
+ <arg value="-Dbuild.root.dir=${build.root.dir}"/>
+ <arg value="-DbaseLocation=${baseLocation}"/>
+ <arg value="-Drun.eclipseScriptDir=${run.eclipseScriptDir}"/>
+ <arg value="-DOTScriptDir=${OTScriptDir}"/>
+ <arg value="-Dbuilder=${builder-otdt}"/>
+ <arg value="-D${installmode}=true"/>
+ <arg value="-Dcomponent.short=OTDT-Build"/>
+ <arg value="-DotdtUpdatesDir=${otdtUpdatesDir}"/>
+ <arg value="-Dbaseos=${os}"/>
+ <arg value="-Dbasews=${ws}"/>
+ <arg value="-Dbasearch=${arch}"/>
+ <arg value="-Dtest.root.dir=${test.root.dir}"/>
+ <arg value="-Dtest.eclipseDir=${test.eclipseDir}"/>
+ <arg value="-Dsvn.repository.url=${svn.repository.url}"/>
+ <arg value="-Dsvn.devel.branch=${svn.devel.branch}"/>
+ <arg value="-DmapVersionTag=${mapVersionTag}"/>
+ <arg value="-DpathToMapFile=${pathToMapFile}"/>
+ <arg value="-DmapFileName=otdt.map"/>
+ <arg value="-Ddo.run.tests=${do.run.tests}"/>
+ <arg value="-Ddo.build.all=${do.build.all}"/>
+ <arg value="-Declipse-app.tgz=${eclipse-app.tgz}"/>
+ <arg value="-Declipse.tests.zip=${eclipse.tests.zip}"/>
+ <arg value="-Dotre.lib=${otre.lib}"/>
+ <arg value="-Dbcel.jar=${bcel.jar}"/>
+ <arg value="-verbose" />
+ <jvmarg value="${vm.args}"/>
+ <jvmarg value="${vm.args2}"/>
+ <!-- arg value="${verboseAnt}"/ -->
+ <!-- arg value="-debug" / -->
+ </java>
+ <!-- At this point a local update site exists
+ (created from build.xml#postOTDT-Build -> p2helper.xml#createLocalUpdateSite)
+ -->
+
+ <!-- Generate accumulating metadata by pre-loading existing metadata: -->
+ <copy failonerror="false" flatten="true" toDir="${otdtUpdatesDir}">
+ <fileset dir="${user.dir}/metadata">
+ <include name="*.xml"/>
+ </fileset>
+ </copy>
+ <ant antfile="${OTScriptDir}/p2helper.xml" dir="${buildDirectory}" target="generateMetadata"/>
+
+ <property name="_hasCreatedOTDTEclipse" value="true" />
+ </target>
+
+ <!-- TESTING at STAGE 3: -->
+ <target name="setupTests" depends="createOTDTEclipse" description="Install the tests into an fresh OTDT">
+ <available file="${buildDirectory}/label.properties" property="label.properties.exists" />
+ <ant antfile="${OTScriptDir}/test.xml" target="setupTests" dir="${build.root.dir}">
+ <property name="os" value="${os}" />
+ <property name="ws" value="${ws}" />
+ <property name="arch" value="${arch}" />
+ <property name="baseos" value="${os}" />
+ <property name="basews" value="${ws}" />
+ <property name="basearch" value="${arch}" />
+ <property name="eclipse-app.tgz" value="${eclipse-app.tgz}" />
+ <property file="${buildDirectory}/label.properties" />
+ <property name="otdtUpdatesDir" value="${otdtUpdatesDir}" />
+ <property name="testsUpdatesDir" value="${testsUpdatesDir}" />
+ </ant>
+ </target>
+
+ <target name="runAllTests" description="Delegate to the next level script to perform the actual testing.">
+ <ant antfile="${OTScriptDir}/test.xml" target="all" dir="${build.root.dir}">
+ <property name="os" value="${os}" />
+ <property name="ws" value="${ws}" />
+ <property name="arch" value="${arch}" />
+ <property name="baseos" value="${os}" />
+ <property name="basews" value="${ws}" />
+ <property name="basearch" value="${arch}" />
+ <property name="otdtUpdatesDir" value="${otdtUpdatesDir}" />
+ <property name="testsUpdatesDir" value="${testsUpdatesDir}" />
+ <property name="vmargs" value="${vmargs}" />
+ </ant>
+ </target>
+
+ <!-- currently unused target name="collectResults">
+ <ant target="collect" antfile="${test.eclipseDir}/plugins/${org.eclipse.test}/library.xml" dir="${otresults}">
+ <property name="includes" value="org.*.xml"/>
+ <property name="output-file" value="AllTestSuites.xml"/>
+ </ant>
+ </target -->
+
+</project>
diff --git a/releng/build-scripts/build/test.properties b/releng/build-scripts/build/test.properties
new file mode 100644
index 0000000..a72879f
--- /dev/null
+++ b/releng/build-scripts/build/test.properties
@@ -0,0 +1,22 @@
+#this is part of the file name of the test feature zip:
+config=linux.gtk.ppc64
+
+# versions of test plugins:
+
+org.eclipse.jdt.core.tests.builder=org.eclipse.jdt.core.tests.builder_3.3.100.v_A46
+org.eclipse.jdt.core.tests.compiler=org.eclipse.jdt.core.tests.compiler_3.3.100
+org.eclipse.jdt.core.tests.model=org.eclipse.jdt.core.tests.model_3.3.100
+org.eclipse.test.performance=org.eclipse.test.performance_3.6.0
+org.eclipse.jdt.debug.tests=org.eclipse.jdt.debug.tests_3.1.100
+org.eclipse.jdt.ui.tests=org.eclipse.jdt.ui.tests_3.6.0
+org.eclipse.jdt.ui.tests.refactoring=org.eclipse.jdt.ui.tests.refactoring_3.6.0
+# this is part of eclipse-test-framework and holds library.xml:
+org.eclipse.test=org.eclipse.test_3.3.0
+
+org.eclipse.objectteams.otdt.tests=org.eclipse.objectteams.otdt.tests_1.3.0
+org.eclipse.objectteams.otdt.ui.tests=org.eclipse.objectteams.otdt.ui.tests_1.3.0
+org.eclipse.objectteams.otdt.ui.tests.dom=org.eclipse.objectteams.otdt.ui.tests.dom_1.3.0
+org.eclipse.objectteams.otdt.debug.tests=org.eclipse.objectteams.otdt.debug.tests_1.3.0
+org.eclipse.objectteams.otdt.ui.tests.refactoring=org.eclipse.objectteams.otdt.ui.tests.refactoring_1.3.0
+org.eclipse.objectteams.otdt.test.builder=org.eclipse.objectteams.otdt.test.builder_1.3.0
+
diff --git a/releng/build-scripts/build/test.xml b/releng/build-scripts/build/test.xml
new file mode 100644
index 0000000..4b50a08
--- /dev/null
+++ b/releng/build-scripts/build/test.xml
@@ -0,0 +1,175 @@
+<!--
+ Copyright (c) 2010 Stephan Herrmann and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Stephan Herrmann - initial API and implementation
+-->
+<project name="Automated Object Teams Testing" default="all" basedir="." >
+
+ <!--properties file containing the plugin directory name including version number-->
+ <dirname property="_myDir" file="${ant.file}"/>
+ <property file="${_myDir}/test.properties" />
+
+ <!--properties file containing the build information-->
+ <property file="src/label.properties" />
+
+ <target name="readFlags">
+ <condition property="really.build.all">
+ <istrue value="${do.build.all}"/>
+ </condition>
+ </target>
+
+ <target name="checkFlags" depends="readFlags" unless="really.build.all">
+ <property name="otdt-eclipse.is.setup" value="true"/>
+ <property name="tests.are.setup" value="true"/>
+ </target>
+
+ <target name="setupOTDTEclipse" depends="checkFlags" unless="otdt-eclipse.is.setup"
+ description="Creates the SUT by extracting a fresh Eclipse SDK and installing the OTDT into it"
+ >
+ <echo message="### Build Test Eclipse ###"/>
+ <echo message="Extracting Eclipse..."/>
+ <untar compression="gzip" src="${eclipse-app.tgz}" dest="${test.root.dir}"/>
+
+ <echo message="Installing OTDT..."/>
+ <ant antfile="${OTScriptDir}/p2helper.xml" target="installOTDT" dir="${test.eclipseDir}"/>
+
+ <property name="otdt-eclipse.is.setup" value="true"/>
+ </target>
+
+ <target name="setupTests" depends="setupOTDTEclipse" unless="tests.are.setup"
+ description="Installes the OTDT-Tests into the OTDT"
+ >
+ <echo message="Setting up tests in ${test.eclipseDir}"/>
+
+ <echo message="Unpacking OTDT Tests..."/>
+ <unzip src="${buildDirectory}/${buildLabel}/org.eclipse.objectteams.otdt-tests-${buildId}-${config}.zip"
+ dest="${testsUpdatesDir}"/>
+
+ <!-- do install using p2: -->
+ <ant antfile="${OTScriptDir}/p2helper.xml" target="installTests" dir="${test.eclipseDir}"/>
+
+ <property name="tests.are.setup" value="true"/>
+ </target>
+
+ <target name="runtests"
+ description="Runs ant on the test.xml for a specified plugin.
+ Requires a property value setting for testPlugin only if test.properties is not available.
+ The property testPlugin represents a directory name made up of the plugin id and plugin version.
+ This directory must contain a valid test.xml."
+ >
+ <ant antfile="plugins/${testPlugin}/test.xml" dir="${test.eclipseDir}">
+ <property name="eclipse-home" value="${test.eclipseDir}" />
+ <property name="extraVMargs" value="-XX:MaxPermSize=320m"/>
+ </ant>
+ </target>
+
+ <target name="otdt_tests" description="Runs the org.eclipse.objectteams.otdt.tests test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.objectteams.otdt.tests}" />
+ </antcall>
+ </target>
+
+ <target name="jdtcore_compiler_tests" description="Runs the org.eclipse.jdt.core.tests.compiler test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.jdt.core.tests.compiler}" />
+ </antcall>
+ </target>
+
+ <target name="jdtcore_model_tests" description="Runs the org.eclipse.jdt.core.tests.model test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.jdt.core.tests.model}" />
+ </antcall>
+ </target>
+
+ <target name="jdt_builder_tests" description="Runs the org.eclipse.jdt.core.tests.builder test.xml">
+ <property name="library-file"
+ value="${test.eclipseDir}/plugins/${org.eclipse.test}/library.xml"/>
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.jdt.core.tests.builder}" />
+ </antcall>
+ </target>
+
+
+ <target name="otdt_ui_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests}" />
+ </antcall>
+ </target>
+
+ <target name="otdt_dom_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.dom test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests.dom}" />
+ </antcall>
+ </target>
+
+ <target name="otdt_ref_tests" description="Runs the org.eclipse.objectteams.otdt.ui.tests.refactoring test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.objectteams.otdt.ui.tests.refactoring}" />
+ </antcall>
+ </target>
+
+ <target name="jdt_ui_tests" description="Runs the org.eclipse.jdt.ui.tests test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.jdt.ui.tests}" />
+ </antcall>
+ </target>
+
+ <target name="jdt_ref_tests" description="Runs the org.eclipse.jdt.ui.tests.refactoring test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.jdt.ui.tests.refactoring}" />
+ </antcall>
+ </target>
+
+ <target name="jdt_debug_tests" description="Runs the org.eclipse.jdt.debug.tests test.xml">
+ <property name="library-file"
+ value="${test.eclipseDir}/plugins/${org.eclipse.test}/library.xml"/>
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.jdt.debug.tests}" />
+ </antcall>
+ </target>
+
+ <target name="otdt_debug_tests" description="Runs the org.eclipse.objectteams.otdt.debug.tests test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.objectteams.otdt.debug.tests}" />
+ </antcall>
+ </target>
+
+ <target name="otdt_builder_tests" description="Runs the org.eclipse.objectteams.otdt.test.builder test.xml">
+ <antcall target="runtests">
+ <param name="testPlugin" value="${org.eclipse.objectteams.otdt.test.builder}" />
+ </antcall>
+ </target>
+
+ <target name="all">
+<!-- enable if we want to debug otre/otequinox:
+<property name="extraVMargs" value="-Dot.dump=1 -Dotequinox.debug=OK" />
+-->
+ <!-- debug tests don't like parallelization -->
+ <antcall target="jdt_debug_tests" />
+ <antcall target="otdt_debug_tests" />
+ <parallel threadCount="2">
+ <!-- "slow", ui tests come first -->
+ <antcall target="jdt_ref_tests" />
+ <antcall target="jdt_ui_tests" />
+ <antcall target="otdt_ui_tests" />
+ <antcall target="otdt_ref_tests" />
+ <antcall target="otdt_dom_tests" />
+ <antcall target="otdt_tests" />
+ <antcall target="jdt_builder_tests" />
+ <antcall target="jdtcore_compiler_tests" />
+ <antcall target="jdtcore_model_tests" />
+ <antcall target="otdt_builder_tests" />
+ <!-- antcall target="otdt_metrics_tests" / -->
+ </parallel>
+ </target>
+
+ <target name="onlyone">
+ <antcall target="otdt_ui_tests" />
+ </target>
+
+</project>