Skip to content

Commit 85828aa

Browse files
committed
[IMP] global build script
1 parent 55a2875 commit 85828aa

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

build.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
ODOOLS_PYCHARM_DIR="${ODOOLS_PYCHARM_DIR:-../odoo-ls-pycharm}"
6+
ODOOLS_VSCODE_DIR="${ODOOLS_VSCODE_DIR:-../odoo-ls-vscode}"
7+
8+
if [ ! -d "$ODOOLS_PYCHARM_DIR" ]; then
9+
echo "Error: Folder '$ODOOLS_PYCHARM_DIR' doesn't exist. Be sure to launch this script from the root of the repository or set ODOOLS_PYCHARM_DIR accordingly."
10+
exit 1
11+
fi
12+
13+
if [ ! -d "$ODOOLS_VSCODE_DIR" ]; then
14+
echo "Error: Folder '$ODOOLS_VSCODE_DIR' doesn't exist. Be sure to launch this script from the root of the repository or set ODOOLS_VSCODE_DIR accordingly."
15+
exit 1
16+
fi
17+
18+
VALID_TARGETS=("lsp" "pycharm" "vscode")
19+
20+
if [ $# -eq 0 ]; then
21+
echo "Usage: $0 [all|${VALID_TARGETS[*]}...]"
22+
exit 1
23+
fi
24+
25+
run_build() {
26+
local target=$1
27+
case "$target" in
28+
lsp)
29+
echo "=== Building LSP ==="
30+
(cd lsp && ./build.sh)
31+
;;
32+
pycharm)
33+
echo "=== Building PyCharm Plugin ==="
34+
(cd "$PYCHARM_DIR" && ./build.sh)
35+
;;
36+
vscode)
37+
echo "=== Building VSCode Extension ==="
38+
(cd "$VSCODE_DIR" && ./build.sh)
39+
;;
40+
*)
41+
echo "Unknown target: $target"
42+
exit 1
43+
;;
44+
esac
45+
}
46+
47+
if [ "$1" == "all" ]; then
48+
for t in "${VALID_TARGETS[@]}"; do
49+
run_build "$t"
50+
done
51+
else
52+
for arg in "$@"; do
53+
run_build "$arg"
54+
done
55+
fi

0 commit comments

Comments
 (0)