forked from pdshelley/HALGEN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.sh
More file actions
executable file
·39 lines (34 loc) · 970 Bytes
/
generate.sh
File metadata and controls
executable file
·39 lines (34 loc) · 970 Bytes
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
#!/usr/bin/env bash
# generate.sh — Build and run the HALGEN SVD generator
#
# Usage:
# ./generate.sh [CLI args...]
#
# The script builds the `SwiftARMGeneratorCLI` target and forwards any
# additional arguments to the resulting executable.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT="$SCRIPT_DIR/SwiftARMGenerator.xcodeproj"
SCHEME="SwiftARMGeneratorCLI"
DERIVED_DATA="$SCRIPT_DIR/.build"
BINARY="$DERIVED_DATA/Build/Products/Release/$SCHEME"
BUILD_LOG="$(mktemp)"
printf "\033[1mHALGEN\033[0m — SVD Generator\n\n"
printf " Building... "
if xcodebuild \
-project "$PROJECT" \
-scheme "$SCHEME" \
-configuration Release \
-destination "platform=macOS,arch=arm64" \
-derivedDataPath "$DERIVED_DATA" \
-quiet \
>"$BUILD_LOG" 2>&1; then
printf "\033[32mdone\033[0m\n\n"
else
printf "\033[31mFAILED\033[0m\n\n"
cat "$BUILD_LOG"
rm -f "$BUILD_LOG"
exit 1
fi
rm -f "$BUILD_LOG"
exec "$BINARY" "$@"