blob: 00f378dc86e7270ba219e422798e09b9e8e1e0b2 [file] [log] [blame]
#!/bin/sh
#
# ptpbuild wrapper script
#
# Usage: ptpbuild [-t tag] [-d build_dir] [build_args]
#
# where
#
# tag is the CVS tag used to check out the releng project (default HEAD)
# build_dir is the location that the build will take place
# build_args are any arguments you want to pass to the build script
#
# set up anything environment specific that needs to be done before
# launching the build script in the releng project
TAG=HEAD
CDT_TAG=HEAD
# main staging directory
BUILD_DIR=/opt/public/download-staging.priv/tools/ptp/releng
args=`getopt d:t: $*`
if [ $? != 0 ]; then
echo "usage: ptpbuild [-t tag] [-c cdt_tag] [-d build_dir] [build_args]"
exit 1
fi
set -- $args
for i
do
case "$i"
in
-c) CDT_TAG="$2"; shift; shift;;
-d) BUILD_DIR="$2"; shift; shift;;
-t) TAG="$2"; shift; shift;;
--) shift; break;;
esac
done
BUILD_LOG=$BUILD_DIR/ptpbuild_${TAG}_`date +%Y%m%d%H%M`.log
{
# create the releng staging directory and go there
mkdir -p $BUILD_DIR && cd $BUILD_DIR
# remove the old build
rm -fr org.eclipse.ptp
# Check out the releng project
export CVSROOT=:pserver:anonymous@dev.eclipse.org:/cvsroot/tools
cvs co -r $TAG -d org.eclipse.ptp org.eclipse.ptp/releng/org.eclipse.ptp.releng
# run the main script
cd org.eclipse.ptp
sh build.sh $*
# Build RDT server packages
cd results/plugins
# Check out rdt.core.remotejars, rdt.core.stubs and cdt.core for source
export CVSROOT=:pserver:anonymous@dev.eclipse.org:/cvsroot/tools
cvs co -r $TAG -d org.eclipse.ptp.rdt.core.remotejars org.eclipse.ptp/rdt/org.eclipse.ptp.rdt.core.remotejars
cvs co -r $TAG -d org.eclipse.ptp.rdt.core.stubs org.eclipse.ptp/rdt/org.eclipse.ptp.rdt.core.stubs
cvs co -r $CDT_TAG -d org.eclipse.cdt.core org.eclipse.cdt/all/org.eclipse.cdt.core
cd org.eclipse.ptp.rdt.core.remotejars
# run the script in remotejars
export PATH=/opt/public/common/ibm-java2-ppc-50/bin:$PATH
echo `java -version`
java -jar ../../../tools/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher.jar \
-ws gtk -arch ppc -os linux -application org.eclipse.ant.core.antRunner
} >$BUILD_LOG 2>&1
if grep -q 'BUILD FAILED' $BUILD_LOG; then
echo "BUILD FAILED. See $BUILD_LOG for details."
fi
exit 0