Actions

EmSys

Using Visual Studio Code for ARM Development – Build Tasks

From EdWiki

Revision as of 08:37, 27 December 2019 by Jshankar (Talk | contribs) (Created page with "__NOTOC__ == Using Visual Studio Code for ARM Development – Build Tasks == It isn’t strictly necessary to use [https://code.visualstudio.com/ Visual Studio Code] to build...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Using Visual Studio Code for ARM Development – Build Tasks

It isn’t strictly necessary to use Visual Studio Code to build your code. We can still drop to the command line and build it more directly. However, it is handy to be able to build with a shortcut key or not have to manage another window.

For example code, If we have a Makefile that we use with “make all” as the default target, and “make clean” to delete everything.

We can set up custom tasks within VSCode that can execute any shell command, even specifying which shell to use. There is a special “Default Build” task.

To start, select the “Terminal” menu, then “Configure Tasks”. If this is the first time, it will ask for a type – select “Make”; VSCode will create the .vscode/tasks.json file for us. Copy the following code and save it.


{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "Make",
			"type": "shell",
			"command": "make",
			"presentation": {
				"echo": true,
				"reveal": "always",
				"focus": false,
				"panel": "shared"
			},
			"group": {
				"kind": "build",
				"isDefault": true
			}
		},
		{
			"label": "Make Clean",
			"type": "shell",
			"command": "make clean",
			"presentation": {
				"echo": true,
				"reveal": "always",
				"focus": false,
				"panel": "shared"
			},
			"group": "build"
		}
	]
}