Skip to content

Commit

Permalink
(GH-58) Added Debug Configuration for Mono
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
gep13 committed Oct 26, 2017
1 parent 3e264fe commit aaa7112
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 10 deletions.
37 changes: 31 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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\"",
Expand All @@ -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"
}
}
]
}
]
},
Expand Down
33 changes: 29 additions & 4 deletions src/cakeMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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');
});

Expand Down

0 comments on commit aaa7112

Please sign in to comment.