-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfe9bf4
commit 7e1165a
Showing
6 changed files
with
165 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.pio | ||
.vscode | ||
.DS_Store | ||
*.pyc | ||
*.pyc | ||
tools/release_builder/out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"hardware_name": "Example ATMELSAM", | ||
"hardware_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"softwares": [ | ||
{ | ||
|
||
"software_name": "Example SW", | ||
"software_version": [1, 0, 0], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_atmelsam_example_v1.0.0.bin", | ||
"software_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"hardware_version": [1, 0, 0] | ||
}, | ||
{ | ||
"software_name": "Example SW", | ||
"software_version": [1, 1, 0], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_atmelsam_example_v1.1.0.bin", | ||
"software_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"hardware_version": [1, 0, 0] | ||
}, | ||
{ | ||
"software_name": "Example SW", | ||
"software_version": [1, 1, 2], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_atmelsam_example_v1.1.2.bin", | ||
"software_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"min_hardware_version": [1, 0, 0], | ||
"max_hardware_version": [1, 0, 2] | ||
}, | ||
{ | ||
"software_name": "Example SW", | ||
"software_version": [2, 0, 0], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_atmelsam_example_v2.0.0.bin", | ||
"software_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"min_hardware_version": [2, 0, 0], | ||
"max_hardware_version": [2, 0, 1] | ||
}, | ||
{ | ||
"software_name": "Other SW", | ||
"software_version": [1, 6, 6], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_atmelsam_other_v1.6.6.bin", | ||
"min_hardware_version": [1, 0, 0], | ||
"max_hardware_version": [1, 0, 3] | ||
}, | ||
{ | ||
"software_name": "Experimental SW", | ||
"software_version": [1, 1, 2], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_atmelsam_experimental_v1.1.2.bin", | ||
"software_text": "Experimental branch of Example SW.\n\nChanges:\n- first\n- second" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"hardware_name": "Example ESP32", | ||
"hardware_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"softwares": [ | ||
{ | ||
|
||
"software_name": "Example SW", | ||
"software_version": [1, 0, 0], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_esp32_example_v1.0.0.bin", | ||
"software_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"hardware_version": [1, 0, 0] | ||
}, | ||
{ | ||
"software_name": "Example SW", | ||
"software_version": [1, 1, 0], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_esp32_example_v1.1.0.bin", | ||
"software_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"hardware_version": [1, 0, 0] | ||
}, | ||
{ | ||
"software_name": "Example SW", | ||
"software_version": [1, 1, 2], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_esp32_example_v1.1.2.bin", | ||
"software_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"min_hardware_version": [1, 0, 0], | ||
"max_hardware_version": [1, 0, 2] | ||
}, | ||
{ | ||
"software_name": "Example SW", | ||
"software_version": [2, 0, 0], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_esp32_example_v2.0.0.bin", | ||
"software_icon": "https://raw.githubusercontent.com/vovagorodok/ble_ota_app/main/web/icons/Icon-192.png", | ||
"min_hardware_version": [2, 0, 0], | ||
"max_hardware_version": [2, 0, 1] | ||
}, | ||
{ | ||
"software_name": "Other SW", | ||
"software_version": [1, 6, 6], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_esp32_other_v1.6.6.bin", | ||
"min_hardware_version": [1, 0, 0], | ||
"max_hardware_version": [1, 0, 3] | ||
}, | ||
{ | ||
"software_name": "Experimental SW", | ||
"software_version": [1, 1, 2], | ||
"software_path": "https://github.com/vovagorodok/ArduinoBleOTA/releases/download/v1.0.0/firmware_esp32_experimental_v1.1.2.bin", | ||
"software_text": "Experimental branch of Example SW.\n\nChanges:\n- first\n- second" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$( cd $( dirname $0 ) && pwd ) | ||
OUT_DIR=$SCRIPT_DIR/out | ||
PROJECT_DIR=$SCRIPT_DIR/../.. | ||
PIO_BUILD_DIR=$PROJECT_DIR/.pio/build | ||
EXAMPLE_PATH=$PROJECT_DIR/examples/full/main.ino | ||
|
||
source ~/.platformio/penv/bin/activate | ||
|
||
rm -rf $OUT_DIR | ||
mkdir -p $OUT_DIR | ||
cd $PROJECT_DIR | ||
|
||
change_example() { | ||
FROM=$1 | ||
TO=$2 | ||
sed -i "s/$FROM/$TO/g" $EXAMPLE_PATH | ||
} | ||
|
||
build_firmware() { | ||
BUILD_PLATFORM=$1 | ||
BUILD_ENV=$2 | ||
NEW_SW_NAME_AND_VER=$3 | ||
NEW_SW_NAME=$4 | ||
NEW_SW_VER=$5 | ||
NEW_HW_VER=$6 | ||
OLD_SW_NAME="Example SW" | ||
OLD_SW_VER="SW_VER {1, 0, 0}" | ||
OLD_HW_VER="HW_VER {1, 0, 0}" | ||
BIN_PATH=$PIO_BUILD_DIR/$BUILD_ENV/firmware.bin | ||
|
||
change_example "$OLD_SW_VER" "$NEW_SW_VER" | ||
change_example "$OLD_HW_VER" "$NEW_HW_VER" | ||
change_example "$OLD_SW_NAME" "$NEW_SW_NAME" | ||
|
||
pio run -e $BUILD_ENV | ||
mv $BIN_PATH $OUT_DIR/firmware_${BUILD_PLATFORM}_${NEW_SW_NAME_AND_VER}.bin | ||
|
||
change_example "$NEW_SW_VER" "$OLD_SW_VER" | ||
change_example "$NEW_HW_VER" "$OLD_HW_VER" | ||
change_example "$NEW_SW_NAME" "$OLD_SW_NAME" | ||
} | ||
|
||
build_firmware_for_platform() { | ||
BUILD_PLATFORM=$1 | ||
BUILD_ENV=$2 | ||
|
||
build_firmware $BUILD_PLATFORM $BUILD_ENV "example_v1.0.0" "Example SW" "SW_VER {1, 0, 0}" "HW_VER {1, 0, 0}" | ||
build_firmware $BUILD_PLATFORM $BUILD_ENV "example_v1.1.0" "Example SW" "SW_VER {1, 1, 0}" "HW_VER {1, 0, 0}" | ||
build_firmware $BUILD_PLATFORM $BUILD_ENV "example_v1.1.2" "Example SW" "SW_VER {1, 1, 2}" "HW_VER {1, 0, 0}" | ||
build_firmware $BUILD_PLATFORM $BUILD_ENV "example_v2.0.0" "Example SW" "SW_VER {2, 0, 0}" "HW_VER {2, 0, 0}" | ||
build_firmware $BUILD_PLATFORM $BUILD_ENV "experimental_v1.1.2" "Experimental SW" "SW_VER {1, 1, 2}" "HW_VER {1, 0, 0}" | ||
build_firmware $BUILD_PLATFORM $BUILD_ENV "other_v1.6.6" "Other SW" "SW_VER {1, 6, 6}" "HW_VER {1, 0, 0}" | ||
} | ||
|
||
build_firmware_for_platform "esp32" "esp32dev" | ||
build_firmware_for_platform "atmelsam" "nano_33_iot" |