summaryrefslogtreecommitdiffstats
path: root/scripts/find-version
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/find-version')
-rwxr-xr-xscripts/find-version62
1 files changed, 62 insertions, 0 deletions
diff --git a/scripts/find-version b/scripts/find-version
new file mode 100755
index 0000000..55fbc58
--- /dev/null
+++ b/scripts/find-version
@@ -0,0 +1,62 @@
1#!/bin/sh
2
3help ()
4{
5 echo "Find the installed plugin/feature version of a eclipse build environment"
6 echo "Usage: $0 [pluginId1/featureId1[,pluginId2/featureId2]...]";
7 echo ""
8 echo "Options:"
9 echo "pluginId/featureId - comma seperated plugin or feature ids, empty for all"
10 echo ""
11 echo "Example: $0 org.eclipse.tcf.feature.group";
12 exit 1;
13}
14
15fail ()
16{
17 local retval=$1
18 shift $1
19 echo "[Fail $retval]: $*"
20 echo "BUILD_TOP=${BUILD_TOP}"
21 cd ${TOP}
22 exit ${retval}
23}
24
25find_eclipse_base ()
26{
27 [ -d ${ECLIPSE_HOME}/plugins ] && ECLIPSE_BASE=`readlink -f ${ECLIPSE_HOME}`
28}
29
30find_launcher ()
31{
32 local list="`ls ${ECLIPSE_BASE}/plugins/org.eclipse.equinox.launcher_*.jar`"
33 for launcher in $list; do
34 [ -f $launcher ] && LAUNCHER=${launcher}
35 done
36}
37
38check_env ()
39{
40 find_eclipse_base
41 find_launcher
42
43 local err=0
44 [ "x${ECLIPSE_BASE}" = "x" -o "x${LAUNCHER}" = "x" ] && err=1
45 if [ $err -eq 0 ]; then
46 [ ! -d ${ECLIPSE_BASE} ] && err=1
47 [ ! -f ${LAUNCHER} ] && err=1
48 fi
49
50 if [ $err -ne 0 ]; then
51 echo "Please set env variable ECLIPSE_HOME to the eclipse installation directory!"
52 exit 1
53 fi
54}
55
56if [ $# -ne 0 ] && [ $# -ne 1 ]; then
57 help
58fi
59
60check_env
61
62java -jar ${LAUNCHER} -application org.eclipse.equinox.p2.director -destination ${ECLIPSE_BASE} -profile SDKProfile -repository file:///${ECLIPSE_BASE}/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile -list $@