PlatformIO Community

PlatformIO&VSCode: How to select the project to be build


Look at these two projects below, but I don’t know how to select the “arduino-blink” project in order to build and upload it. Every time I build, whatever I do, it builds always the first project. So this is my question, how to select a project to be the main project ?



VSCode sees on the active opened file. For example, if your last opened file was from “arduino-blink”, this project will be used.


So there is no option in configuration file to select the project to run except closing the other project, isn’t it ?


Do you mean ?


That link doesn’t really address the OP’s question. At least, as a newcomer to Platform IO, I could not figure out how to choose which project to compile in a multiproject workspace. Does one need to create a new Task?


If you have a bunch of project roots in your project workspace… like so (where each of those is a self-contained project) …


… all you need to do is expand (click on) the one you want to work on/build, and open the main source file (or any file in that project, really, even the platformio.ini) … and it will become the active project, so that when you hit build down the bottom, or hit the platformio alien head in the sidebar, the options will be for that project. If you have files from multiple projects open, the ‘active’ project will follow which tab you have open.

Basically, the currently open tab determines the active project to be build / uploaded / etc.


Thank you. That helps a lot!