blob: 6749953796ac98a3b3474b0a4d270dc9f34f05ec [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
LANG=en_US
TAG=HEAD
CDT_TAG=HEAD
# main staging directory
BUILD_DIR=/opt/public/download-staging.priv/tools/ptp/releng
args=`getopt c: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
touch $BUILD_LOG
chmod a+r $BUILD_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_${TAG}
# Check out the releng project
export CVSROOT=:pserver:anonymous@dev.eclipse.org:/cvsroot/tools
cvs co -r $TAG -d org.eclipse.ptp_${TAG} org.eclipse.ptp/releng/org.eclipse.ptp.releng
# run the main script
cd org.eclipse.ptp_${TAG}
sh build.sh $*
# Build RDT server packages
#cd results/plugins
# Check out rdt.core.remotejars, rdt.core.stubs, cdt.core, cdt.core.lrparser, cdt.core.lrparser.xlc 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
#cvs co -r $CDT_TAG -d org.eclipse.cdt.core.lrparser org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser
#cvs co -r $CDT_TAG -d org.eclipse.cdt.core.lrparser.xlc org.eclipse.cdt/xlc/org.eclipse.cdt.core.lrparser.xlc
#cvs co -r $CDT_TAG -d org.eclipse.cdt.core.parser.upc org.eclipse.cdt/upc/org.eclipse.cdt.core.parser.upc
#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