Skip to content

Commit cbc6586

Browse files
committed
check_library_structure: Note implications of stray sketches for Web Editor in error messages
Unlike the Arduino IDE, the Arduino Web Editor requires that all sketches bundled with a library be under the examples folder. If a library contains a sketch anywhere else, it can not be imported in the Arduino Web Editor. The sketches outside the examples folder will not be accessible as examples for the pre-installed libraries of the Library Manager index. I already have checks for stray sketches and misspelled examples folder name in check_library_structure, but their error messages didn't previously note the more serious implications of this for Arduino Web Editor.
1 parent e3c7a18 commit cbc6586

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arduino-ci-script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ function check_library_structure() {
14401440

14411441
# Check for incorrect spelling of examples folder
14421442
if [[ $(find "$normalizedLibraryPath" -maxdepth 1 -type d -and -iregex '^.*/examples?$') && ! $(find "$normalizedLibraryPath" -maxdepth 1 -type d -and -name 'examples') ]]; then
1443-
echo "ERROR: ${normalizedLibraryPath}: Incorrect examples folder name. It should be spelled exactly \"examples\". See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#library-examples"
1443+
echo "ERROR: ${normalizedLibraryPath}: Incorrect examples folder name. It should be spelled exactly \"examples\". Incorrect examples folder name will cause importing the library to Arduino Web Editor to fail and examples to not be available in Arduino Web Editor for Library Manager libraries. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#library-examples"
14441444
exitStatus=$(set_exit_status "$exitStatus" $ARDUINO_CI_SCRIPT_CHECK_LIBRARY_STRUCTURE_INCORRECT_EXAMPLES_FOLDER_NAME_EXIT_STATUS)
14451445
fi
14461446

@@ -1488,7 +1488,7 @@ function check_library_structure() {
14881488

14891489
# Check for sketch files outside of the src or extras folders
14901490
if [[ $(find "$normalizedLibraryPath" -maxdepth 1 -path './examples' -prune -or -path './extras' -prune -or \( -type f -and \( -iname '*.ino' -or -iname '*.pde' \) \)) ]]; then
1491-
echo "ERROR: ${normalizedLibraryPath}: Sketch files found outside the examples and extras folders."
1491+
echo "ERROR: ${normalizedLibraryPath}: Sketch files found outside the examples and extras folders. Sketches outside the examples folder will cause importing the library to Arduino Web Editor to fail."
14921492
exitStatus=$(set_exit_status "$exitStatus" $ARDUINO_CI_SCRIPT_CHECK_LIBRARY_STRUCTURE_STRAY_SKETCH_EXIT_STATUS)
14931493
fi
14941494

0 commit comments

Comments
 (0)