2022-08-10 20:33:42 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2023-01-21 15:17:08 +00:00
|
|
|
VERSION=`bin/buildinfo.py long`
|
|
|
|
SHORT_VERSION=`bin/buildinfo.py short`
|
2022-08-10 20:33:42 +00:00
|
|
|
|
|
|
|
OUTDIR=release/
|
|
|
|
|
|
|
|
rm -f $OUTDIR/firmware*
|
|
|
|
rm -r $OUTDIR/* || true
|
|
|
|
|
|
|
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
2023-01-21 15:17:08 +00:00
|
|
|
platformio pkg update
|
2022-08-10 20:33:42 +00:00
|
|
|
|
|
|
|
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
|
|
|
rm -f .pio/build/$1/firmware.*
|
|
|
|
|
|
|
|
# The shell vars the build tool expects to find
|
|
|
|
export APP_VERSION=$VERSION
|
|
|
|
|
|
|
|
basename=firmware-$1-$VERSION
|
|
|
|
|
|
|
|
pio run --environment $1 # -v
|
|
|
|
SRCELF=.pio/build/$1/firmware.elf
|
|
|
|
cp $SRCELF $OUTDIR/$basename.elf
|
|
|
|
|
2022-08-10 20:53:19 +00:00
|
|
|
echo "Copying uf2 file"
|
2022-08-10 20:33:42 +00:00
|
|
|
SRCBIN=.pio/build/$1/firmware.uf2
|
|
|
|
cp $SRCBIN $OUTDIR/$basename.uf2
|
|
|
|
|
|
|
|
cp bin/device-install.* $OUTDIR
|
2022-08-10 21:32:27 +00:00
|
|
|
cp bin/device-update.* $OUTDIR
|