Skip to content

Commit 6e0e6c8

Browse files
authored
Update build.sh
1 parent e2eb8d3 commit 6e0e6c8

File tree

1 file changed

+12
-42
lines changed

1 file changed

+12
-42
lines changed

build.sh

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ export TARGET="esp32"
1414
BUILD_TYPE="all"
1515
SKIP_ENV=0
1616
COPY_OUT=0
17-
ARCHIVE_OUT=0
18-
if [ -z $DEPLOY_OUT ]; then
19-
DEPLOY_OUT=0
20-
fi
17+
ARCHIVE_OUT=1
18+
DEPLOY_OUT=0
2119

2220
function print_help() {
2321
echo "Usage: build.sh [-s] [-A <arduino_branch>] [-I <idf_branch>] [-i <idf_commit>] [-c <path>] [-t <target>] [-b <build|menuconfig|reconfigure|idf-libs|copy-bootloader|mem-variant>] [config ...]"
@@ -26,8 +24,6 @@ function print_help() {
2624
echo " -I Set which branch of ESP-IDF to be used for compilation"
2725
echo " -i Set which commit of ESP-IDF to be used for compilation"
2826
echo " -e Archive the build to dist"
29-
echo " -d Deploy the build to github arduino-esp32"
30-
echo " -c Set the arduino-esp32 folder to copy the result to. ex. '$HOME/Arduino/hardware/espressif/esp32'"
3127
echo " -t Set the build target(chip) ex. 'esp32s3' or select multiple targets(chips) by separating them with comma ex. 'esp32,esp32s3,esp32c3'"
3228
echo " -b Set the build type. ex. 'build' to build the project and prepare for uploading to a board"
3329
echo " ... Specify additional configs to be applied. ex. 'qio 80m' to compile for QIO Flash@80MHz. Requires -b"
@@ -39,16 +35,9 @@ while getopts ":A:I:i:c:t:b:sde" opt; do
3935
s )
4036
SKIP_ENV=1
4137
;;
42-
d )
43-
DEPLOY_OUT=1
44-
;;
4538
e )
4639
ARCHIVE_OUT=1
4740
;;
48-
c )
49-
export ESP32_ARDUINO="$OPTARG"
50-
COPY_OUT=1
51-
;;
5241
A )
5342
export AR_BRANCH="$OPTARG"
5443
;;
@@ -63,11 +52,11 @@ while getopts ":A:I:i:c:t:b:sde" opt; do
6352
;;
6453
b )
6554
b=$OPTARG
66-
if [ "$b" != "build" ] &&
67-
[ "$b" != "menuconfig" ] &&
68-
[ "$b" != "reconfigure" ] &&
69-
[ "$b" != "idf-libs" ] &&
70-
[ "$b" != "copy-bootloader" ] &&
55+
if [ "$b" != "build" ] &&
56+
[ "$b" != "menuconfig" ] &&
57+
[ "$b" != "reconfigure" ] &&
58+
[ "$b" != "idf-libs" ] &&
59+
[ "$b" != "copy-bootloader" ] &&
7160
[ "$b" != "mem-variant" ]; then
7261
print_help
7362
fi
@@ -134,7 +123,7 @@ if [ "$BUILD_TYPE" != "all" ]; then
134123
# Skip building for targets that are not in the $TARGET array
135124
continue
136125
fi
137-
126+
138127
configs="configs/defconfig.common;configs/defconfig.$target"
139128
for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do
140129
configs="$configs;configs/defconfig.$defconf"
@@ -188,7 +177,7 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
188177
continue
189178
fi
190179
fi
191-
180+
192181
# Skip chips that should not be a part of the final libs
193182
# WARNING!!! this logic needs to be updated when cron builds are split into jobs
194183
if [ "$TARGET" = "all" ] && [ $target_skip -eq 1 ]; then
@@ -261,6 +250,7 @@ for component in `ls "$AR_COMPS"`; do
261250
done
262251
# esp32-camera version
263252
component_version="esp32-camera: "$(git -C "$AR_COMPS/esp32-camera" symbolic-ref --short HEAD || git -C "$AR_COMPS/esp32-camera" tag --points-at HEAD)" "$(git -C "$AR_COMPS/esp32-camera" rev-parse --short HEAD)
253+
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
264254
# managed components version
265255
for component in `ls "$AR_MANAGED_COMPS"`; do
266256
if [ -d "$AR_MANAGED_COMPS/$component/.git" ]; then
@@ -274,13 +264,6 @@ done
274264

275265
export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD)
276266

277-
# update package_esp32_index.template.json
278-
#if [ "$BUILD_TYPE" = "all" ]; then
279-
# python3 ./tools/gen_tools_json.py -i "$IDF_PATH" -j "$AR_COMPS/arduino/package/package_esp32_index.template.json" -o "$AR_OUT/"
280-
# python3 ./tools/gen_tools_json.py -i "$IDF_PATH" -o "$TOOLS_JSON_OUT/"
281-
# if [ $? -ne 0 ]; then exit 1; fi
282-
#fi
283-
284267
# Generate PlatformIO library manifest file
285268
if [ "$BUILD_TYPE" = "all" ]; then
286269
python3 ./tools/gen_pio_lib_manifest.py -o "$TOOLS_JSON_OUT/" -s "v$IDF_VERSION" -c "$IDF_COMMIT"
@@ -304,20 +287,7 @@ echo "#define ARDUINO_ESP32_GIT_VER 0x$AR_Commit_short
304287
#define ARDUINO_ESP32_RELEASE_$AR_VERSION_UNDERSCORE
305288
#define ARDUINO_ESP32_RELEASE \"$AR_VERSION_UNDERSCORE\"" >> "$AR_ROOT/core_version.h"
306289

307-
# copy everything to arduino-esp32 installation
308-
if [ $COPY_OUT -eq 1 ] && [ -d "$ESP32_ARDUINO" ]; then
309-
./tools/copy-to-arduino.sh
310-
if [ $? -ne 0 ]; then exit 1; fi
311-
fi
312-
313-
# push changes to esp32-arduino-libs and create pull request into arduino-esp32
314-
if [ $DEPLOY_OUT -eq 1 ]; then
315-
./tools/push-to-arduino.sh
316-
if [ $? -ne 0 ]; then exit 1; fi
317-
fi
318-
319-
# archive the build
320-
if [ "$BUILD_TYPE" = "all" ]; then
321-
./tools/archive-build.sh
290+
if [ $ARCHIVE_OUT -eq 1 ]; then
291+
./tools/archive-build.sh "$TARGET"
322292
if [ $? -ne 0 ]; then exit 1; fi
323293
fi

0 commit comments

Comments
 (0)