2020-02-20 20:49:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-02-14 22:00:08 +00:00
|
|
|
set -e
|
|
|
|
|
2020-02-24 17:22:34 +00:00
|
|
|
source bin/version.sh
|
2020-02-19 00:18:01 +00:00
|
|
|
|
2020-03-12 06:05:11 +00:00
|
|
|
COUNTRIES="US EU433 EU865 CN JP"
|
2020-02-26 22:27:00 +00:00
|
|
|
# COUNTRIES=US
|
2020-02-20 20:49:34 +00:00
|
|
|
|
|
|
|
SRCMAP=.pio/build/esp32/output.map
|
|
|
|
SRCBIN=.pio/build/esp32/firmware.bin
|
2020-02-24 17:33:41 +00:00
|
|
|
OUTDIR=release/latest
|
|
|
|
|
|
|
|
# We keep all old builds (and their map files in the archive dir)
|
|
|
|
ARCHIVEDIR=release/archive
|
|
|
|
|
|
|
|
rm -f $OUTDIR/firmware*
|
2020-02-20 20:49:34 +00:00
|
|
|
|
|
|
|
for COUNTRY in $COUNTRIES; do
|
|
|
|
|
2020-02-24 17:22:34 +00:00
|
|
|
HWVERSTR="1.0-$COUNTRY"
|
|
|
|
COMMONOPTS="-DAPP_VERSION=$VERSION -DHW_VERSION_$COUNTRY -DHW_VERSION=$HWVERSTR -Wall -Wextra -Wno-missing-field-initializers -Isrc -Os -Wl,-Map,.pio/build/esp32/output.map -DAXP_DEBUG_PORT=Serial"
|
2020-02-20 20:49:34 +00:00
|
|
|
|
|
|
|
export PLATFORMIO_BUILD_FLAGS="-DT_BEAM_V10 $COMMONOPTS"
|
|
|
|
echo "Building with $PLATFORMIO_BUILD_FLAGS"
|
|
|
|
rm -f $SRCBIN $SRCMAP
|
|
|
|
pio run # -v
|
2020-02-24 17:33:41 +00:00
|
|
|
cp $SRCBIN $OUTDIR/firmware-TBEAM-$COUNTRY-$VERSION.bin
|
2020-03-03 16:29:37 +00:00
|
|
|
#cp $SRCMAP $ARCHIVEDIR/firmware-TBEAM-$COUNTRY-$VERSION.map
|
2020-02-20 20:49:34 +00:00
|
|
|
|
|
|
|
export PLATFORMIO_BUILD_FLAGS="-DHELTEC_LORA32 $COMMONOPTS"
|
|
|
|
rm -f $SRCBIN $SRCMAP
|
|
|
|
pio run # -v
|
2020-02-24 17:33:41 +00:00
|
|
|
cp $SRCBIN $OUTDIR/firmware-HELTEC-$COUNTRY-$VERSION.bin
|
2020-03-03 16:29:37 +00:00
|
|
|
#cp $SRCMAP $ARCHIVEDIR/firmware-HELTEC-$COUNTRY-$VERSION.map
|
2020-02-20 20:49:34 +00:00
|
|
|
done
|
2020-02-14 22:00:08 +00:00
|
|
|
|
2020-02-24 17:33:41 +00:00
|
|
|
# keep the bins in archive also
|
|
|
|
cp $OUTDIR/firmware* $ARCHIVEDIR
|
|
|
|
|
2020-02-24 17:55:02 +00:00
|
|
|
cat >$OUTDIR/curfirmwareversion.xml <<XML
|
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
|
|
|
<!-- This file is kept in source control because it reflects the last stable
|
|
|
|
release. It is used by the android app for forcing software updates. Do not edit.
|
|
|
|
Generated by bin/buildall.sh -->
|
|
|
|
|
|
|
|
<resources>
|
|
|
|
<string name="cur_firmware_version">$VERSION</string>
|
|
|
|
</resources>
|
|
|
|
XML
|
|
|
|
|
2020-02-26 22:27:00 +00:00
|
|
|
rm -f $ARCHIVEDIR/firmware-$VERSION.zip
|
2020-02-24 17:33:41 +00:00
|
|
|
zip $ARCHIVEDIR/firmware-$VERSION.zip $OUTDIR/firmware-*-$VERSION.bin
|
2020-02-14 22:00:08 +00:00
|
|
|
|
2020-02-20 20:49:34 +00:00
|
|
|
echo BUILT ALL
|