Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 07078d367187163e509063d5d1b314710b7fe79a (plain) (blame)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
#
# This script is used to trigger the runtime build with parameters passed by Hudson.
# All values are retrieved trough system variables set by Hudson.
# See Job -> Configure... -> This build is parameterized

######################################################################
# set up environment

SCRIPTS_DIR=$(dirname $(readlink -nm $0))
. $SCRIPTS_DIR/build-environment.sh

if [ "${BUILD_TYPE:0:1}" == "S" ]; then
  sign=true
  SIGNPROFILE="-Peclipse-sign -Dmaven.test.skip=true"
else
  sign=false
  SIGNPROFILE=""
fi

tempdirectory="$WORKSPACE/tmp"

######################################################################
# cleanup left-overs from previous run
test -d "$WORKSPACE" || exit 1
rm -rf "$WORKSPACE"/runtimeRepo "$WORKSPACE"/*.zip "$tempdirectory"

######################################################################
# clean up local Maven repository to circumvent p2 cache problems

for II in .cache .meta p2 ; do
  echo "Remove directory ${MAVEN_LOCAL_REPO_PATH}/${II}" 
  rm -r ${MAVEN_LOCAL_REPO_PATH}/${II}
done

######################################################################
# build RAP Runtime

cd "$WORKSPACE/org.eclipse.rap/releng/org.eclipse.rap.build"
echo "Running maven on $PWD, $SIGNPROFILE"
mkdir -p "$tempdirectory"
${MVN} -e clean package $SIGNPROFILE -Dmaven.repo.local=${MAVEN_LOCAL_REPO_PATH} -Djava.io.tmpdir="$tempdirectory"
exitcode=$?
if [ "$exitcode" != "0" ]; then
  echo "Maven exited with error code " + $exitcode
fi

if [ -d repository/target/fixedPacked ]; then
  mv repository/target/fixedPacked "$WORKSPACE/runtimeRepo" || exit 1
else
  mv repository/target/repository "$WORKSPACE/runtimeRepo" || exit 1
fi

VERSION=$(ls "$WORKSPACE"/runtimeRepo/features/org.eclipse.rap.sdk.feature_*.jar | sed 's/.*_\([0-9.-]\+\)\..*\.jar/\1/')
TIMESTAMP=$(ls "$WORKSPACE"/runtimeRepo/features/org.eclipse.rap.sdk.feature_*.jar | sed 's/.*\.\([0-9-]\+\)\.jar/\1/')
echo "Version is $VERSION"
echo "Timestamp is $TIMESTAMP"
test -n "$VERSION" || exit 1
test -n "$TIMESTAMP" || exit 1

######################################################################
# Build Aggregation Repository

cd "$WORKSPACE/org.eclipse.rap/releng/org.eclipse.rap.target.build"
echo "Running maven on $PWD, sign=$sign"
$MVN -e clean package -DruntimeRepo="file://$WORKSPACE/runtimeRepo" -Dmaven.repo.local=${MAVEN_LOCAL_REPO_PATH} -Djava.io.tmpdir="$tempdirectory" -Dsign=$sign || exit 1

# Example: rap-1.5.0-N-20110814-2110.zip
zipFileName=rap-$VERSION-$BUILD_TYPE-$TIMESTAMP.zip

if [ -d repository.kepler/target/fixedSigned ]; then
  mv repository.kepler/target/fixedSigned/*.zip "$WORKSPACE/$zipFileName" || exit 1
else
  mv repository.kepler/target/*.zip "$WORKSPACE/$zipFileName" || exit 1
fi

######################################################################
# include legal files in zip files

cd "$WORKSPACE"
cp -f org.eclipse.rap/releng/org.eclipse.rap.build/legal/notice.html .
cp -f org.eclipse.rap/releng/org.eclipse.rap.build/legal/epl-v10.html .
zip "$zipFileName" notice.html epl-v10.html

Back to the top