forked from lrytz/jenkins-scripts
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild
executable file
·63 lines (47 loc) · 1.44 KB
/
build
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
#!/bin/bash -ex
# the -e flag makes the script stop and fail when one of the commands fails.
# don't change it. the -x flag prints commands, helpful for jenkins log.
scriptsDir="$( cd "$( dirname "$0" )" && pwd )"
. $scriptsDir/common
# Builds nightlies
# Usage: $0 [opt opt ...]
#
# The options are supplied to scalac and partest.
# Example: build -Xcheckinit -Ycheck:all
#
# This script also passes the env var 'antArgs' to the ant task, so it
# can be called as
#
# antArgs="-Darchives.skipxz=true" build
scalacArgs="-Dscalac.args=\"$@\" -Dpartest.scalac_opts=\"$@\""
revision=`git rev-parse HEAD`
# Different revisions require different ways of building. The ultimate
# goal of this script is to allow building arbitrary revisions.
# introduced build-opt
antOptimizedRev="0f10ffedc8d0cdf8410cc6fc143a08a9333c9832"
antOptimized () {
echo "build using antOptimized"
gitClean
./pull-binary-libs.sh
ant $antArgs $scalacArgs build-opt
ant $antArgs $scalacArgs nightly
}
# introduced SABBUS, the 'new' build.xml
antNightlyRev="0385e9835d6fac729b6672294fa8e4c6b1ea3c10"
antNightly () {
echo "build using antNightly"
gitClean
./pull-binary-libs
ant $antArgs $scalacArgs nightly
}
abortBuild () {
echo "Don't know how to build revision $revision"
exit 1
}
if [[ `git rev-list $revision | grep $antOptimizedRev` ]]; then
antOptimized
elif [[ `git rev-list $revision | grep $antNightlyRev` ]]; then
antNightly
else
abortBuild
fi