Skip to content

Commit b69a857

Browse files
authored
changed components info generating
1 parent dd380dc commit b69a857

File tree

1 file changed

+32
-20
lines changed

1 file changed

+32
-20
lines changed

build.sh

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -138,26 +138,7 @@ if [ "$BUILD_TYPE" != "all" ]; then
138138
fi
139139

140140
rm -rf build sdkconfig out
141-
142-
# Add components version info
143-
mkdir -p "$AR_TOOLS/esp32-arduino-libs" && rm -rf version.txt && rm -rf "$AR_TOOLS/esp32-arduino-libs/versions.txt"
144-
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)
145-
echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
146-
for component in `ls "$AR_COMPS"`; do
147-
if [ -d "$AR_COMPS/$component/.git" ] || [ -d "$AR_COMPS/$component/.github" ]; then
148-
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)
149-
echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
150-
fi
151-
done
152-
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)
153-
echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
154-
155-
# Add release-info
156-
rm -rf release-info.txt
157-
IDF_Commit_short=$(git -C "$IDF_PATH" rev-parse --short HEAD || echo "")
158-
AR_Commit_short=$(git -C "$AR_COMPS/arduino" rev-parse --short HEAD || echo "")
159-
echo "Framework built from $IDF_REPO branch $IDF_BRANCH commit $IDF_Commit_short and $AR_REPO branch $AR_BRANCH commit $AR_Commit_short" >> release-info.txt
160-
141+
mkdir -p "$AR_TOOLS/esp32-arduino-libs"
161142

162143
#targets_count=`jq -c '.targets[] | length' configs/builds.json`
163144
for target_json in `jq -c '.targets[]' configs/builds.json`; do
@@ -214,6 +195,37 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
214195
done
215196
done
216197

198+
#
199+
# Add components version info
200+
#
201+
rm -rf "$AR_TOOLS/esp32-arduino-libs/versions.txt"
202+
# The lib-builder version
203+
component_version="lib-builder: "$(git -C "$AR_ROOT" symbolic-ref --short HEAD || git -C "$AR_ROOT" tag --points-at HEAD)" "$(git -C "$AR_ROOT" rev-parse --short HEAD)
204+
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
205+
# ESP-IDF version
206+
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)
207+
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
208+
# components version
209+
for component in `ls "$AR_COMPS"`; do
210+
if [ -d "$AR_COMPS/$component/.git" ]; then
211+
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)
212+
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
213+
fi
214+
done
215+
# TinyUSB version
216+
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)
217+
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
218+
# managed components version
219+
for component in `ls "$AR_MANAGED_COMPS"`; do
220+
if [ -d "$AR_MANAGED_COMPS/$component/.git" ]; then
221+
component_version="$component: "$(git -C "$AR_MANAGED_COMPS/$component" symbolic-ref --short HEAD || git -C "$AR_MANAGED_COMPS/$component" tag --points-at HEAD)" "$(git -C "$AR_MANAGED_COMPS/$component" rev-parse --short HEAD)
222+
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
223+
elif [ -f "$AR_MANAGED_COMPS/$component/idf_component.yml" ]; then
224+
component_version="$component: "$(cat "$AR_MANAGED_COMPS/$component/idf_component.yml" | grep "^version: " | cut -d ' ' -f 2)
225+
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
226+
fi
227+
done
228+
217229
# update package_esp32_index.template.json
218230
if [ "$BUILD_TYPE" = "all" ]; then
219231
python3 ./tools/gen_tools_json.py -i "$IDF_PATH" -j "$AR_COMPS/arduino/package/package_esp32_index.template.json" -o "$AR_OUT/"

0 commit comments

Comments
 (0)