-
Notifications
You must be signed in to change notification settings - Fork 0
/
s_base_java
executable file
·92 lines (75 loc) · 3.43 KB
/
s_base_java
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
#!/usr/bin/env bash
# Bin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Bin is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bin. If not, see <https://www.gnu.org/licenses/>.
# Debug Options
set -euo pipefail
DEPS=(curl bash awk)
s_checkdeps "${DEPS[@]}"
BUILDS="$HOME/Builds"
LOCAL_HOME="$HOME/.local"
LOCAL_BIN="$LOCAL_HOME/bin"
echo -e "\nSDKMAN"
if [[ ! -f "$HOME/.sdkman/bin/sdkman-init.sh" ]]; then
curl -s "https://get.sdkman.io" | bash
fi
echo -e "\nJBANG"
if [[ ! -f "$HOME/.jbang/bin/jbang" ]]; then
curl -Ls https://sh.jbang.dev | bash -s - app setup
else
jbang version --update
fi
echo -e "\nGOOGLE-JAVA-FORMAT" # https://github.com/google/google-java-format
TAGS_URL="https://api.github.com/repos/google/google-java-format/tags"
VERSION="$(curl -s $TAGS_URL | awk '/name/ {version=substr($2,2,7); print version; exit}')"
URL="https://github.com/google/google-java-format/releases/download/"
wget "$URL/$VERSION/google-java-format_linux-x86-64" -O "$LOCAL_BIN/google-java-format"
chmod +x "$LOCAL_BIN/google-java-format"
"$LOCAL_BIN/google-java-format" --version
exit
# ================== GRAAL - https://github.com/graalvm/graalvm-ce-builds/releases/
if [[ ! -x "$LOCAL_BIN/gu" ]]; then
TAGS_URL="https://api.github.com/repos/graalvm/graalvm-ce-builds/tags"
VERSION=$( curl -s $TAGS_URL | awk '/name/ {version=substr($2,2,10); print version; exit}')
graal_location="$BUILDS/graalvm-community-openjdk-${VERSION}+9.1"
current="graalvm-community-${VERSION}_linux-x64_bin.tar.gz"
URL="https://github.com/graalvm/graalvm-ce-builds/releases/download/${VERSION}/${current}"
wget -c "$URL" -P /tmp
tar xf "/tmp/$current" -C "$BUILDS"
mv "${graal_location}" "$HOME/Builds/graal"
ln -sf "$HOME/Builds/graal/bin/gu" "$LOCAL_BIN/gu"
"$LOCAL_BIN/gu" --version
fi
if [[ ! -x "$LOCAL_BIN/eclipse" ]]; then
ECLIPSE_URL='https://eclipse.c3sl.ufpr.br/oomph/epp/2022-06/R/eclipse-inst-jre-linux64.tar.gz'
wget -c "$ECLIPSE_URL" -P "$BUILDS"
tar -xf "$BUILDS/eclipse-inst-jre-linux64.tar.gz" -C "$BUILDS"
fi
# IDEA
if [[ ! -x "$LOCAL_BIN/idea" ]]; then
URL="https://download.jetbrains.com/idea/ideaIC-2022.3.tar.gz"
wget -c $URL -P /tmp
tar xf /tmp/ideaIC-2022.3.tar.gz -C "$BUILDS"
ln -sf "$BUILDS/idea-IC-223.7571.182/bin/idea.sh" "$LOCAL_BIN/idea"
fi
if [[ ! -x "$LOCAL_BIN/spring-tool-suite" ]]; then
STS_URL='https://download.springsource.com/release/STS4/4.15.3.RELEASE/dist/e4.24/spring-tool-suite-4-4.15.3.RELEASE-e4.24.0-linux.gtk.x86_64.tar.gz'
wget -c "$STS_URL" -P "$BUILDS"
tar -xf "$BUILDS/spring-tool-suite-4-4.15.3.RELEASE-e4.24.0-linux.gtk.x86_64.tar.gz" -C "$BUILDS"
ln -sf "$BUILDS/sts-4.15.3.RELEASE/SpringToolSuite4" "$LOCAL_BIN/spring-tool-suite"
fi
if [[ ! -x "$LOCAL_BIN/netbeans" ]]; then
BEANS_URL='https://dlcdn.apache.org/netbeans/netbeans/15/netbeans-15-bin.zip'
wget -c "$BEANS_URL" -P "$BUILDS"
unzip "$BUILDS/netbeans-15-bin.zip" -d "$BUILDS"
ln -sf "$BUILDS/netbeans/bin/netbeans" "$LOCAL_BIN/netbeans"
fi