From 1e57c6e6e36ed07cd02df55c9dd34d49c17c2f5c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Sep 2019 02:55:57 -0500 Subject: [PATCH] AutoBuild tweaks --- .../share/vscode/AutoBuildMarlin/README.md | 8 +-- .../share/vscode/AutoBuildMarlin/extension.js | 30 ++++---- .../share/vscode/AutoBuildMarlin/package.json | 68 +++++++++++-------- 3 files changed, 57 insertions(+), 49 deletions(-) diff --git a/buildroot/share/vscode/AutoBuildMarlin/README.md b/buildroot/share/vscode/AutoBuildMarlin/README.md index 24123db9db..bb2080d564 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/README.md +++ b/buildroot/share/vscode/AutoBuildMarlin/README.md @@ -34,7 +34,7 @@ Before you install AutoBuildMarlin you'll first need to [Install PlatformIO in V Icon|Action ----|------ - ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png)|Start **PIO Build** to test your Marlin build - ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png)|Start **PIO Clean** to delete old build files - ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png)|Start **PIO Upload** to install Marlin on your board - ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png)|Start **PIO Upload (traceback)** to install Marlin with debugging + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png)|Start **Marlin Build** to test your Marlin build + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png)|Start **Marlin Upload** to install Marlin on your board + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png)|Start **Marlin Upload (traceback)** to install Marlin with debugging + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png)|Start **Marlin Clean** to delete old build files diff --git a/buildroot/share/vscode/AutoBuildMarlin/extension.js b/buildroot/share/vscode/AutoBuildMarlin/extension.js index 01198a62bb..15b0b121e3 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/extension.js +++ b/buildroot/share/vscode/AutoBuildMarlin/extension.js @@ -7,34 +7,34 @@ function activate(context) { console.log('Extension "AutoBuildMarlin" is now active!'); var NEXT_TERM_ID = 1; - var pio_build = vscode.commands.registerCommand('piobuild', function () { + var mf_build = vscode.commands.registerCommand('mfbuild', function () { vscode.commands.executeCommand('workbench.action.files.saveAll'); - const terminal = vscode.window.createTerminal(`AB Build #${NEXT_TERM_ID++}`); + const terminal = vscode.window.createTerminal(`Marlin Build #${NEXT_TERM_ID++}`); terminal.show(true); terminal.sendText("python buildroot/share/atom/auto_build.py build"); }); - var pio_clean = vscode.commands.registerCommand('pioclean', function () { - const terminal = vscode.window.createTerminal(`AB Clean #${NEXT_TERM_ID++}`); - terminal.show(true); - terminal.sendText("python buildroot/share/atom/auto_build.py clean"); - }); - var pio_upload = vscode.commands.registerCommand('pioupload', function () { + var mf_upload = vscode.commands.registerCommand('mfupload', function () { vscode.commands.executeCommand('workbench.action.files.saveAll'); - const terminal = vscode.window.createTerminal(`AB Upload #${NEXT_TERM_ID++}`); + const terminal = vscode.window.createTerminal(`Marlin Upload #${NEXT_TERM_ID++}`); terminal.show(true); terminal.sendText("python buildroot/share/atom/auto_build.py upload"); }); - var pio_traceback = vscode.commands.registerCommand('piotraceback', function () { + var mf_traceback = vscode.commands.registerCommand('mftraceback', function () { vscode.commands.executeCommand('workbench.action.files.saveAll'); - const terminal = vscode.window.createTerminal(`AB Traceback #${NEXT_TERM_ID++}`); + const terminal = vscode.window.createTerminal(`Marlin Traceback #${NEXT_TERM_ID++}`); terminal.show(true); terminal.sendText("python buildroot/share/atom/auto_build.py traceback"); }); + var mf_clean = vscode.commands.registerCommand('mfclean', function () { + const terminal = vscode.window.createTerminal(`Marlin Clean #${NEXT_TERM_ID++}`); + terminal.show(true); + terminal.sendText("python buildroot/share/atom/auto_build.py clean"); + }); - context.subscriptions.push(pio_build); - context.subscriptions.push(pio_clean); - context.subscriptions.push(pio_upload); - context.subscriptions.push(pio_traceback); + context.subscriptions.push(mf_build); + context.subscriptions.push(mf_upload); + context.subscriptions.push(mf_traceback); + context.subscriptions.push(mf_clean); } exports.activate = activate; diff --git a/buildroot/share/vscode/AutoBuildMarlin/package.json b/buildroot/share/vscode/AutoBuildMarlin/package.json index ac30b225e3..9c00085a06 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/package.json +++ b/buildroot/share/vscode/AutoBuildMarlin/package.json @@ -6,65 +6,69 @@ "publisher": "marlinfirmware", "icon": "logo.svg", "engines": { - "vscode": "^1.23.0" + "vscode": "^1.32.0" }, "enableProposedApi": true, "categories": [ "Other" ], "activationEvents": [ - "onCommand:piobuild", - "onCommand:pioclean", - "onCommand:pioupload", - "onCommand:piotraceback" + "onCommand:mfbuild", + "onCommand:mfclean", + "onCommand:mfupload", + "onCommand:mftraceback" ], "main": "./extension", "contributes": { "viewsContainers": { "activitybar": [ { - "id": "auto-build", - "title": "Auto Build Marlin", + "id": "autoBuildVC", + "title": "Marlin Build", "icon": "resources/AB.svg" } ] }, "views": { - "auto-build": [ + "autoBuildVC": [ { - "id": "autobuild", - "name": " " + "id": "autoBuildView", + "name": "Build…" + }, + { + "id": "marlinView", + "name": "Marlin Info" } ] }, "commands": [ { - "command": "piobuild", - "title": "PIO Build", + "command": "mfbuild", + "title": "Build", "icon": { "light": "resources/B48x48_light.svg", "dark": "resources/B48x48_dark.svg" } }, { - "command": "pioupload", - "title": "PIO Upload", + "command": "mfupload", + "title": "Upload", "icon": { "light": "resources/U48x48_light.svg", "dark": "resources/U48x48_dark.svg" } }, { - "command": "piotraceback", - "title": "PIO Upload (traceback)", + "command": "mftraceback", + "title": "Upload (traceback)", "icon": { "light": "resources/T48x48_light.svg", "dark": "resources/T48x48_dark.svg" } }, { - "command": "pioclean", - "title": "PIO Clean", + "command": "mfclean", + "title": "Clean", "icon": { "light": "resources/C48x48_light.svg", "dark": "resources/C48x48_dark.svg" @@ -74,20 +78,24 @@ "menus": { "view/title": [ { - "command": "piobuild", - "group": "navigation@1" + "command": "mfbuild", + "group": "navigation@1", + "when": "view == autoBuildView || view == marlinView" }, { - "command": "pioupload", - "group": "navigation@2" + "command": "mfupload", + "group": "navigation@2", + "when": "view == autoBuildView || view == marlinView" }, { - "command": "piotraceback", - "group": "navigation@3" + "command": "mftraceback", + "group": "navigation@3", + "when": "view == autoBuildView || view == marlinView" }, { - "command": "pioclean", - "group": "navigation@4" + "command": "mfclean", + "group": "navigation@4", + "when": "view == autoBuildView || view == marlinView" } ] } @@ -100,10 +108,10 @@ "test": "npm run compile && node ./node_modules/vscode/bin/test" }, "devDependencies": { - "vscode": "^1.1.17", - "typescript": "^2.6.1", - "tslint": "^5.8.0", - "@types/node": "^7.0.43", + "@types/vscode": "^1.34.0", + "typescript": "^3.5.1", + "tslint": "^5.16.0", + "@types/node": "^10.14.17", "@types/mocha": "^2.2.42" } }