Skip to content

Commit

Permalink
chore: improve build system
Browse files Browse the repository at this point in the history
  • Loading branch information
zeljkobekcic committed Jul 9, 2024
1 parent 2d3bdbd commit c37ecaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
outputs/
7 changes: 4 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ mkdir -p "$OUTPUT_DIRECTORY"
cd "$ZMK_APP_PATH"
source ../.venv/bin/activate

yq '.include | map(.board + " " + .shield)' "$ZMK_EXTRA_MODULES_PATH/build.yaml" | while read line; do
board=$(echo $line | awk '{ print $2 }')
shield=$(echo $line | awk '{ print $3 }')
# format to json lines then read ech json object per loop iterationn
yq -o=json -I=0 '.include[]' "$ZMK_EXTRA_MODULES_PATH/build.yaml" | while read line; do
board=$(echo $line | jq -r '.board')
shield=$(echo $line | jq -r '.shield')

west build -d "build/$shield-$board" -b $board --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_PATH" -DSHIELD=$shield -DZMK_EXTRA_MODULES="$ZMK_EXTRA_MODULES_PATH"
cp "build/$shield-$board/zephyr/zmk.uf2" "$OUTPUT_DIRECTORY/$shield-$board.uf2"
Expand Down

0 comments on commit c37ecaf

Please sign in to comment.