@@ -6,6 +6,7 @@ PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git"
6
6
TOOLCHAIN_VERSION=" 12.2.0+20230208"
7
7
ESPTOOLPY_VERSION=" ~1.40501.0"
8
8
ESPRESSIF_ORGANIZATION_NAME=" espressif"
9
+ LIBS_DIR=" tools/esp32-arduino-libs"
9
10
10
11
echo " Installing Python Wheel ..."
11
12
pip install wheel > /dev/null 2>&1
@@ -88,12 +89,25 @@ function count_sketches(){ # count_sketches <examples-path>
88
89
local sketchname=$( basename $sketch )
89
90
if [[ " ${sketchdirname} .ino" != " $sketchname " ]]; then
90
91
continue
92
+ elif [ -f $sketchdir /ci.json ]; then
93
+ # If the target is listed as false, skip the sketch. Otherwise, include it.
94
+ is_target=$( jq -r ' .targets[esp32]' $sketchdir /ci.json)
95
+ if [[ " $is_target " == " false" ]]; then
96
+ continue
97
+ fi
98
+
99
+ # Check if the sketch requires any configuration options
100
+ requirements=$( jq -r ' .requires[]' $sketchdir /ci.json)
101
+ if [[ " $requirements " != " null" ]] || [[ " $requirements " != " " ]]; then
102
+ for requirement in $requirements ; do
103
+ found_line=$( grep " $requirement " $LIBS_DIR /esp32/sdkconfig)
104
+ if [[ " $found_line " == " " ]]; then
105
+ continue 2
106
+ fi
107
+ done
108
+ fi
91
109
fi
92
- is_target=$( jq -r --arg target $target ' .targets[$target]' $sketchdir /ci.json)
93
- # If the target is listed as false, skip the sketch. Otherwise, include it.
94
- if [[ " $is_target " == " false" ]]; then
95
- continue
96
- fi
110
+
97
111
echo $sketch >> sketches.txt
98
112
sketchnum=$(( $sketchnum + 1 ))
99
113
done
@@ -163,12 +177,27 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
163
177
local sketchdir=$( dirname $sketch )
164
178
local sketchdirname=$( basename $sketchdir )
165
179
local sketchname=$( basename $sketch )
166
- is_target=$( jq -r --arg target $target ' .targets[$target]' $sketchdir /ci.json)
167
- # If the target is listed as false, skip the sketch. Otherwise, include it.
168
- if [ " ${sketchdirname} .ino" != " $sketchname " ] \
169
- || [[ " $is_target " == " false" ]]; then
180
+ if [[ " $sketchdirname .ino" != " $sketchname " ]]; then
170
181
continue
182
+ elif [ -f $sketchdir /ci.json ]; then
183
+ # If the target is listed as false, skip the sketch. Otherwise, include it.
184
+ is_target=$( jq -r ' .targets[esp32]' $sketchdir /ci.json)
185
+ if [[ " $is_target " == " false" ]]; then
186
+ continue
187
+ fi
188
+
189
+ # Check if the sketch requires any configuration options
190
+ requirements=$( jq -r ' .requires[]' $sketchdir /ci.json)
191
+ if [[ " $requirements " != " null" ]] || [[ " $requirements " != " " ]]; then
192
+ for requirement in $requirements ; do
193
+ found_line=$( grep " $requirement " $LIBS_DIR /esp32/sdkconfig)
194
+ if [[ " $found_line " == " " ]]; then
195
+ continue 2
196
+ fi
197
+ done
198
+ fi
171
199
fi
200
+
172
201
sketchnum=$(( $sketchnum + 1 ))
173
202
if [ " $sketchnum " -le " $start_index " ] \
174
203
|| [ " $sketchnum " -gt " $end_index " ]; then
0 commit comments