Add basic support for arduino-cli detection #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the most basic of support for the environment created from
downloading the Arduino SDK via the official arduino-cli project.
It fixes two issues encountered with detection:
set(ARDUINO_INSTALL_PATH "$env{LOCALAPPDATA}/Arduino15
is used,it will work, however the make system will loudly complain that it is
unable to read
lib/version.txt
, however generation will succeed.install path hint of the
$env{LOCALAPPDATA}/Arduino15
path and addsbasic detection of
arduino-cli.yaml
which is created from the clisetup process.
The Linux update has been validated using Debian Buser running under
WSL1 and all tools work as far as I can tell, including detection,
build, sizing, and upload.
I do not have a Mac available to test, but I am basing the assumption of
$ENV{HOME}/Library/Arduino15
as the install point since that's in thepackage path as well.
Using the tool, running a command like
arduino-cli core install arduino:samd
will download the tooling, the core, and set up the environment.
Originally I was detecting
arduino-cli.yaml
as the marker file butunder a brand new installation on Linux that file did not exist, but
inventory.yaml
did.I was unable to detect any version information of a matching SDK or
arduino-cli version, so the assumption of the file existing was enough
to trigger the new flow.
Fix registry bug when globbing for sketchbook
The existing code fails on Windows installations as it was checking
HKEY_LOCAL_MACHINE
instead of the user defined/customizedHKEY_CURRENT_USER
as thePersonal
registry value only exists in theuser registry.
Additionally, the
file
command does not seem to resolve the registrydirective, so an additional call to
get_filename_component
was addedto resolve the directory path.
Add support for cli-installed libs without IDE
If a library is installed from the Arduino CLI via
arduino-cli lib install <lib>
on Windows, the default location for the installedlibrary is under
Documents/Arduino/Libraries/<lib>
. When the IDE isnot installed, a preferences file pointing to this location is not
created and is not recognized by the build system.
This attempts to resolve the issue by detecting a missing sketchbook
location and the existance of the
_reg_documents
variable (resolvedwhen setting up package paths) by resolving the location and setting the
appropriate
ARDUINO_SKETCHBOOK_PATH
variable, allowing librarysearches to find libraries installed by the CLI.