Skip to content

Commit dda10fd

Browse files
committed
feat: update build
1 parent b45d231 commit dda10fd

File tree

6 files changed

+25
-40
lines changed

6 files changed

+25
-40
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
# ESP32 Arduino Lib Builder [![ESP32 Arduino Libs CI](https://github.com/espressif/esp32-arduino-lib-builder/actions/workflows/push.yml/badge.svg)](https://github.com/espressif/esp32-arduino-lib-builder/actions/workflows/push.yml)
1+
# ESP32 Arduino Lib Builder
22

33
This repository contains the scripts that produce the libraries included with esp32-arduino.
44

55
Tested on Ubuntu (32 and 64 bit), Raspberry Pi and MacOS.
66

77
### Build on Ubuntu and Raspberry Pi
8-
```bash
9-
git clone -b release/v2.0.13 https://github.com/esp-arduino-libs/esp32-arduino-lib-builder.git
10-
cd esp32-arduino-lib-builder
118

9+
```bash
1210
// Build all targets
1311
./build.sh
1412

build.sh

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ TARGET="all"
1414
BUILD_TYPE="all"
1515
SKIP_ENV=0
1616
COPY_OUT=0
17+
ARCHIVE_OUT=0
1718
if [ -z $DEPLOY_OUT ]; then
1819
DEPLOY_OUT=0
1920
fi
@@ -24,6 +25,7 @@ function print_help() {
2425
echo " -A Set which branch of arduino-esp32 to be used for compilation"
2526
echo " -I Set which branch of ESP-IDF to be used for compilation"
2627
echo " -i Set which commit of ESP-IDF to be used for compilation"
28+
echo " -e Archive the build to dist"
2729
echo " -d Deploy the build to github arduino-esp32"
2830
echo " -c Set the arduino-esp32 folder to copy the result to. ex. '$HOME/Arduino/hardware/espressif/esp32'"
2931
echo " -t Set the build target(chip). ex. 'esp32s3'"
@@ -32,14 +34,17 @@ function print_help() {
3234
exit 1
3335
}
3436

35-
while getopts ":A:I:i:c:t:b:sd" opt; do
37+
while getopts ":A:I:i:c:t:b:sde" opt; do
3638
case ${opt} in
3739
s )
3840
SKIP_ENV=1
3941
;;
4042
d )
4143
DEPLOY_OUT=1
4244
;;
45+
e )
46+
ARCHIVE_OUT=1
47+
;;
4348
c )
4449
export ESP32_ARDUINO="$OPTARG"
4550
COPY_OUT=1
@@ -58,10 +63,10 @@ while getopts ":A:I:i:c:t:b:sd" opt; do
5863
;;
5964
b )
6065
b=$OPTARG
61-
if [ "$b" != "build" ] &&
62-
[ "$b" != "menuconfig" ] &&
63-
[ "$b" != "idf_libs" ] &&
64-
[ "$b" != "copy_bootloader" ] &&
66+
if [ "$b" != "build" ] &&
67+
[ "$b" != "menuconfig" ] &&
68+
[ "$b" != "idf_libs" ] &&
69+
[ "$b" != "copy_bootloader" ] &&
6570
[ "$b" != "mem_variant" ]; then
6671
print_help
6772
fi
@@ -80,6 +85,8 @@ done
8085
shift $((OPTIND -1))
8186
CONFIGS=$@
8287

88+
source ./tools/config.sh
89+
8390
if [ $SKIP_ENV -eq 0 ]; then
8491
echo "* Installing/Updating ESP-IDF and all components..."
8592
# update components from git
@@ -89,8 +96,6 @@ if [ $SKIP_ENV -eq 0 ]; then
8996
# install esp-idf
9097
source ./tools/install-esp-idf.sh
9198
if [ $? -ne 0 ]; then exit 1; fi
92-
else
93-
source ./tools/config.sh
9499
fi
95100

96101
if [ "$BUILD_TYPE" != "all" ]; then
@@ -99,7 +104,7 @@ if [ "$BUILD_TYPE" != "all" ]; then
99104
print_help
100105
fi
101106
configs="configs/defconfig.common;configs/defconfig.$TARGET"
102-
107+
103108
# Target Features Configs
104109
for target_json in `jq -c '.targets[]' configs/builds.json`; do
105110
target=$(echo "$target_json" | jq -c '.target' | tr -d '"')
@@ -196,16 +201,7 @@ if [ "$BUILD_TYPE" = "all" ]; then
196201
fi
197202

198203
# archive the build
199-
if [ "$BUILD_TYPE" = "all" ]; then
200-
./tools/archive-build.sh
204+
if [ $ARCHIVE_OUT -eq 1 ]; then
205+
./tools/archive-build.sh "$TARGET"
201206
if [ $? -ne 0 ]; then exit 1; fi
202207
fi
203-
204-
# copy everything to arduino-esp32 installation
205-
if [ $COPY_OUT -eq 1 ] && [ -d "$ESP32_ARDUINO" ]; then
206-
./tools/copy-to-arduino.sh
207-
fi
208-
209-
if [ $DEPLOY_OUT -eq 1 ]; then
210-
./tools/push-to-arduino.sh
211-
fi

tools/archive-build.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
#!/bin/bash
22

3-
IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD || echo "")
4-
IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD || echo "")
3+
source ./tools/config.sh
54

65
idf_version_string=${IDF_BRANCH//\//_}"-$IDF_COMMIT"
7-
archive_path="dist/arduino-esp32-libs-$idf_version_string.tar.gz"
8-
build_archive_path="dist/arduino-esp32-build-$idf_version_string.tar.gz"
96

10-
mkdir -p dist && rm -rf "$archive_path" "$build_archive_path"
7+
archive_path="dist/arduino-esp32-libs-$1-$idf_version_string.tar.gz"
8+
9+
mkdir -p dist && rm -rf "$archive_path"
1110
if [ -d "out" ]; then
1211
cd out && tar zcf "../$archive_path" * && cd ..
1312
fi
14-
if [ -d "build" ]; then
15-
cd build && tar zcf "../$build_archive_path" * && cd ..
16-
fi

tools/config.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#!/bin/bash
22

3+
export IDF_BRANCH="release/v4.4"
4+
export IDF_COMMIT="ac5d805d0e"
35

46
if [ -z $IDF_PATH ]; then
57
export IDF_PATH="$PWD/esp-idf"
68
fi
79

8-
if [ -z $IDF_BRANCH ]; then
9-
IDF_BRANCH="release/v4.4"
10-
fi
11-
1210
if [ -z $AR_PR_TARGET_BRANCH ]; then
1311
AR_PR_TARGET_BRANCH="release/v2.x"
1412
fi

tools/current_commit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
IDF_COMMIT=$(wget -q -O- "https://github.com/espressif/arduino-esp32/search?q=update+idf&type=Commits" | grep -i "update idf" | grep -e "to [0-9a-f]*" | sed "s/^.*to \([0-9a-f]*\).*/\1/" | head -1)
1+
source ./tools/config.sh
2+
23
echo Current commit is $IDF_COMMIT

tools/install-esp-idf.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
source ./tools/config.sh
44

5-
IDF_COMMIT="ac5d805d0e"
6-
75
if ! [ -x "$(command -v $SED)" ]; then
86
echo "ERROR: $SED is not installed! Please install $SED first."
97
exit 1
@@ -39,8 +37,6 @@ fi
3937
#
4038

4139
source $IDF_PATH/export.sh
42-
export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD)
43-
export IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)
4440

4541
#
4642
# SETUP ARDUINO DEPLOY

0 commit comments

Comments
 (0)