From aaa71121c6e9c26a37c137cc6abb339724776c2a Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Thu, 26 Oct 2017 21:07:49 +0100 Subject: [PATCH] (GH-58) Added Debug Configuration for Mono - This was taken directly from redth's blog post: https://redth.codes/debugging-cake-on-macos-with-mono/ - As a result, this may not work on other systems, possibly only Mac, but it is a starter for 10 --- package.json | 37 +++++++++++++++++++++++++++++++------ src/cakeMain.ts | 33 +++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 905c141c..b390a640 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "onCommand:cake.install", "onCommand:cake.intellisense", "onCommand:workbench.action.tasks.runTask", - "onCommand:cake.provideInitialConfigurations" + "onCommand:cake.provideInitialCoreClrConfigurations", + "onCommand:cake.provideInitialMonoConfigurations" ], "main": "./out/src/cakeMain", "contributes": { @@ -114,15 +115,15 @@ }, "debuggers": [ { - "type": "cake", - "label": "Cake", - "initialConfigurations": "cake.provideInitialConfigurations", + "type": "cake-coreclr", + "label": "Cake CoreCLR", + "initialConfigurations": "cake.provideInitialCoreClrConfigurations", "configurationSnippets": [ { - "label": "Cake: Debug Script", + "label": "Cake: Debug Script (CoreCLR)", "description": "test", "body": { - "name": "Cake: Debug Script", + "name": "Cake: Debug Script (CoreCLR)", "type": "coreclr", "request": "launch", "program": "^\"\\${workspaceRoot}/tools/Cake.CoreCLR/Cake.dll\"", @@ -137,6 +138,30 @@ } } ] + }, + { + "type": "cake-mono", + "label": "Cake Mono", + "initialConfigurations": "cake.provideInitialMonoConfigurations", + "configurationSnippets": [ + { + "label": "Cake: Debug Script (Mono)", + "description": "test", + "body": { + "name": "Cake: Debug Script (Mono)", + "type": "mono", + "request": "launch", + "program": "${workspaceRoot}/tools/Cake/Cake.exe", + "args": [ + "${workspaceRoot}/build.cake", + "--debug", + "--verbosity=diagnostic" + ], + "cwd": "${workspaceRoot}", + "console": "internalConsole" + } + } + ] } ] }, diff --git a/src/cakeMain.ts b/src/cakeMain.ts index d3469736..6fae8e8d 100644 --- a/src/cakeMain.ts +++ b/src/cakeMain.ts @@ -36,11 +36,11 @@ export function activate(context: vscode.ExtensionContext): void { installCakeBakeryCommand(); })); - const initialConfigurations = { + const initialCakeCoreClrConfigurations = { version: '0.2.0', configurations: [ { - "name": "Cake: Debug Script", + "name": "Cake: Debug Script (CoreCLR)", "type": "coreclr", "request": "launch", "program": "${workspaceRoot}/tools/Cake.CoreCLR/Cake.dll", @@ -56,9 +56,34 @@ export function activate(context: vscode.ExtensionContext): void { ] }; - vscode.commands.registerCommand("cake.provideInitialConfigurations", () => { + const initialCakeMonoConfigurations = { + version: '0.2.0', + configurations: [ + { + "name": "Cake: Debug Script (mono)", + "type": "mono", + "request": "launch", + "program": "${workspaceRoot}/tools/Cake/Cake.exe", + "args": [ + "${workspaceRoot}/build.cake", + "--debug", + "--verbosity=diagnostic" + ], + "cwd": "${workspaceRoot}", + "console": "internalConsole" + } + ] + } + + vscode.commands.registerCommand("cake.provideInitialCoreClrConfigurations", () => { + return [ + JSON.stringify(initialCakeCoreClrConfigurations, null, '\t') + ].join('\n'); + }); + + vscode.commands.registerCommand("cake.provideInitialMonoConfigurations", () => { return [ - JSON.stringify(initialConfigurations, null, '\t') + JSON.stringify(initialCakeMonoConfigurations, null, '\t') ].join('\n'); });