@@ -20,51 +20,38 @@ export IDF_COMPONENT_OVERWRITE_MANAGED_COMPONENTS=1
20
20
21
21
CCACHE_ENABLE=1
22
22
23
- TARGET=" all"
23
+ export TARGET=" all"
24
24
BUILD_TYPE=" all"
25
- BUILD_DEBUG=" default"
26
25
SKIP_ENV=0
27
26
COPY_OUT=0
28
- ARCHIVE_OUT=0
29
- if [ -z $DEPLOY_OUT ]; then
30
- DEPLOY_OUT=0
31
- fi
27
+ ARCHIVE_OUT=1
28
+ DEPLOY_OUT=0
32
29
33
30
function print_help() {
34
- echo " Usage: build.sh [-s] [-n] [-A <arduino_branch>] [-I <idf_branch>] [-D <debug_level>] [- i <idf_commit>] [-c <path>] [-t <target>] [-b <build|menuconfig|reconfigure|idf-libs|copy-bootloader|mem-variant>] [config ...]"
31
+ echo " Usage: build.sh [-s] [-n] [-A <arduino_branch>] [-I <idf_branch>] [-i <idf_commit>] [-c <path>] [-t <target>] [-b <build|menuconfig|reconfigure|idf-libs|copy-bootloader|mem-variant>] [config ...]"
35
32
echo " -s Skip installing/updating of ESP-IDF and all components"
36
33
echo " -n Disable ccache"
37
34
echo " -A Set which branch of arduino-esp32 to be used for compilation"
38
35
echo " -I Set which branch of ESP-IDF to be used for compilation"
39
36
echo " -i Set which commit of ESP-IDF to be used for compilation"
40
37
echo " -e Archive the build to dist"
41
- echo " -d Deploy the build to github arduino-esp32"
42
- echo " -D Debug level to be set to ESP-IDF. One of default,none,error,warning,info,debug or verbose"
43
- echo " -c Set the arduino-esp32 folder to copy the result to. ex. '$HOME /Arduino/hardware/espressif/esp32'"
44
38
echo " -t Set the build target(chip) ex. 'esp32s3' or select multiple targets(chips) by separating them with comma ex. 'esp32,esp32s3,esp32c3'"
45
39
echo " -b Set the build type. ex. 'build' to build the project and prepare for uploading to a board"
46
40
echo " ... Specify additional configs to be applied. ex. 'qio 80m' to compile for QIO Flash@80MHz. Requires -b"
47
41
exit 1
48
42
}
49
43
50
- while getopts " :A:I:i:c:t:b:D: sde" opt; do
44
+ while getopts " :A:I:i:c:t:b:sde" opt; do
51
45
case ${opt} in
52
46
s )
53
47
SKIP_ENV=1
54
48
;;
55
49
n )
56
50
CCACHE_ENABLE=0
57
51
;;
58
- d )
59
- DEPLOY_OUT=1
60
- ;;
61
52
e )
62
53
ARCHIVE_OUT=1
63
54
;;
64
- c )
65
- export ESP32_ARDUINO=" $OPTARG "
66
- COPY_OUT=1
67
- ;;
68
55
A )
69
56
export AR_BRANCH=" $OPTARG "
70
57
;;
@@ -74,19 +61,16 @@ while getopts ":A:I:i:c:t:b:D:sde" opt; do
74
61
i )
75
62
export IDF_COMMIT=" $OPTARG "
76
63
;;
77
- D )
78
- BUILD_DEBUG=" $OPTARG "
79
- ;;
80
64
t )
81
65
IFS=' ,' read -ra TARGET <<< " $OPTARG"
82
66
;;
83
67
b )
84
68
b=$OPTARG
85
- if [ " $b " != " build" ] &&
86
- [ " $b " != " menuconfig" ] &&
87
- [ " $b " != " reconfigure" ] &&
88
- [ " $b " != " idf-libs" ] &&
89
- [ " $b " != " copy-bootloader" ] &&
69
+ if [ " $b " != " build" ] &&
70
+ [ " $b " != " menuconfig" ] &&
71
+ [ " $b " != " reconfigure" ] &&
72
+ [ " $b " != " idf-libs" ] &&
73
+ [ " $b " != " copy-bootloader" ] &&
90
74
[ " $b " != " mem-variant" ]; then
91
75
print_help
92
76
fi
@@ -111,6 +95,7 @@ export IDF_CCACHE_ENABLE=$CCACHE_ENABLE
111
95
echo " TARGET(s): ${TARGET[@]} "
112
96
113
97
mkdir -p dist
98
+ rm -rf dependencies.lock
114
99
115
100
if [ $SKIP_ENV -eq 0 ]; then
116
101
echo " * Installing/Updating ESP-IDF and all components..."
@@ -155,7 +140,7 @@ if [ "$BUILD_TYPE" != "all" ]; then
155
140
continue
156
141
fi
157
142
158
- configs=" configs/defconfig.common;configs/defconfig.$target ;configs/defconfig.debug_ $BUILD_DEBUG "
143
+ configs=" configs/defconfig.common;configs/defconfig.$target "
159
144
for defconf in ` echo " $target_json " | jq -c ' .features[]' | tr -d ' "' ` ; do
160
145
configs=" $configs ;configs/defconfig.$defconf "
161
146
done
178
163
rm -rf build sdkconfig out
179
164
mkdir -p " $AR_TOOLS /esp32-arduino-libs"
180
165
166
+ # Add release-info
167
+ rm -rf release-info.txt
168
+ IDF_Commit_short=$( git -C " $IDF_PATH " rev-parse --short HEAD || echo " " )
169
+ AR_Commit_short=$( git -C " $AR_COMPS /arduino" rev-parse --short HEAD || echo " " )
170
+ echo " Framework built from
171
+ - $IDF_REPO branch [$IDF_BRANCH ](https://github.com/$IDF_REPO /tree/$IDF_BRANCH ) commit [$IDF_Commit_short ](https://github.com/$IDF_REPO /commits/$IDF_BRANCH /#:~:text=$IDF_Commit_short )
172
+ - $AR_REPO branch [$AR_BRANCH ](https://github.com/$AR_REPO /tree/$AR_BRANCH ) commit [$AR_Commit_short ](https://github.com/$AR_REPO /commits/$AR_BRANCH /#:~:text=$AR_Commit_short )
173
+ - Arduino lib builder branch: $GIT_BRANCH " >> release-info.txt
174
+
181
175
# targets_count=`jq -c '.targets[] | length' configs/builds.json`
182
176
for target_json in ` jq -c ' .targets[]' configs/builds.json` ; do
183
177
target=$( echo " $target_json " | jq -c ' .target' | tr -d ' "' )
@@ -210,7 +204,7 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
210
204
echo " * Target: $target "
211
205
212
206
# Build Main Configs List
213
- main_configs=" configs/defconfig.common;configs/defconfig.$target ;configs/defconfig.debug_ $BUILD_DEBUG "
207
+ main_configs=" configs/defconfig.common;configs/defconfig.$target "
214
208
for defconf in ` echo " $target_json " | jq -c ' .features[]' | tr -d ' "' ` ; do
215
209
main_configs=" $main_configs ;configs/defconfig.$defconf "
216
210
done
@@ -226,19 +220,6 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
226
220
idf.py -DIDF_TARGET=" $target " -DSDKCONFIG_DEFAULTS=" $idf_libs_configs " idf-libs
227
221
if [ $? -ne 0 ]; then exit 1; fi
228
222
229
- if [ " $target " == " esp32s3" ]; then
230
- idf.py -DIDF_TARGET=" $target " -DSDKCONFIG_DEFAULTS=" $idf_libs_configs " srmodels_bin
231
- if [ $? -ne 0 ]; then exit 1; fi
232
- AR_SDK=" $AR_TOOLS /esp32-arduino-libs/$target "
233
- # sr model.bin
234
- if [ -f " build/srmodels/srmodels.bin" ]; then
235
- echo " $AR_SDK /esp_sr"
236
- mkdir -p " $AR_SDK /esp_sr"
237
- cp -f " build/srmodels/srmodels.bin" " $AR_SDK /esp_sr/"
238
- cp -f " partitions.csv" " $AR_SDK /esp_sr/"
239
- fi
240
- fi
241
-
242
223
# Build Bootloaders
243
224
for boot_conf in ` echo " $target_json " | jq -c ' .bootloaders[]' ` ; do
244
225
bootloader_configs=" $main_configs "
@@ -297,42 +278,33 @@ for component in `ls "$AR_MANAGED_COMPS"`; do
297
278
fi
298
279
done
299
280
300
- # update package_esp32_index.template.json
301
- if [ " $BUILD_TYPE " = " all" ]; then
302
- echo " * Generating package_esp32_index.template.json..."
303
- python3 ./tools/gen_tools_json.py -i " $IDF_PATH " -j " $AR_COMPS /arduino/package/package_esp32_index.template.json" -o " $AR_OUT /"
304
- python3 ./tools/gen_tools_json.py -i " $IDF_PATH " -o " $TOOLS_JSON_OUT /"
305
- if [ $? -ne 0 ]; then exit 1; fi
306
- fi
281
+ export IDF_COMMIT=$( git -C " $IDF_PATH " rev-parse --short HEAD)
307
282
308
- # Generate PlatformIO manifest file
283
+ # Generate PlatformIO library manifest file
309
284
if [ " $BUILD_TYPE " = " all" ]; then
310
- echo " * Generating PlatformIO manifest file..."
311
- pushd $IDF_PATH
312
- ibr=$( git describe --all 2> /dev/null)
313
- ic=$( git -C " $IDF_PATH " rev-parse --short HEAD)
314
- popd
315
- python3 ./tools/gen_platformio_manifest.py -o " $TOOLS_JSON_OUT /" -s " $ibr " -c " $ic "
285
+ python3 ./tools/gen_pio_lib_manifest.py -o " $TOOLS_JSON_OUT /" -s " v$IDF_VERSION " -c " $IDF_COMMIT "
316
286
if [ $? -ne 0 ]; then exit 1; fi
317
287
fi
318
288
319
- # copy everything to arduino-esp32 installation
320
- if [ $COPY_OUT -eq 1 ] && [ -d " $ESP32_ARDUINO " ]; then
321
- echo " * Copying to Arduino..."
322
- ./tools/copy-to-arduino.sh
323
- if [ $? -ne 0 ]; then exit 1; fi
324
- fi
289
+ AR_VERSION=$( jq -c ' .version' " $AR_COMPS /arduino/package.json" | tr -d ' "' )
290
+ AR_VERSION_UNDERSCORE=` echo " $AR_VERSION " | tr . _`
325
291
326
- # push changes to esp32-arduino-libs and create pull request into arduino-esp32
327
- if [ $DEPLOY_OUT -eq 1 ] ; then
328
- echo " * Pushing to Arduino... "
329
- ./tools/push-to-arduino.sh
292
+ # Generate PlatformIO framework manifest file
293
+ rm -rf " $AR_ROOT /package.json "
294
+ if [ " $BUILD_TYPE " = " all " ] ; then
295
+ python3 ./tools/gen_pio_frmwk_manifest.py -o " $AR_ROOT / " -s " v $AR_VERSION " -c " $IDF_COMMIT "
330
296
if [ $? -ne 0 ]; then exit 1; fi
331
297
fi
332
298
299
+ # Generate core_version.h
300
+ rm -rf " $AR_ROOT /core_version.h"
301
+ echo " #define ARDUINO_ESP32_GIT_VER 0x$AR_Commit_short
302
+ #define ARDUINO_ESP32_GIT_DESC $AR_VERSION
303
+ #define ARDUINO_ESP32_RELEASE_$AR_VERSION_UNDERSCORE
304
+ #define ARDUINO_ESP32_RELEASE \" $AR_VERSION_UNDERSCORE \" " >> " $AR_ROOT /core_version.h"
305
+
333
306
# archive the build
334
307
if [ $ARCHIVE_OUT -eq 1 ]; then
335
- echo " * Archiving build..."
336
308
./tools/archive-build.sh " $TARGET "
337
309
if [ $? -ne 0 ]; then exit 1; fi
338
310
fi
0 commit comments