Skip to content

Commit

Permalink
chore: add build system to this branch too
Browse files Browse the repository at this point in the history
  • Loading branch information
zeljkobekcic committed Jul 9, 2024
2 parents a18c35a + 2d3bdbd commit c971818
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
outputs/
38 changes: 20 additions & 18 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
#!/usr/bin/env zsh

ZMK_CONFIG_PATH="/Users/zeljkobekcic/Projects/Private/temper-zmk-config/config"
ZMK_EXTRA_MODULES_PATH="/Users/zeljkobekcic/Projects/Private/temper-zmk-config"
OUTPUT_DIRECTORY="/Users/zeljkobekcic/Projects/Private/temper-zmk-config/outputs/"
ZMK_APP_PATH="$HOME/Projects/Private/zmk/app"
ZMK_CONFIG_PATH="$HOME/Projects/Private/temper-zmk-config/config"
ZMK_EXTRA_MODULES_PATH="$HOME/Projects/Private/temper-zmk-config"
OUTPUT_DIRECTORY="$HOME/Projects/Private/temper-zmk-config/outputs/"

rm -rf "$OUTPUT_DIRECTORY"
mkdir -p "$OUTPUT_DIRECTORY"

(
cd ~/Projects/Private/zmk
source .venv/bin/activate
cd app
west build -d build/temper_left -b nice_nano_v2 --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_PATH" -DSHIELD=temper_left -DZMK_EXTRA_MODULES="$ZMK_EXTRA_MODULES_PATH"
west build -d build/temper_right -b nice_nano_v2 --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_PATH" -DSHIELD=temper_right -DZMK_EXTRA_MODULES="$ZMK_EXTRA_MODULES_PATH"
west build -d build/temper_dongle -b nice_nano_v2 --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_PATH" -DSHIELD=temper_dongle -DZMK_EXTRA_MODULES="$ZMK_EXTRA_MODULES_PATH"
deactivate

cp build/temper_dongle/zephyr/zmk.uf2 "$OUTPUT_DIRECTORY/temper_dongle.uf2"
cp build/temper_right/zephyr/zmk.uf2 "$OUTPUT_DIRECTORY/temper_right.uf2"
cp build/temper_left/zephyr/zmk.uf2 "$OUTPUT_DIRECTORY/temper_left.uf2"

rm -rf build
)
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 }')

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"
done

deactivate

rm -rf build

cd -

0 comments on commit c971818

Please sign in to comment.