Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev committed Dec 10, 2022
1 parent 7fda93e commit 296fda5
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 25 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ components/esp32-camera/
components/esp_littlefs/
components/esp-rainmaker/
components/esp-dsp/
components/esp-insights/
components/arduino_tinyusb/tinyusb/
esp-idf/
out/
build/
Expand All @@ -15,7 +17,4 @@ env.sh
sdkconfig
sdkconfig.old
version.txt
components/arduino_tinyusb/tinyusb/
dependencies.lock
tools/esptool/
components/esp-insights/
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ rm -rf build sdkconfig out

# Add components version info
mkdir -p "$AR_TOOLS/sdk" && rm -rf version.txt && rm -rf "$AR_TOOLS/sdk/versions.txt"
component_version="esp-idf: "$(git -C "$IDF_PATH" symbolic-ref --short HEAD)" "$(git -C "$IDF_PATH" rev-parse --short HEAD)
component_version="esp-idf: "$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)" "$(git -C "$IDF_PATH" rev-parse --short HEAD)
echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/sdk/versions.txt"
for component in `ls "$AR_COMPS"`; do
if [ -d "$AR_COMPS/$component/.git" ] || [ -d "$AR_COMPS/$component/.github" ]; then
component_version="$component: "$(git -C "$AR_COMPS/$component" symbolic-ref --short HEAD)" "$(git -C "$AR_COMPS/$component" rev-parse --short HEAD)
component_version="$component: "$(git -C "$AR_COMPS/$component" symbolic-ref --short HEAD || git -C "$AR_COMPS/$component" tag --points-at HEAD)" "$(git -C "$AR_COMPS/$component" rev-parse --short HEAD)
echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/sdk/versions.txt"
fi
done
component_version="tinyusb: "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" symbolic-ref --short HEAD)" "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" rev-parse --short HEAD)
component_version="tinyusb: "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" symbolic-ref --short HEAD || git -C "$AR_COMPS/arduino_tinyusb/tinyusb" tag --points-at HEAD)" "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" rev-parse --short HEAD)
echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/sdk/versions.txt"

#targets_count=`jq -c '.targets[] | length' configs/builds.json`
Expand Down
2 changes: 1 addition & 1 deletion tools/archive-build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD || echo "")
IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || echo "")
IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD || echo "")

idf_version_string=${IDF_BRANCH//\//_}"-$IDF_COMMIT"
archive_path="dist/arduino-esp32-libs-$idf_version_string.tar.gz"
Expand Down
5 changes: 3 additions & 2 deletions tools/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,15 @@ function git_create_pr(){ # git_create_pr <branch> <title>
local pr_title="$2"
local pr_target="$3"
local pr_body=""
pr_body+="esp-idf: "$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)" "$(git -C "$IDF_PATH" rev-parse --short HEAD)"\r\n"
for component in `ls "$AR_COMPS"`; do
if [ ! $component == "arduino" ]; then
if [ -d "$AR_COMPS/$component/.git" ] || [ -d "$AR_COMPS/$component/.github" ]; then
pr_body+="$component: "$(git -C "$AR_COMPS/$component" symbolic-ref --short HEAD)" "$(git -C "$AR_COMPS/$component" rev-parse --short HEAD)"\r\n"
pr_body+="$component: "$(git -C "$AR_COMPS/$component" symbolic-ref --short HEAD || git -C "$AR_COMPS/$component" tag --points-at HEAD)" "$(git -C "$AR_COMPS/$component" rev-parse --short HEAD)"\r\n"
fi
fi
done
pr_body+="tinyusb: "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" symbolic-ref --short HEAD)" "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" rev-parse --short HEAD)"\r\n"
pr_body+="tinyusb: "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" symbolic-ref --short HEAD || git -C "$AR_COMPS/arduino_tinyusb/tinyusb" tag --points-at HEAD)" "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" rev-parse --short HEAD)"\r\n"
local pr_data="{\"title\": \"$pr_title\", \"body\": \"$pr_body\", \"head\": \"$AR_USER:$pr_branch\", \"base\": \"$pr_target\"}"
git_create_pr_res=`echo "$pr_data" | curl -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" --data @- "https://api.github.com/repos/$AR_REPO/pulls"`
local done_pr=`echo "$git_create_pr_res" | jq -r '.title'`
Expand Down
9 changes: 1 addition & 8 deletions tools/copy-bootloader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ BOOTCONF=$FLASH_MODE"_$FLASH_FREQ"

