Skip to content

Commit d211c9f

Browse files
authored
generate core version.h
1 parent 636cbc9 commit d211c9f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

build.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,23 @@ if [ "$BUILD_TYPE" = "all" ]; then
250250
if [ $? -ne 0 ]; then exit 1; fi
251251
fi
252252

253+
AR_VERSION=$(jq -c '.version' "$AR_COMPS/arduino/package.json" | tr -d '"')
254+
AR_VERSION_UNDERSCORE=`echo "$AR_VERSION" | tr . _`
255+
253256
# Generate PlatformIO framework manifest file
254257
rm -rf "$AR_ROOT/package.json"
255-
AR_VERSION=$(jq -c '.version' "$AR_COMPS/arduino/package.json" | tr -d '"')
256258
if [ "$BUILD_TYPE" = "all" ]; then
257259
python3 ./tools/gen_pio_frmwk_manifest.py -o "$AR_ROOT/" -s "v$AR_VERSION" -c "$IDF_COMMIT"
258260
if [ $? -ne 0 ]; then exit 1; fi
259261
fi
260262

263+
# Generate core_version.h
264+
rm -rf "$AR_ROOT/core_version.h"
265+
echo "#define ARDUINO_ESP32_GIT_VER 0x$IDF_Commit_short
266+
#define ARDUINO_ESP32_GIT_DESC $AR_VERSION
267+
#define ARDUINO_ESP32_RELEASE_$AR_VERSION_UNDERSCORE
268+
#define ARDUINO_ESP32_RELEASE \"$AR_VERSION_UNDERSCORE\"" >> "$AR_ROOT/core_version.h"
269+
261270
# copy everything to arduino-esp32 installation
262271
if [ $COPY_OUT -eq 1 ] && [ -d "$ESP32_ARDUINO" ]; then
263272
./tools/copy-to-arduino.sh

0 commit comments

Comments
 (0)