This can happen happen in some unlikely cases (such as when renaming a
platform in a way that breaks the "select a board when none is selected
logic").
Even though a board should always be selected, code should still handle
no selected board gracefully (rather than raising a NullPointerException
like this used to do).
See #10887 for the underlying issue that caused no board to be selected.
Previously, the built-in examples assembly step of the build system set the
`final_folder` parameter of the `unzip` target to the true final
installation location of the examples.
The behavior of the `unzip` target is to only unzip the archive if
`final_folder` doesn't exist. Because that folder will exist any time a
previous build has been done and `ant clean` was not run, the archive will
not be unzipped. This causes the build to fail after an update to the
built-in examples version when it attempts to copy the examples from the
version-dependent extraction staging folder to the final location.
The fix is to set the `final_folder` parameter to the version-dependent
staging folder location, which will cause the extraction to happen every
time the examples version is updated, but to be skipped when there was no
update.
A dedicated repository for the examples will make it easier for them to be built in to arbitrary development tools. It will make it easier to use them for compilation testing of boards platforms. It provides a dedicated location for issue reports and pull requests that are specific to the examples. It continues the work done by moving the AVR and SAM boards platforms and built-in libraries towards making the arduino/Arduino repository solely a place to host the GUI code of the Arduino IDE.
Some platforms may not define directly 'build.core' because it may be defined
through a custom menu.
For example, the arduboy platform has in the boards.txt:
[...]
menu.core=Core
[...]
# core #
arduboy-homemade.menu.core.arduboy-core=Arduboy optimized core
arduboy-homemade.menu.core.arduboy-core.build.core=arduboy
arduboy-homemade.menu.core.arduino-core=Standard Arduino core
arduboy-homemade.menu.core.arduino-core.build.core=arduino:arduino
[...]
the build.core is determined only after applying the submenu options.
Previously changing "Category" would filter libraries by the selected
category but without applying the "Type" previously selected.
For instance selecting Type="Installed" and Category="Communication"
will display *all* the libraries belonging to "communication" instead of
the installed only.
This commit fix this behavior.
The filters content is unlikely to change, so just prevent it from live
updating it because it has some side effects:
- it's slow
- it changes the selection back to the default and it's very tricky to
make it re-select the previous selection.
Fixes#10439
Previously rescanLibraries() was automatically called internally in
setLibrariesFolder(). This lead to double calls to rescanLibraries()
when setLibrariesFolder() was used in combination with an explicit
call to rescanLibraries().
This commit adds a new method setLibrariesFoldersAndRescan(..) and
removes the internal call to rescanLibraries() from setLibrariesFolder().
The existing setLibrariesFolder()+rescanLibraries() combos have been
replaced with setLibrariesFoldersAndRescan().
Fix#10228
Previously, any CR without NL was treated just like a NL. For tools that
used single CRs to update a progress bar (such as dfu-util), this would
end up printing the subsequent versions of the progress bar below each
other, instead of updating a single line as intended. Additionally,
since ConsoleOutputStream only scrolled the view on \n, these updates
would end up outside of the main view, making the upload progress quite
unclear.
This commit makes EditorConsole support lone CRs by resetting the insert
position to the start of the current line, so subsequent writes
overwrite existing content. If subsequent lines are shorter than an
earlier line, only part of the earlier line will be overwritten (this
mimics what terminal emulators do).
Previously, the redirection would be triggered in the EditorConsole
constructor. However, this was problematic for unittests, which do not
need this redirection.
Since the redirection really is not useful intul there is a current
EditorConsole anyway, it can just be delayed a bit until
setCurrentEditorConsole is called.