Skip to content

Commit d0c1d47

Browse files
committed
Get coverage working in VS Code.
1 parent 90ee4b5 commit d0c1d47

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616
"unmanaged",
1717
"xunit"
1818
],
19-
"coverage-gutters.coverageBaseDir": "artifacts/coverage",
19+
"coverage-gutters.coverageBaseDir": "artifacts/logs",
2020
"coverage-gutters.coverageFileNames": [
2121
"**/coverage.cobertura.xml"
2222
],
2323
"dotnet.defaultSolution": "Autofac.Multitenant.sln",
24+
"explorer.fileNesting.enabled": true,
25+
"explorer.fileNesting.patterns": {
26+
"*.resx": "$(capture).*.resx, $(capture).designer.cs, $(capture).designer.vb"
27+
},
2428
"files.watcherExclude": {
2529
"**/target": true
2630
}

.vscode/tasks.json

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
{
2+
"linux": {
3+
"options": {
4+
"shell": {
5+
"args": [
6+
"-NoProfile",
7+
"-Command"
8+
],
9+
"executable": "pwsh"
10+
}
11+
}
12+
},
13+
"osx": {
14+
"options": {
15+
"shell": {
16+
"args": [
17+
"-NoProfile",
18+
"-Command"
19+
],
20+
"executable": "/usr/local/bin/pwsh"
21+
}
22+
}
23+
},
224
"tasks": [
25+
{
26+
"command": "If (Test-Path ${workspaceFolder}/artifacts/logs) { Remove-Item ${workspaceFolder}/artifacts/logs -Recurse -Force }; New-Item -Path ${workspaceFolder}/artifacts/logs -ItemType Directory -Force | Out-Null",
27+
"label": "create log directory",
28+
"type": "shell"
29+
},
330
{
431
"args": [
532
"build",
@@ -23,12 +50,15 @@
2350
"/property:GenerateFullPaths=true",
2451
"/consoleloggerparameters:NoSummary",
2552
"--results-directory",
26-
"\"artifacts/coverage\"",
53+
"\"artifacts/logs\"",
2754
"--logger:trx",
2855
"--collect:\"XPlat Code Coverage\"",
2956
"--settings:build/Coverage.runsettings"
3057
],
3158
"command": "dotnet",
59+
"dependsOn": [
60+
"create log directory"
61+
],
3262
"group": {
3363
"isDefault": true,
3464
"kind": "test"
@@ -38,5 +68,18 @@
3868
"type": "process"
3969
}
4070
],
41-
"version": "2.0.0"
71+
"version": "2.0.0",
72+
"windows": {
73+
"options": {
74+
"shell": {
75+
"args": [
76+
"-NoProfile",
77+
"-ExecutionPolicy",
78+
"Bypass",
79+
"-Command"
80+
],
81+
"executable": "pwsh.exe"
82+
}
83+
}
84+
}
4285
}

0 commit comments

Comments
 (0)