@@ -34,6 +34,13 @@ readonly ARDUINO_CI_SCRIPT_ARDUINO_OUTPUT_FILTER_REGEX='(^\[SocketListener\(trav
34
34
# Default value
35
35
ARDUINO_CI_SCRIPT_TOTAL_SKETCH_BUILD_FAILURE_COUNT=0
36
36
37
+ # Set the arduino command name according to OS (on Windows arduino_debug should be used)
38
+ if [[ " $OSTYPE " == " cygwin" ]] || [[ " $OSTYPE " == " msys" ]]; then
39
+ ARDUINO_CI_SCRIPT_ARDUINO_COMMAND=" arduino_debug"
40
+ else
41
+ ARDUINO_CI_SCRIPT_ARDUINO_COMMAND=" arduino"
42
+ fi
43
+
37
44
38
45
# Create the folder if it doesn't exist
39
46
function create_folder()
@@ -406,11 +413,11 @@ function set_ide_preference()
406
413
local -r unsupportedSavePrefsOptionVersionsRegex=" 1.5.[6-7]"
407
414
if ! [[ " $NEWEST_INSTALLED_IDE_VERSION " =~ $unsupportedSavePrefsOptionVersionsRegex ]]; then
408
415
# shellcheck disable=SC2086
409
- eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /arduino \" --pref " $preferenceString " --save-prefs " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT "
416
+ eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /${ARDUINO_CI_SCRIPT_ARDUINO_COMMAND} \" --pref " $preferenceString " --save-prefs " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT "
410
417
else
411
418
# Arduino IDE 1.5.6 - 1.5.7 load the GUI if you only set preferences without doing a verify. So I am doing an unnecessary verification just to set the preferences in those versions. Definitely a hack but I prefer to keep the preferences setting code all here instead of cluttering build_sketch and this will pretty much never be used.
412
419
# shellcheck disable=SC2086
413
- eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /arduino \" --pref " $preferenceString " --verify " ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT "
420
+ eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /${ARDUINO_CI_SCRIPT_ARDUINO_COMMAND} \" --pref " $preferenceString " --verify " ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT "
414
421
fi
415
422
fi
416
423
}
@@ -511,7 +518,7 @@ function install_package()
511
518
# grep returns 1 when a line matches the regular expression so it's necessary to unset errexit
512
519
set +o errexit
513
520
# shellcheck disable=SC2086
514
- eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /arduino \" --pref boardsmanager.additional.urls=" $packageURL " --save-prefs " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT " | tr -Cd ' [:print:]\n\t' | grep --extended-regexp --invert-match " $ARDUINO_CI_SCRIPT_ARDUINO_OUTPUT_FILTER_REGEX " ; local -r arduinoPreferenceSettingExitStatus=" ${PIPESTATUS[0]} "
521
+ eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /${ARDUINO_CI_SCRIPT_ARDUINO_COMMAND} \" --pref boardsmanager.additional.urls=" $packageURL " --save-prefs " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT " | tr -Cd ' [:print:]\n\t' | grep --extended-regexp --invert-match " $ARDUINO_CI_SCRIPT_ARDUINO_OUTPUT_FILTER_REGEX " ; local -r arduinoPreferenceSettingExitStatus=" ${PIPESTATUS[0]} "
515
522
set -o errexit
516
523
# this is required because otherwise the exit status of arduino is ignored
517
524
if [[ " $arduinoPreferenceSettingExitStatus " != " $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS " ]]; then
@@ -523,7 +530,7 @@ function install_package()
523
530
# grep returns 1 when a line matches the regular expression so it's necessary to unset errexit
524
531
set +o errexit
525
532
# shellcheck disable=SC2086
526
- eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /arduino \" --install-boards " $packageID " " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT " | tr -Cd ' [:print:]\n\t' | grep --extended-regexp --invert-match " $ARDUINO_CI_SCRIPT_ARDUINO_OUTPUT_FILTER_REGEX " ; local -r arduinoInstallPackageExitStatus=" ${PIPESTATUS[0]} "
533
+ eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /${ARDUINO_CI_SCRIPT_ARDUINO_COMMAND} \" --install-boards " $packageID " " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT " | tr -Cd ' [:print:]\n\t' | grep --extended-regexp --invert-match " $ARDUINO_CI_SCRIPT_ARDUINO_OUTPUT_FILTER_REGEX " ; local -r arduinoInstallPackageExitStatus=" ${PIPESTATUS[0]} "
527
534
set -o errexit
528
535
# this is required because otherwise the exit status of arduino is ignored
529
536
if [[ " $arduinoInstallPackageExitStatus " != " $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS " ]]; then
@@ -624,7 +631,7 @@ function install_library()
624
631
625
632
# Install the library
626
633
# shellcheck disable=SC2086
627
- eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /arduino \" --install-library " $libraryName " " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT "
634
+ eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /${ARDUINO_CI_SCRIPT_ARDUINO_COMMAND} \" --install-library " $libraryName " " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT "
628
635
629
636
fi
630
637
fi
@@ -743,7 +750,7 @@ function build_sketch()
743
750
local unsupportedInstallBoardsOptionVersionsRange2regex=" 1.6.[0-3]"
744
751
if ! [[ " $IDEversion " =~ $unsupportedInstallBoardsOptionVersionsRange1regex || " $IDEversion " =~ $unsupportedInstallBoardsOptionVersionsRange2regex ]]; then
745
752
# shellcheck disable=SC2086
746
- eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /arduino \" --install-boards arduino:dummy " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT "
753
+ eval \" ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /${ARDUINO_CI_SCRIPT_ARDUINO_COMMAND} \" --install-boards arduino:dummy " $ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT "
747
754
if [[ " $ARDUINO_CI_SCRIPT_VERBOSITY_LEVEL " -gt 1 ]]; then
748
755
# The warning is printed to stdout
749
756
echo " NOTE: The warning above \" Selected board is not available\" is caused intentionally and does not indicate a problem."
@@ -820,7 +827,7 @@ function build_this_sketch()
820
827
while [[ $arduinoExitStatus -gt $ARDUINO_CI_SCRIPT_HIGHEST_ACCEPTABLE_ARDUINO_EXIT_STATUS && $verifyCount -le $ARDUINO_CI_SCRIPT_SKETCH_VERIFY_RETRIES ]]; do
821
828
# Verify the sketch
822
829
# shellcheck disable=SC2086
823
- " ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /arduino " $ARDUINO_CI_SCRIPT_DETERMINED_VERBOSE_BUILD --verify " $absoluteSketchName " --board " $boardID " 2>&1 | tr -Cd ' [:print:]\n\t' | grep --extended-regexp --invert-match " $ARDUINO_CI_SCRIPT_ARDUINO_OUTPUT_FILTER_REGEX " | tee " $ARDUINO_CI_SCRIPT_VERIFICATION_OUTPUT_FILENAME " ; local arduinoExitStatus=" ${PIPESTATUS[0]} "
830
+ " ${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER} /${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER} /${ARDUINO_CI_SCRIPT_ARDUINO_COMMAND} " $ARDUINO_CI_SCRIPT_DETERMINED_VERBOSE_BUILD --verify " $absoluteSketchName " --board " $boardID " 2>&1 | tr -Cd ' [:print:]\n\t' | grep --extended-regexp --invert-match " $ARDUINO_CI_SCRIPT_ARDUINO_OUTPUT_FILTER_REGEX " | tee " $ARDUINO_CI_SCRIPT_VERIFICATION_OUTPUT_FILENAME " ; local arduinoExitStatus=" ${PIPESTATUS[0]} "
824
831
local verifyCount=$(( verifyCount + 1 ))
825
832
done
826
833
0 commit comments