Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

598 preprocessor script for printing the library versions to boot outtxt #607

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 32 additions & 28 deletions .github/workflows/build-clang-doxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
ref: ci-wippersnapper
- name: Checkout Board Definitions
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -72,8 +72,8 @@ jobs:
- name: Install Dependencies (esptool)
run: |
pip3 install esptool
- name: Build for ESP32-SX
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: Build for ESP32-SX (esptool)
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: list files
run: |
ls -Rla examples/
Expand Down Expand Up @@ -182,9 +182,9 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
ref: ci-wippersnapper
- name: Install CI-Arduino
run: bash ci/actions_install.sh
- name: Install extra Arduino libraries
Expand Down Expand Up @@ -214,11 +214,11 @@ jobs:
run: |
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
- name: Build for ESP32-SX
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: list
run: |
ls
ls examples/*/build/
python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: list files (tree)
run: |
tree
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
Expand Down Expand Up @@ -264,9 +264,9 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
ref: ci-wippersnapper
- name: Checkout Board Definitions
uses: actions/checkout@v4
with:
Expand All @@ -290,7 +290,7 @@ jobs:
run: |
pip3 install esptool
- name: build ESP32 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: Check artifacts
run: |
ls examples/Wippersnapper_demo/build/*
Expand Down Expand Up @@ -373,7 +373,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -392,8 +393,8 @@ jobs:
# Copy files to WipperSnapper's src/nanopb directory
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: build SAMD platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
Expand Down Expand Up @@ -425,7 +426,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -443,8 +445,8 @@ jobs:
# Copy files to WipperSnapper's src/nanopb directory
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: build RP2040 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
Expand Down Expand Up @@ -475,7 +477,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -493,8 +496,8 @@ jobs:
# Copy files to WipperSnapper's src/nanopb directory
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: build SAMD (no-FS) platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h

build-esp8266:
name: 🏗️ESP8266
Expand All @@ -515,7 +518,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -531,8 +535,8 @@ jobs:
# Copy files to WipperSnapper's src/nanopb directory
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: build ESP8266 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
- name: list build artifacts
run: |
ls
Expand Down Expand Up @@ -578,9 +582,9 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
repository: tyeth/ci-arduino
brentru marked this conversation as resolved.
Show resolved Hide resolved
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
path: ci
ref: ci-wippersnapper
- name: Install CI-Arduino
run: bash ci/actions_install.sh
- name: Install extra Arduino libraries
Expand Down Expand Up @@ -610,7 +614,7 @@ jobs:
run: |
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
- name: Build for ESP32-SX
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
tyeth marked this conversation as resolved.
Show resolved Hide resolved
- name: list
run: |
ls
Expand Down
9 changes: 9 additions & 0 deletions src/print_dependencies.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "print_dependencies.h"

const char *project_dependencies = R"(
tyeth marked this conversation as resolved.
Show resolved Hide resolved
Libraries and Versions:
** This is a placeholder, you can fill this in automatically by running arduino-cli and copying the output here. **

Platforms and Versions:
** Board Support Package placeholder **
)";
6 changes: 6 additions & 0 deletions src/print_dependencies.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef PROJECT_DEPENDENCIES_H
#define PROJECT_DEPENDENCIES_H

#define PRINT_DEPENDENCIES 0
extern const char *project_dependencies;
#endif // PROJECT_DEPENDENCIES_H
8 changes: 8 additions & 0 deletions src/provisioning/littlefs/WipperSnapper_LittleFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
*/
/**************************************************************************/
WipperSnapper_LittleFS::WipperSnapper_LittleFS() {
#if PRINT_DEPENDENCIES
// Print project build dependencies
WS_DEBUG_PRINTLN("Build Dependencies:");
WS_DEBUG_PRINTLN("*********************");
WS_DEBUG_PRINTLN(project_dependencies);
tyeth marked this conversation as resolved.
Show resolved Hide resolved
WS_DEBUG_PRINTLN("*********************");
#endif

// Attempt to initialize filesystem
if (!LittleFS.begin()) {
setStatusLEDColor(RED);
Expand Down
14 changes: 14 additions & 0 deletions src/provisioning/tinyusb/Wippersnapper_FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* BSD license, all text here must be included in any redistribution.
*
*/

#if defined(ARDUINO_MAGTAG29_ESP32S2) || defined(ARDUINO_METRO_ESP32S2) || \
defined(ARDUINO_FUNHOUSE_ESP32S2) || \
defined(ADAFRUIT_PYPORTAL_M4_TITANO) || \
Expand All @@ -27,6 +28,7 @@
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT) || \
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_REVTFT) || \
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2)
#include "print_dependencies.h"
#include "Wippersnapper_FS.h"
// On-board external flash (QSPI or SPI) macros should already
// defined in your board variant if supported
Expand Down Expand Up @@ -89,6 +91,13 @@ bool setVolumeLabel() {
*/
/**************************************************************************/
Wippersnapper_FS::Wippersnapper_FS() {
#if PRINT_DEPENDENCIES
WS_DEBUG_PRINTLN("Build Dependencies:");
WS_DEBUG_PRINTLN("*********************");
WS_DEBUG_PRINTLN(project_dependencies);
WS_DEBUG_PRINTLN("*********************");
WS_PRINTER.flush();
#endif
// Detach USB device during init.
TinyUSBDevice.detach();
// Wait for detach
Expand Down Expand Up @@ -277,6 +286,11 @@ bool Wippersnapper_FS::createBootFile() {
bootFile.print("MAC Address: ");
bootFile.println(sMAC);

#if PRINT_DEPENDENCIES
bootFile.println("Build dependencies:");
bootFile.println(project_dependencies);
#endif

// Print ESP-specific info to boot file
#ifdef ARDUINO_ARCH_ESP32
// Get version of ESP-IDF
Expand Down