-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·41 lines (34 loc) · 1.11 KB
/
build.sh
File metadata and controls
executable file
·41 lines (34 loc) · 1.11 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
#!/usr/bin/env sh
# Root build script: adacad-drafting-lib -> docs -> ui
#
# Usage:
# ./build.sh Build everything (lib, docs, ui)
# ./build.sh --app Skip docs, build only lib + ui (for app testing)
set -e
root="$(cd "$(dirname "$0")" && pwd)"
skip_docs=false
for arg in "$@"; do
case "$arg" in
--app) skip_docs=true ;;
*) echo "Unknown flag: $arg"; echo "Usage: ./build.sh [--app]"; exit 1 ;;
esac
done
# Clear stale build artifacts so Angular and tsc always compile from latest source
echo "Clearing cached build artifacts..."
rm -rf "${root}/packages/adacad-drafting-lib/dist"
rm -rf "${root}/projects/ui/.angular/cache"
rm -rf "${root}/projects/ui/dist"
if [ "$skip_docs" = false ]; then
rm -rf "${root}/projects/docs/build"
fi
echo "Building adacad-drafting-lib..."
(cd "${root}/packages/adacad-drafting-lib" && npm run build)
if [ "$skip_docs" = false ]; then
echo "Building docs..."
(cd "${root}/projects/docs" && npm run build)
else
echo "Skipping docs build (--app)"
fi
echo "Building ui..."
(cd "${root}/projects/ui" && npm run build)
echo "All builds complete."