source ./tools/config.sh

echo "Copying bootloader: $AR_SDK/bin/bootloader_$BOOTCONF.bin"
echo "Copying bootloader: $AR_SDK/bin/bootloader_$BOOTCONF.elf"

mkdir -p "$AR_SDK/bin"

# Workaround for getting the bootloaders to be flashable with esptool v4.x
# It might still be needed for IDF5, but using the included esptool instead
#cp "build/bootloader/bootloader.bin" "$AR_SDK/bin/bootloader_$BOOTCONF.bin"
if [ ! -e "tools/esptool" ]; then
git clone https://github.com/espressif/esptool tools/esptool
fi
./tools/esptool/esptool.py --chip "$IDF_TARGET" elf2image --dont-append-digest "build/bootloader/bootloader.elf" -o "$AR_SDK/bin/bootloader_$BOOTCONF.bin"
cp "build/bootloader/bootloader.elf" "$AR_SDK/bin/bootloader_$BOOTCONF.elf"
3 changes: 1 addition & 2 deletions tools/copy-to-arduino.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ fi

echo "Installing new libraries to $ESP32_ARDUINO"

rm -rf $ESP32_ARDUINO/tools/sdk $ESP32_ARDUINO/tools/esptool.py $ESP32_ARDUINO/tools/gen_esp32part.py $ESP32_ARDUINO/tools/platformio-build-*.py $ESP32_ARDUINO/platform.txt
rm -rf $ESP32_ARDUINO/tools/sdk $ESP32_ARDUINO/tools/gen_esp32part.py $ESP32_ARDUINO/tools/platformio-build-*.py $ESP32_ARDUINO/platform.txt

cp -f $AR_OUT/platform.txt $ESP32_ARDUINO/
cp -Rf $AR_TOOLS/sdk $ESP32_ARDUINO/tools/
cp -f $AR_TOOLS/esptool.py $ESP32_ARDUINO/tools/
cp -f $AR_TOOLS/gen_esp32part.py $ESP32_ARDUINO/tools/
cp -f $AR_TOOLS/platformio-build-*.py $ESP32_ARDUINO/tools/
2 changes: 1 addition & 1 deletion tools/install-esp-idf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fi

source $IDF_PATH/export.sh
export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD)
export IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD)
export IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)

#
# SETUP ARDUINO DEPLOY
Expand Down
5 changes: 0 additions & 5 deletions tools/update-components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ if [ $? -ne 0 ]; then exit 1; fi
if [ ! -d "$AR_COMPS/esp-rainmaker" ]; then
git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker" && \
git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive
# git -C "$AR_COMPS/esp-rainmaker" checkout f1b82c71c4536ab816d17df016d8afe106bd60e3
else
git -C "$AR_COMPS/esp-rainmaker" fetch && \
git -C "$AR_COMPS/esp-rainmaker" pull --ff-only && \
Expand Down Expand Up @@ -142,10 +141,6 @@ if [ $? -ne 0 ]; then exit 1; fi

if [ ! -d "$AR_COMPS/esp-dsp" ]; then
git clone $DSP_REPO_URL "$AR_COMPS/esp-dsp"
# cml=`cat "$AR_COMPS/esp-dsp/CMakeLists.txt"`
# echo "if(IDF_TARGET STREQUAL \"esp32\" OR IDF_TARGET STREQUAL \"esp32s2\" OR IDF_TARGET STREQUAL \"esp32s3\")" > "$AR_COMPS/esp-dsp/CMakeLists.txt"
# echo "$cml" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
# echo "endif()" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
else
git -C "$AR_COMPS/esp-dsp" fetch && \
git -C "$AR_COMPS/esp-dsp" pull --ff-only
Expand Down

0 comments on commit 296fda5

Please sign in to comment.