aboutsummaryrefslogtreecommitdiffstats
blob: ebfeac541d12abe9f3f8dec6fc4c81e2bda98676 (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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash

BASEDIR=$(pwd)
LOG=$BASEDIR/log_$( date +%Y%m%d%H%M%S ).txt
exec >$LOG 2>&1

BRANCH=R4_2_maintenance
GIT_PREFIX=ssh://git.eclipse.org
javaHome=/opt/local/jdk1.7.0_07
mvnPath=/opt/pwebster/git/cbi/apache-maven-3.0.4/bin
updateAggregator=false
mavenBREE=-Pno-bree-libs

while [ $# -gt 0 ]
do
    case "$1" in
	"-v")
	    mavenVerbose=-X;;
	"-bree-libs")
	    mavenBREE=-Pbree-libs;;
	"-sign")
	    mavenSign=-Peclipse-sign;;
	"-update")
	    updateAggregator=true;;
	"-anonymous")
	    GIT_PREFIX=git://git.eclipse.org;;
	"-gitPrefix")
	    GIT_PREFIX="$2" ; shift;;
	"-branch")
	    BRANCH="$2" ; shift;;
	"-javaHome")
	    javaHome="$2" ; shift;;
	"-mavenPath")
	    mvnPath="$2" ; shift;;
    esac
    shift
done


export MAVEN_OPTS=-Xmx2048m
LOCAL_REPO=$BASEDIR/localRepo


if [ -z "$JAVA_HOME" ]; then
    export JAVA_HOME=$javaHome
fi

mvnRegex=$( echo $mvnPath | sed 's!/!.!g' )
if ! (echo $PATH | grep "$mvnRegex" >/dev/null ); then
    export PATH=${mvnPath}:$PATH
fi


cloneAggregator() {
    if [ ! -d eclipse.platform.releng.aggregator ]; then
	git clone \
	-b $BRANCH \
	${GIT_PREFIX}/gitroot/platform/eclipse.platform.releng.aggregator.git
	pushd eclipse.platform.releng.aggregator
	git submodule init
	# this will take a while ... a long while
	git submodule update
	popd
    else
	pushd eclipse.platform.releng.aggregator
	git fetch
	git checkout $BRANCH
	git pull
	git submodule update
	popd
    fi
}

installEclipseParent () {
    pushd eclipse.platform.releng.aggregator
    mvn -f eclipse-parent/pom.xml \
    clean install \
    -Dmaven.repo.local=$LOCAL_REPO
    popd
}

buildAggregator () {
    pushd eclipse.platform.releng.aggregator
    mvn $mavenVerbose \
    clean install \
    $mavenSign \
    $mavenBREE \
    -Dmaven.test.skip=true \
    -Dmaven.repo.local=$LOCAL_REPO
    popd
}

# steps to get going

if $updateAggregator; then
    cloneAggregator
fi

# pick up any changes
installEclipseParent

# build from the aggregator root
buildAggregator