PlatformIO Community

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


#1

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 ?

image


#2

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


#3

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


#4

Do you mean http://docs.platformio.org/en/latest/ide/vscode.html#multi-project-workspaces ?


#5

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?


#6

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

image

… 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.


#7

Thank you. That helps a lot!