From this platformio post I have learned that I can create a separate env for each of my libraries’ examples in order to have a shortcut for testing them (alternatively to using the pio ci
command). Now, of course I want all of these “example” envs to be copies of [env]. But I also want [env] to be the default env, so I can press the Build button in VSCode (the check mark) and it only builds for [env]. But now my question is, how can I list [env] in the default_envs
?
As far as I know I have to give it a name, like [env:due]
, but then my “example” envs don’t copy the due env anymore.
How can I solve this?
Here is my platformio.ini
file:
[platformio]
;default_envs = ?
[env]
platform = atmelsam
board = due
framework = arduino
test_framework = unity
lib_deps =
Wire
SPI
adafruit/Adafruit ADS1X15@^2.4.0
adafruit/Adafruit MCP23017 Arduino Library@^2.3.0
adafruit/Adafruit BusIO@^1.14.1
; envs for running library examples
[env:example1]
build_src_filter = +<../lib/mylib/examples/example1/example1.cpp>
[env:example2]
build_src_filter = +<../lib/mylib/examples/example2/example2.cpp>
Like this, the build button builds all the envs.