Warning when verifying sketch with VS code
Thanks to @Majenko I looked some place new:
documented in the arduino plugin of VS Code Arduino Extension there is an option to set an output directory.
Note though that according to this it should not be in the workspace or subfolders.
So in arduino.json settings file add:
"output": "../ArduinoOutput"
To clarify the answer, for those new in arduino world +StudioCode (source: https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino )
The following settings are as per sketch settings of the Arduino extension. You can find them in .vscode/arduino.json under the workspace.
{
"sketch": "example.ino",
"port": "COM5",
"board": "adafruit:samd:adafruit_feather_m0",
"output": "../build",
"debugger": "jlink",
"prebuild": "bash prebuild.sh"
}
sketch - The main sketch file name of Arduino.
port - Name of the serial port connected to the device. Can be set by the Arduino: Select Serial Port command.
board - Currently selected Arduino board alias. Can be set by the Arduino: Change Board Type command. Also, you can find the board list there.
output - Arduino build output path. If not set, Arduino will create a new temporary output folder each time, which means it cannot reuse the intermediate result of the previous build leading to long verify/upload time, so it is recommended to set the field. Arduino requires that the output path should not be the workspace itself or in a subfolder of the workspace, otherwise, it may not work correctly. By default, this option is not set.
debugger - The short name of the debugger that will be used when the board itself does not have a debugger and there is more than one debugger available. You can find the list of debuggers here. By default, this option is not set.
prebuild - External command before building the sketch file. You should only set one prebuild command. command1 && command2 does not work. If you need to run multiple commands before the build, then create a script.
When You add folder with sketch, you are creating "so called" project. VS code puts there some hidden folders with the project configuration files. To see them from windows file explorer you may enable show hidden files. than in your project folder You may find .vscode , and there is the arduino.json file.
More simple way is just click on the project navigation bar on the left, and open there the .vscode folder and using vscode as editor just add
"output": "../ArduinoOutput" or "output": "../build" or whatever you want to name that folder.
".." tells that it is one level above the "project folder" so it is "outside" as VScode wants.
And as far as i know this is not global setting, so You need to set it for every project if you want it.
Check the proper formatting in order to save file, use code hints to add options in file.
Hope that this is as clear as possible and help others to find that magic arduino.json file and understand where what and why.
Cheers.