-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·105 lines (95 loc) · 2.18 KB
/
setup.sh
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
105
#!/bin/bash
#---------------------------------------------------------------------
source "$(dirname "$0")/common.inc"
#---------------------------------------------------------------------
print_help() {
cat <<EOF
$0 ARGUMENTS
ARGUMENTS:
--help - prints this page
--ignore-plugin PLUGIN
- Don't setup the plugin PLUGIN
EOF
}
while [ $# -gt 0 ]
do
ARGUMENT="$1"
shift
case "$ARGUMENT" in
"--help" | "-h" | "-?" )
print_help
exit 0
;;
"--ignore-plugin" )
[ $# -ge 1 ] || error "$ARGUMENT requires 1 more argument"
IGNORED_PLUGINS=( "${IGNORED_PLUGINS[@]}" "$1" )
shift || true
;;
* )
error "Unknown argument '$ARGUMENT'"
;;
esac
done
setup_watchman() {
section "Setting up Watchman"
if [ ! -d "watchman" ]
then
run_git clone https://github.com/facebook/watchman.git
cd watchman
./autogen.sh
./configure --prefix="$(pwd)"
mkdir -p "var/run/watchman"
make
cd "$SCRIPT_DIR_ABS"
fi
}
setup_buck() {
section "Setting up Buck"
if [ ! -d "buck" ]
then
run_git clone https://gerrit.googlesource.com/buck
cd buck
ant
cd "$SCRIPT_DIR_ABS"
fi
}
setup_jacoco_toolbox() {
section "Setting up JaCoCo Toolbox"
if [ ! -d "jacoco-toolbox" ]
then
run_git clone git://git.quelltextlich.at/jacoco/jacoco-toolbox
pushd "jacoco-toolbox" >/dev/null
mvn clean package
popd >/dev/null
fi
}
setup_watchman
setup_buck
setup_jacoco_toolbox
for REPO in \
gerrit \
"${DEFAULT_EXTERNAL_PLUGINS[@]}"
do
if ! is_ignored_plugin "$REPO"
then
if [ "$REPO" != "gerrit" ]
then
REPO="plugins/$REPO"
fi
./setup_repository.sh "$REPO"
fi
done
# Installing hooks
for REPO_DIR_ABS in \
"$GERRIT_DIR_ABS"* \
"$GERRIT_DIR_ABS/plugins/"* \
"$EXTRA_PLUGINS_DIR_ABS/"* \
do
if [ -d "$REPO_DIR_ABS" ]
then
echo "$REPO_DIR_ABS"
pushd "$REPO_DIR_ABS" >/dev/null
setup_git_hooks
popd >/dev/null
fi
done