2018-06-14 01:49:47 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var vscode = require('vscode');
|
|
|
|
|
|
|
|
function activate(context) {
|
|
|
|
|
|
|
|
console.log('Extension "AutoBuildMarlin" is now active!');
|
|
|
|
|
|
|
|
var NEXT_TERM_ID = 1;
|
2019-09-30 09:55:57 +02:00
|
|
|
var mf_build = vscode.commands.registerCommand('mfbuild', function () {
|
2019-04-12 19:33:16 +02:00
|
|
|
vscode.commands.executeCommand('workbench.action.files.saveAll');
|
2019-09-30 09:55:57 +02:00
|
|
|
const terminal = vscode.window.createTerminal(`Marlin Build #${NEXT_TERM_ID++}`);
|
2019-04-09 06:07:57 +02:00
|
|
|
terminal.show(true);
|
2018-06-14 01:49:47 +02:00
|
|
|
terminal.sendText("python buildroot/share/atom/auto_build.py build");
|
|
|
|
});
|
2019-09-30 09:55:57 +02:00
|
|
|
var mf_upload = vscode.commands.registerCommand('mfupload', function () {
|
2019-04-12 19:33:16 +02:00
|
|
|
vscode.commands.executeCommand('workbench.action.files.saveAll');
|
2019-09-30 09:55:57 +02:00
|
|
|
const terminal = vscode.window.createTerminal(`Marlin Upload #${NEXT_TERM_ID++}`);
|
2019-04-09 06:07:57 +02:00
|
|
|
terminal.show(true);
|
2018-06-14 01:49:47 +02:00
|
|
|
terminal.sendText("python buildroot/share/atom/auto_build.py upload");
|
|
|
|
});
|
2019-09-30 09:55:57 +02:00
|
|
|
var mf_traceback = vscode.commands.registerCommand('mftraceback', function () {
|
2019-04-12 19:33:16 +02:00
|
|
|
vscode.commands.executeCommand('workbench.action.files.saveAll');
|
2019-09-30 09:55:57 +02:00
|
|
|
const terminal = vscode.window.createTerminal(`Marlin Traceback #${NEXT_TERM_ID++}`);
|
2019-04-09 06:07:57 +02:00
|
|
|
terminal.show(true);
|
2018-06-14 01:49:47 +02:00
|
|
|
terminal.sendText("python buildroot/share/atom/auto_build.py traceback");
|
|
|
|
});
|
2019-09-30 09:55:57 +02:00
|
|
|
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");
|
|
|
|
});
|
2018-06-14 01:49:47 +02:00
|
|
|
|
2019-09-30 09:55:57 +02:00
|
|
|
context.subscriptions.push(mf_build);
|
|
|
|
context.subscriptions.push(mf_upload);
|
|
|
|
context.subscriptions.push(mf_traceback);
|
|
|
|
context.subscriptions.push(mf_clean);
|
2018-06-14 01:49:47 +02:00
|
|
|
}
|
|
|
|
exports.activate = activate;
|
|
|
|
|
|
|
|
// this method is called when your extension is deactivated
|
|
|
|
function deactivate() {
|
|
|
|
}
|
|
|
|
exports.deactivate = deactivate;
|