Easily building code from examples dir

Hi,

Still finding my way in platformio. I’m trying to work from a local github repository that has for example the following common tree setup:

|-- examples
| |-- example1
| | |-- example1.cpp
| |-- example2
| | |-- example2.cpp
|-- src
| |- library.h
| |- library.cpp
|- platformio.ini

My objective is setup platformio.ini in such a way that I can easily build (and upload) either example1.cpp or example2.cpp. I tried with src_dir and/or src_filter, but without success so far. When I temporarily move example1.cpp to the src dir everything works perfectly, but then I have to remember to move this file back every time before committing to github.

How can I accomplish this following platformio best practices?

Thanks, Dennis

1 Like

Nobody here with that knowledge? Cannot find this in the manuals as well.

Do you mean this Redirecting... ?