forked from cylondata/twister2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_linux.sh
executable file
·38 lines (34 loc) · 1.1 KB
/
build_linux.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
# check java home
exists() {
command -v "$1" >/dev/null 2>&1
}
echo "Looking for java..."
if ! exists $JAVA_HOME/bin/java; then
echo "Error: Couldn't find java at JAVA_HOME. Please set JAVA_HOME properly." >&2
exit 1
else
echo "Found java at $JAVA_HOME"
fi
# install system dependencies
if [ "$(
. /etc/os-release
echo $NAME
)" = "Ubuntu" ]; then
sh install_sys_dep_ubuntu.sh
else
echo "This script supports only dependency installation for Ubuntu. Please manually install dependencies based on following URLS".
echo "https://docs.bazel.build/versions/master/install.html"
echo "https://twister2.org/docs/compiling/linux"
fi
echo "Looking for bazel..."
if ! exists bazel; then
echo "Bazel not found on this system. Installing bazel..." >&2
wget https://github.com/bazelbuild/bazel/releases/download/3.5.1/bazel-3.5.1-installer-linux-x86_64.sh -O /tmp/bazel.sh
chmod 700 /tmp/bazel.sh
/tmp/bazel.sh --user
export PATH=$HOME/bin:$PATH
else
echo "Found bazel at $(command -v bazel)"
fi
echo "Building twister2..."
bazel build --config=ubuntu scripts/package:tarpkgs --action_env=JAVA_HOME