@@ -154,8 +154,20 @@ function build_platform()
154
154
# grab all pde and ino example sketches
155
155
declare -a examples
156
156
157
- # loop through results and add them to the array
158
- examples=($( find $PWD -name " *.pde" -o -name " *.ino" ) )
157
+ if [ " $PLATFORM_CHECK_ONLY_ON_FILE " = true ]; then
158
+ # loop through results and add them to the array
159
+ examples=($(
160
+ for f in $( find . -type f -iname ' *.ino' -o -iname ' *.pde' ) ; do
161
+ # TODO: distinguish platforms
162
+ if [ -e " $( dirname $f ) /.$platform_key .test" ]; then
163
+ echo " $f "
164
+ fi
165
+ done
166
+ ) )
167
+ else
168
+ # loop through results and add them to the array
169
+ examples=($( find $PWD -name " *.pde" -o -name " *.ino" ) )
170
+ fi
159
171
160
172
# get the last example in the array
161
173
local last=" ${examples[@]: (-1)} "
@@ -336,7 +348,7 @@ function build_platform()
336
348
337
349
}
338
350
339
- # build all examples for every platform in $main_platforms
351
+ # build all examples for every platform in $MAIN_PLATFORMS
340
352
function build_main_platforms()
341
353
{
342
354
@@ -385,6 +397,54 @@ function build_main_platforms()
385
397
386
398
}
387
399
400
+ # build all examples for every platform in $AUX_PLATFORMS
401
+ function build_aux_platforms()
402
+ {
403
+
404
+ # arrays can't be exported, so we have to eval
405
+ eval $AUX_PLATFORMS
406
+
407
+ # track the build status all platforms
408
+ local exit_code=0
409
+
410
+ # var to hold platforms
411
+ local platforms_json=" "
412
+
413
+ # get the last element in the array
414
+ local last=" ${aux_platforms[@]: (-1)} "
415
+
416
+ # loop through platforms in main platforms assoc array
417
+ for p_key in " ${! aux_platforms[@]} " ; do
418
+
419
+ # is this the last platform in the loop
420
+ local last_platform=0
421
+ if [ " $last " == " ${aux_platforms[$p_key]} " ]; then
422
+ last_platform=1
423
+ fi
424
+
425
+ # build all examples for this platform
426
+ build_platform $p_key
427
+
428
+ # check if build failed
429
+ if [ $? -ne 0 ]; then
430
+ platforms_json=" ${platforms_json} $( json_platform $p_key 0 " $PLATFORM_JSON " $last_platform ) "
431
+ exit_code=1
432
+ else
433
+ platforms_json=" ${platforms_json} $( json_platform $p_key 1 " $PLATFORM_JSON " $last_platform ) "
434
+ fi
435
+
436
+ done
437
+
438
+ # exit code is opposite of json build status
439
+ if [ $exit_code -eq 0 ]; then
440
+ json_main_platforms 1 " $platforms_json "
441
+ else
442
+ json_main_platforms 0 " $platforms_json "
443
+ fi
444
+
445
+ return $exit_code
446
+
447
+ }
388
448
function build_cplay_platforms()
389
449
{
390
450
0 commit comments