blob: aa2e8cd12832babcb7e5024528d747e4b97cbc32 [file] [log] [blame]
david_williams124777a2011-02-15 05:19:51 +00001#!/usr/bin/env bash
2
3# use of this script requires our WTP addRepoProperties app to have already been added to eclipse instance.
david_williams681f5572011-02-15 06:10:43 +00004# TODO: we could probably integrate and always call 'install-relengTools.sh' for ease? Just a little longer? and might update, when not intended or expected (e.g. untested changes?)
5#${RELENG_CONTROL}/install-relengTools.sh
david_williams124777a2011-02-15 05:19:51 +00006
7APP_NAME=org.eclipse.wtp.releng.tools.addRepoProperties
8
9devworkspace=./workspace
10
david_williamse06b8a92011-02-15 05:52:53 +000011# remember to leave no slashes on filename in source command,
12# (the commonVariations.shsource file, that is)
13# so that users path is used to find it (first)
14if [ -z $BUILD_INITIALIZED ]
15then
16 source commonVariations.shsource
17 source ${RELENG_CONTROL}/commonComputedVariables.shsource
18fi
19
david_williams124777a2011-02-15 05:19:51 +000020export JAVA_HOME=${JAVA_6_HOME}
21devJRE=$JAVA_HOME/jre/bin/java
22
23ibmDevArgs="-Xms128M -Xmx256M -Dosgi.ws=gtk -Dosgi.os=linux -Dosgi.arch=x86"
24
25
26#REPO="/shared/webtools/committers/wtp-R3.3.0-I/20101209114749/S-3.3.0M4-20101209114749/repository"
27#BUILD_BRANCH=R3.3.0
28#BUILD_ID=S-3.3.0M4-20101209114749
29#STATS_TAG_SUFFIX=_indigo_M4
david_williamse8c219c2011-02-15 06:23:08 +000030#STATS_TAG_VERSIONINDICATOR=/indigo
david_williams124777a2011-02-15 05:19:51 +000031
32REPO=$1
33BUILD_BRANCH=$2
34BUILD_ID=$3
david_williams681f5572011-02-15 06:10:43 +000035STATS_TAG_VERSIONINDICATOR=$4
36STATS_TAG_SUFFIX=$5
david_williams124777a2011-02-15 05:19:51 +000037
david_williams09f97372011-02-15 05:44:15 +000038if [[ -z "${REPO}" ]]
david_williams124777a2011-02-15 05:19:51 +000039then
40 echo "ERROR: this script requires a repository to add properties to.";
41 exit 1;
42fi
43
david_williams09f97372011-02-15 05:44:15 +000044echo "BUILD_BRANCH: ${BUILD_BRANCH}";
45echo "BUILD_ID: ${BUILD_ID}";
46echo "STATS_TAG_SUFFIX: ${STATS_TAG_SUFFIX}";
david_williams124777a2011-02-15 05:19:51 +000047
david_williams5486a8d2011-02-15 05:54:11 +000048if [[ ( ! ( -z "${BUILD_BRANCH}" ) ) && ( ! ( -z "${BUILD_ID}" ) ) ]]
david_williams124777a2011-02-15 05:19:51 +000049then
50 MIRRORURL="/webtools/downloads/drops/${BUILD_BRANCH}/${BUILD_ID}/repository/"
51else
52 echo "WARNING: no mirror URL specified.";
53 MIRRORURL=""
54fi
55
56if [ ! -z $MIRRORURL ]
57then
58 MIRRORURL_ARG="http://www.eclipse.org/downloads/download.php?format=xml&file=${MIRRORURL}&protocol=http"
59else
60 MIRRORURL_ARG=""
61fi
62
63# remember, the '&' should NOT be unescaped here ... the p2 api (or underlying xml) will escape it.
64devArgs="$ibmDevArgs \
65-Dp2MirrorsURL=${MIRRORURL_ARG} \
66-DartifactRepoDirectory=${REPO} \
david_williamsd125a942011-02-15 06:14:18 +000067-Dp2StatsURI=http://download.eclipse.org/stats/webtools/repository${STATS_TAG_VERSIONINDICATOR} -DstatsArtifactsSuffix="${STATS_TAG_SUFFIX}" -DstatsTrackedArtifacts=org.eclipse.wst.jsdt.feature,org.eclipse.wst.xml_ui.feature,org.eclipse.wst.web_ui.feature,org.eclipse.jst.enterprise_ui.feature"
david_williams124777a2011-02-15 05:19:51 +000068
69
70echo "dev: " $0
david_williams124777a2011-02-15 05:19:51 +000071echo "devworkspace: " $devworkspace
david_williams124777a2011-02-15 05:19:51 +000072echo "devJRE: " $devJRE
david_williams124777a2011-02-15 05:19:51 +000073echo "devArgs: " $devArgs
david_williams124777a2011-02-15 05:19:51 +000074echo "APP_NAME: " $APP_NAME
david_williams098886f2011-02-15 06:20:19 +000075#$devJRE -version
david_williams124777a2011-02-15 05:19:51 +000076echo
77
david_williams046115d2011-09-08 18:53:11 +000078
david_williams2878d622011-09-12 13:20:27 +000079if [ -n ${ECLIPSE_EXE} -a ! -z ${ECLIPSE_EXE} -a -x ${ECLIPSE_EXE} ]
david_williams046115d2011-09-08 18:53:11 +000080then
81 ${ECLIPSE_EXE} --launcher.suppressErrors -nosplash -console -data $devworkspace -application ${APP_NAME} ${OTHER_ARGS} -vm $devJRE -vmargs $devArgs
82 RC=$?
83else
84 echo "ERROR: ECLIPSE_EXE is not defined to executable eclipse"
85 RC=1001
86fi
87exit $RC