@@ -20,17 +20,18 @@ 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
25
BUILD_DEBUG=" default"
26
26
SKIP_ENV=0
27
27
COPY_OUT=0
28
- ARCHIVE_OUT=0
28
+ ARCHIVE_OUT=1
29
29
if [ -z $DEPLOY_OUT ]; then
30
30
DEPLOY_OUT=0
31
31
fi
32
32
33
33
function print_help() {
34
+
34
35
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 ...]"
35
36
echo " -s Skip installing/updating of ESP-IDF and all components"
36
37
echo " -n Disable ccache"
@@ -47,17 +48,17 @@ function print_help() {
47
48
exit 1
48
49
}
49
50
50
- while getopts " :A:I:i:c:t:b:D:sde " opt; do
51
+ while getopts " :A:I:i:c:t:b:D:sdne " opt; do
51
52
case ${opt} in
52
53
s )
53
54
SKIP_ENV=1
54
55
;;
55
- n )
56
- CCACHE_ENABLE=0
57
- ;;
58
56
d )
59
57
DEPLOY_OUT=1
60
58
;;
59
+ n )
60
+ CCACHE_ENABLE=0
61
+ ;;
61
62
e )
62
63
ARCHIVE_OUT=1
63
64
;;
@@ -112,6 +113,8 @@ echo "TARGET(s): ${TARGET[@]}"
112
113
113
114
mkdir -p dist
114
115
116
+ rm -rf dependencies.lock
117
+
115
118
if [ $SKIP_ENV -eq 0 ]; then
116
119
echo " * Installing/Updating ESP-IDF and all components..."
117
120
# update components from git
@@ -131,6 +134,10 @@ else
131
134
source ./tools/config.sh
132
135
fi
133
136
137
+ if [ -f " $AR_MANAGED_COMPS /espressif__esp-sr/.component_hash" ]; then
138
+ rm -rf $AR_MANAGED_COMPS /espressif__esp-sr/.component_hash
139
+ fi
140
+
134
141
if [ " $BUILD_TYPE " != " all" ]; then
135
142
if [ " $TARGET " = " all" ]; then
136
143
echo " ERROR: You need to specify target for non-default builds"
@@ -175,9 +182,20 @@ if [ "$BUILD_TYPE" != "all" ]; then
175
182
exit 0
176
183
fi
177
184
185
+ git submodule update --init --recursive
186
+
178
187
rm -rf build sdkconfig out
179
188
mkdir -p " $AR_TOOLS /esp32-arduino-libs"
180
189
190
+ # Add release-info
191
+ rm -rf release-info.txt
192
+ IDF_Commit_short=$( git -C " $IDF_PATH " rev-parse --short HEAD || echo " " )
193
+ AR_Commit_short=$( git -C " $AR_COMPS /arduino" rev-parse --short HEAD || echo " " )
194
+ echo " Framework built from
195
+ - $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 )
196
+ - $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 )
197
+ - Arduino lib builder branch: $GIT_BRANCH " >> release-info.txt
198
+
181
199
# targets_count=`jq -c '.targets[] | length' configs/builds.json`
182
200
for target_json in ` jq -c ' .targets[]' configs/builds.json` ; do
183
201
target=$( echo " $target_json " | jq -c ' .target' | tr -d ' "' )
@@ -221,6 +239,9 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
221
239
idf_libs_configs=" $idf_libs_configs ;configs/defconfig.$defconf "
222
240
done
223
241
242
+ if [ -f " $AR_MANAGED_COMPS /espressif__esp-sr/.component_hash" ]; then
243
+ rm -rf $AR_MANAGED_COMPS /espressif__esp-sr/.component_hash
244
+ fi
224
245
echo " * Build IDF-Libs: $idf_libs_configs "
225
246
rm -rf build sdkconfig
226
247
idf.py -DIDF_TARGET=" $target " -DSDKCONFIG_DEFAULTS=" $idf_libs_configs " idf-libs
@@ -246,6 +267,10 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
246
267
bootloader_configs=" $bootloader_configs ;configs/defconfig.$defconf " ;
247
268
done
248
269
270
+ if [ -f " $AR_MANAGED_COMPS /espressif__esp-sr/.component_hash" ]; then
271
+ rm -rf $AR_MANAGED_COMPS /espressif__esp-sr/.component_hash
272
+ fi
273
+
249
274
echo " * Build BootLoader: $bootloader_configs "
250
275
rm -rf build sdkconfig
251
276
idf.py -DIDF_TARGET=" $target " -DSDKCONFIG_DEFAULTS=" $bootloader_configs " copy-bootloader
@@ -259,6 +284,10 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
259
284
mem_configs=" $mem_configs ;configs/defconfig.$defconf " ;
260
285
done
261
286
287
+ if [ -f " $AR_MANAGED_COMPS /espressif__esp-sr/.component_hash" ]; then
288
+ rm -rf $AR_MANAGED_COMPS /espressif__esp-sr/.component_hash
289
+ fi
290
+
262
291
echo " * Build Memory Variant: $mem_configs "
263
292
rm -rf build sdkconfig
264
293
idf.py -DIDF_TARGET=" $target " -DSDKCONFIG_DEFAULTS=" $mem_configs " mem-variant
@@ -304,6 +333,7 @@ if [ "$BUILD_TYPE" = "all" ]; then
304
333
python3 ./tools/gen_tools_json.py -i " $IDF_PATH " -o " $TOOLS_JSON_OUT /"
305
334
if [ $? -ne 0 ]; then exit 1; fi
306
335
fi
336
+ export IDF_COMMIT=$( git -C " $IDF_PATH " rev-parse --short HEAD)
307
337
308
338
# Generate pioarduino manifest file
309
339
if [ " $BUILD_TYPE " = " all" ]; then
@@ -316,12 +346,29 @@ if [ "$BUILD_TYPE" = "all" ]; then
316
346
if [ $? -ne 0 ]; then exit 1; fi
317
347
fi
318
348
349
+ AR_VERSION=$( jq -c ' .version' " $AR_COMPS /arduino/package.json" | tr -d ' "' )
350
+ AR_VERSION_UNDERSCORE=` echo " $AR_VERSION " | tr . _`
351
+
352
+ # Generate PlatformIO framework manifest file
353
+ rm -rf " $AR_ROOT /package.json"
354
+
319
355
# copy everything to arduino-esp32 installation
320
356
if [ $COPY_OUT -eq 1 ] && [ -d " $ESP32_ARDUINO " ]; then
321
357
echo " * Copying to Arduino..."
322
358
./tools/copy-to-arduino.sh
323
359
if [ $? -ne 0 ]; then exit 1; fi
324
360
fi
361
+ AR_VERSION=$( jq -c ' .version' " $AR_COMPS /arduino/package.json" | tr -d ' "' )
362
+ AR_VERSION_UNDERSCORE=` echo " $AR_VERSION " | tr . _`
363
+
364
+
365
+
366
+ # Generate core_version.h
367
+ rm -rf " $AR_ROOT /core_version.h"
368
+ echo " #define ARDUINO_ESP32_GIT_VER 0x$AR_Commit_short
369
+ #define ARDUINO_ESP32_GIT_DESC $AR_VERSION
370
+ #define ARDUINO_ESP32_RELEASE_$AR_VERSION_UNDERSCORE
371
+ #define ARDUINO_ESP32_RELEASE \" $AR_VERSION_UNDERSCORE \" " >> " $AR_ROOT /core_version.h"
325
372
326
373
# push changes to esp32-arduino-libs and create pull request into arduino-esp32
327
374
if [ $DEPLOY_OUT -eq 1 ]; then
0 commit comments