summaryrefslogtreecommitdiffstats
blob: 268fc61d7658aead019ecb25ef10bf956b33b9d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh

if [ ! -d $1 ]
then
	echo "Not a directory: $1"
	exit 1
fi

SDK=`ls $1/eclipse-SDK*linux-gtk.tar.gz`
if [ ! -r $SDK ]
then
        echo "Can't read SDK from $SDK"
        exit 1
fi

PDEBUILD=eclipse/plugins/org.eclipse.pde.build_.*/about.html
LAUNCHER=eclipse/plugins/org.eclipse.equinox.launcher_
JDTFEATURE=eclipse/features/org.eclipse.jdt_.*/feature.xml

for VERSION in `tar tzvf $SDK | egrep "${PDEBUILD}|${LAUNCHER}|${JDTFEATURE}" | sed -e "s#.*eclipse/[^/]*/\([^/]*\).*#\1#"`
do
	case $VERSION in
		org.eclipse.pde.build*)
			PDEBUILD_VERSION=$VERSION
			;;
		org.eclipse.jdt*)
			JDT_VERSION_ALL=`echo $VERSION|grep jdt | sed -e 's/org.eclipse.jdt_\(.*\)/\1/'`
			JDT_VERSIONA=`echo ${JDT_VERSION_ALL}| sed -e 's/\([0-9]\.[0-9]*\.[0-9]\.[^-]*-\)[0-9]\{4\}.*/\1/'`
			JDT_VERSIONB=`echo ${JDT_VERSION_ALL}| sed -e   's/[0-9]\.[0-9]*\.[0-9]\.[^-]*-\([0-9]\{4\}\).*/\1/'`
			JDT_VERSIONB_NEXT=`expr $JDT_VERSIONB + 1`
			;;
		org.eclipse.equinox.launcher*)
			LAUNCHER_VERSION=$VERSION
			;;
	esac
done

echo "Versions for run.properties:"
echo "============================"
echo "# Details of the Eclipse SDK built upon:"
echo "run.eclipseScriptDir=plugins/${PDEBUILD_VERSION}/scripts"
echo "org.eclipse.equinox.launcher_jar=${LAUNCHER_VERSION}"
echo
echo "# for patching our patch feature to match this version with any suffix:"
echo "jdt.feature.version=${JDT_VERSIONA}${JDT_VERSIONB}"
echo "jdt.feature.version.next=${JDT_VERSIONA}${JDT_VERSIONB_NEXT}"

echo
echo "Version for org.eclipse.objectteams.otdt.core.patch.feature:"
echo "============================================================"
echo "      <import feature=\"org.eclipse.jdt\" version=\"${JDT_VERSION_ALL}\" patch=\"true\"/>"


echo "==================================="