-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.sh
More file actions
108 lines (98 loc) · 3.92 KB
/
build.sh
File metadata and controls
108 lines (98 loc) · 3.92 KB
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
106
107
108
#!/bin/bash
cd "$(dirname "$0")"
main_menu() {
clear
echo "╔══════════════════════════════════════╗"
echo "║ XLib Builder ║"
echo "╠══════════════════════════════════════╣"
echo "║ [1] Compile XLib ║"
echo "║ [2] Install dependency stubs ║"
echo "║ [3] License ║"
echo "║ [0] Quit ║"
echo "╚══════════════════════════════════════╝"
echo
echo "XLib dynamically links with proprietary Mojang binaries."
echo "These are not provided automatically for compilation."
echo "You can either install them manually through BuildTools"
echo "or compile XLib with stubs that provide the needed signatures"
echo "at compile time. Compiling with stubs makes no difference"
echo "for running XLib on a Bukkit server. It does however override"
echo "the Spigot servers installed to your local Maven repository."
echo "If you are a developer who wants to compile other projects"
echo "against real Spigot servers, consider making a backup or"
echo "building server versions you're possibly missing with BuildTools."
echo
echo "Make sure JDK 8 or higher is installed. If not, you can get it here:"
echo "https://www.azul.com/downloads/?os=linux&architecture=x86-64-bit&package=jdk#zulu"
echo
read -rp "Please choose [0-3]: " CHOICE
case "$CHOICE" in
1) compile ;;
2) install_stubs ;;
3) show_license ;;
0) do_exit ;;
*)
echo "[!] Invalid input. Please enter 1, 2, 3 or 0."
sleep 2
main_menu
;;
esac
}
compile() {
clear
echo "╔══════════════════════════════════════╗"
echo "║ Compiling... ║"
echo "╚══════════════════════════════════════╝"
echo
java -jar mvnbt.jar --goal install
echo
echo "XLib compilation finished."
echo
read -rp "Press Enter to continue..."
main_menu
}
install_stubs() {
clear
echo "╔══════════════════════════════════════╗"
echo "║ Installing dependencies stubs... ║"
echo "╚══════════════════════════════════════╝"
echo
java -jar mvnbt.jar --dir nmsstub --goal install
echo
echo "Dependency stub installation finished."
install_stubs_done
}
install_stubs_done() {
echo
echo "╔══════════════════════════════════════╗"
echo "║ Proceed to compile XLib? ║"
echo "╠══════════════════════════════════════╣"
echo "║ [1] Compile XLib ║"
echo "║ [0] Quit ║"
echo "╚══════════════════════════════════════╝"
echo
read -rp "Please choose [0-1]: " COMPILE_NOW
case "$COMPILE_NOW" in
1) compile ;;
0) do_exit ;;
*)
echo "[!] Invalid input. Please enter 1 or 0."
sleep 2
install_stubs_done
;;
esac
}
show_license() {
clear
cat LICENSE
echo
read -rp "Press Enter to continue..."
main_menu
}
do_exit() {
clear
echo "Good bye!"
sleep 1
exit 0
}
main_menu