2022-02-13 20:10:59 +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-02-13 20:10:59 +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-02-13 20:10:59 +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
|
|
|
|
|
|
|
|
echo "Copying ESP32 bin file"
|
2022-10-01 08:06:13 +00:00
|
|
|
SRCBIN=.pio/build/$1/firmware.factory.bin
|
2022-02-13 20:10:59 +00:00
|
|
|
cp $SRCBIN $OUTDIR/$basename.bin
|
|
|
|
|
2022-11-24 11:33:19 +00:00
|
|
|
echo "Copying ESP32 update bin file"
|
|
|
|
SRCBIN=.pio/build/$1/firmware.bin
|
|
|
|
cp $SRCBIN $OUTDIR/$basename-update.bin
|
|
|
|
|
2022-02-14 17:45:29 +00:00
|
|
|
echo "Building Filesystem for ESP32 targets"
|
2023-03-09 08:00:59 +00:00
|
|
|
pio run --environment $1 -t buildfs
|
|
|
|
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$VERSION.bin
|
2022-02-13 20:10:59 +00:00
|
|
|
cp bin/device-install.* $OUTDIR
|
|
|
|
cp bin/device-update.* $OUTDIR
|