From ee3eca20d3dc071d8588888cdc6c9f41f7546387 Mon Sep 17 00:00:00 2001 From: "Christopher J. McClellan" Date: Fri, 7 Feb 2020 19:22:11 -0500 Subject: [PATCH] Add vscode build tasks for examples and release --- .vscode/launch.json | 4 ++-- .vscode/tasks.json | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index d38b321..b554e31 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,7 @@ "name": "Debug (QEMU)", "servertype": "qemu", "cwd": "${workspaceRoot}", - "preLaunchTask": "build", + "preLaunchTask": "cargo build", "runToMain": true, "executable": "./target/thumbv7m-none-eabi/debug/{{project-name}}", /* Run `cargo build --example hello` and uncomment this line to run semi-hosting example */ @@ -27,7 +27,7 @@ "name": "Debug (OpenOCD)", "servertype": "openocd", "cwd": "${workspaceRoot}", - "preLaunchTask": "build", + "preLaunchTask": "cargo build", "runToMain": true, "executable": "./target/thumbv7em-none-eabihf/debug/{{project-name}}", /* Run `cargo build --example itm` and uncomment this line to run itm example */ diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1331bc0..b427041 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -9,7 +9,7 @@ * but we need to provide a label for it, * so we can invoke it from the debug launcher. */ - "label": "build", + "label": "cargo build", "type": "cargo", "subcommand": "build", "problemMatcher": [ @@ -20,5 +20,41 @@ "isDefault": true } }, + { + "label": "cargo build --release", + "type": "process", + "command": "cargo", + "args": ["build", "--release"], + "problemMatcher": [ + "$rustc" + ], + "group": "build" + }, + { + "label": "cargo build --examples", + "type": "process", + "command": "cargo", + "args": ["build","--examples"], + "problemMatcher": [ + "$rustc" + ], + "group": "build" + }, + { + "label": "cargo build --examples --release", + "type": "process", + "command": "cargo", + "args": ["build","--examples", "--release"], + "problemMatcher": [ + "$rustc" + ], + "group": "build" + }, + { + "label": "cargo clean", + "type": "cargo", + "subcommand": "clean", + "group": "build" + }, ] } \ No newline at end of file