Skip to content

Commit 6f9de8d

Browse files
committed
build: refactor Espressif IDF setup and build commands
Moved the Espressif IDF setup and build commands to the top of the script for better organization and readability. This change improves the script structure and ensures that the necessary environment variables are set before proceeding with the build process. Signed-off-by: Chiho Sin <[email protected]>
1 parent 280f19e commit 6f9de8d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

entrypoint.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ git fetch "${REPO_REMOTE}" "${REPO_REF}"
1919
git reset --hard FETCH_HEAD
2020
git repack -d
2121

22+
# Espressif IDF
23+
if [[ ${MPY_PORT} == "esp32" ]]; then
24+
export IDF_PATH=/opt/esp-idf
25+
export IDF_TOOLS_PATH=/opt/esp-idf-tools
26+
export ESP_ROM_ELF_DIR=/opt/esp-idf-tools
27+
# trunk-ignore(shellcheck/SC1091)
28+
source "${IDF_PATH}/export.sh"
29+
fi
30+
31+
make -j"${JOBS}" -C mpy-cross
32+
make -C ports/"${MPY_PORT}" submodules
33+
2234
# Make the firmware tag
2335
# final filename will be <BOARD><-VARIANT>-<DATE>-v<SEMVER>.ext
2436
# where SEMVER is vX.Y.Z or vX.Y.Z-preview.N.gHASH or vX.Y.Z-preview.N.gHASH.dirty
@@ -36,18 +48,6 @@ FW_TAG="-${FW_DATE}-${FW_SEMVER}"
3648
echo "Firmware version: ${FW_SEMVER}"
3749
echo "Firmware tag: ${FW_TAG}"
3850

39-
# Espressif IDF
40-
if [[ ${MPY_PORT} == "esp32" ]]; then
41-
export IDF_PATH=/opt/esp-idf
42-
export IDF_TOOLS_PATH=/opt/esp-idf-tools
43-
export ESP_ROM_ELF_DIR=/opt/esp-idf-tools
44-
# trunk-ignore(shellcheck/SC1091)
45-
source "${IDF_PATH}/export.sh"
46-
fi
47-
48-
make -j"${JOBS}" -C mpy-cross
49-
make -C ports/"${MPY_PORT}" submodules
50-
5151
# Build
5252
echo "Build ${MPY_PORT} firmware: ${BOARD}"
5353
mkdir -p "${WORKSPACE}/bin"

0 commit comments

Comments
 (0)