-
Notifications
You must be signed in to change notification settings - Fork 5
/
get-build-tools
executable file
·41 lines (41 loc) · 1.33 KB
/
get-build-tools
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
#!/bin/bash
set -e
. helper/detect
if [ "$OS_VARIANT" = Raspbian ]; then
exit 0
fi
if [ "$OS_VARIANT" = Mac ]; then
test -x buildtools/jbrsdk/Contents/Home/bin/java && exit 0
# Sometimes Jetbrains' download server does not work, so we prefer a safer download.
# JDK_TGZ=jbrsdk-11_0_10-osx-x64-b1428.2.tar.gz
# JDK_URL=https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=$JDK_TGZ
JDK_TGZ=jbrsdk-11_0_6-osx-x64-b795.3.tar.gz
JDK_URL=http://dev.geogebra.org/download/installer/jdk/$JDK_TGZ
fi
if [ "$OS_VARIANT" = Ubuntu -o "$OS_VARIANT" = Linuxmint -o "$OS_VARIANT" = LinuxMint ]; then
# Linux (Ubuntu 18.04)
test -x buildtools/jbr/bin/java && exit 0
if [ `arch` = i686 ]; then
echo "No 32 bit JDK can be automatically downloaded, sorry. Try your system's default."
exit 1
else
JDK_TGZ=jbr-11_0_4-linux-x64.tar.gz
JDK_URL=http://dev.geogebra.org/download/installer/jdk/$JDK_TGZ
fi
fi
if [ "$OS_VARIANT" = Windows ]; then
JAVA=`find /c/Program\ Files\/Microsoft/jdk* | sort | head -1`
if [ "$JAVA" = "" ]; then
echo "No Java found. Consider installing it via choco (openjdk)."
exit 1
fi
exit 0
fi
mkdir -p buildtools
cd buildtools
if [ "$JDK_URL" = "" -o "$JDK_TGZ" = "" ]; then
echo "System detection failed, sorry."
exit 1
fi
wget -c -N $JDK_URL -O $JDK_TGZ || curl -o $JDK_TGZ -O -L $JDK_URL
tar xzf $JDK_TGZ