Skip to content

Commit fa25640

Browse files
feat (Codespaces) - Added Commonly used tasks to tasks.json for VSCode users. (#37873)
* feat (codespaces) - Add EditorConfig as pre-installed extension. * feat (codespaces/vscode) - Add commonly performed tasks to tasks.json * Addressed PR feedback. 1. Added C# XML documentation comments extension to suggested extension. 2. Added some more Omnisharp options to devcontainer based on our omnisharp.json file 3. Renamed tasks to Run all test projects. * Removed extra space * Formatted the Json file using inbuilt vs code formatter! * indent issues * Update build instruction * Keep 8 tabs as previosuly!
1 parent 94bc5e6 commit fa25640

File tree

3 files changed

+90
-7
lines changed

3 files changed

+90
-7
lines changed

.devcontainer/devcontainer.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,27 @@
1616
"NODE_VERSION": "lts/*"
1717
}
1818
},
19-
2019
// Add the IDs of extensions you want installed when the container is created.
2120
"extensions": [
22-
"ms-dotnettools.csharp"
21+
"ms-dotnettools.csharp",
22+
"EditorConfig.EditorConfig",
23+
"k--kato.docomment"
2324
],
24-
2525
"settings": {
2626
// Loading projects on demand is better for larger codebases
27-
"omnisharp.enableMsBuildLoadProjectsOnDemand": true
27+
"omnisharp.enableMsBuildLoadProjectsOnDemand": true,
28+
"omnisharp.enableRoslynAnalyzers": true,
29+
"omnisharp.enableEditorConfigSupport": true,
2830
},
29-
3031
// Use 'postCreateCommand' to run commands after the container is created.
3132
"onCreateCommand": "bash -i ${containerWorkspaceFolder}/.devcontainer/scripts/container-creation.sh",
32-
3333
// Add the locally installed dotnet to the path to ensure that it is activated
3434
// This is needed so that things like the C# extension can resolve the correct SDK version
3535
"remoteEnv": {
3636
"PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}",
3737
"DOTNET_MULTILEVEL_LOOKUP": "0",
3838
"TARGET": "net7.0"
3939
},
40-
4140
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
4241
"remoteUser": "vscode"
4342
}

.vscode/tasks.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"version": "2.0.0",
3+
4+
"inputs": [
5+
{
6+
"type": "pickString",
7+
"default": "Debug",
8+
"options": ["Debug","Release"],
9+
"id": "configurationType",
10+
"description": "Select configuration type",
11+
}
12+
],
13+
"tasks": [
14+
{
15+
"label": "Restore projects",
16+
"type": "shell",
17+
"command": "./restore.sh",
18+
"windows": {
19+
"command": ".\\restore.cmd"
20+
},
21+
"group": "build",
22+
"presentation": {
23+
"reveal": "always",
24+
"panel": "new"
25+
}
26+
},
27+
{
28+
"label": "Build entire repository (Debug/Release)",
29+
"type": "shell",
30+
"command": "./eng/build.sh -Configuration ${input:configurationType}",
31+
"windows": {
32+
"command": ".\\eng\\build.cmd -Configuration ${input:configurationType}"
33+
},
34+
"group": "build",
35+
"presentation": {
36+
"reveal": "always",
37+
"panel": "new"
38+
}
39+
},
40+
{
41+
"label": "Run all test projects",
42+
"type": "shell",
43+
"command": "./eng/build.sh -test",
44+
"windows": {
45+
"command": ".\\eng\\build.cmd -test"
46+
},
47+
"group": "test",
48+
"presentation": {
49+
"reveal": "always",
50+
"panel": "new"
51+
}
52+
},
53+
{
54+
"label": "Pack assets",
55+
"type": "shell",
56+
"command": "./eng/build.sh --pack",
57+
"windows": {
58+
"command": ".\\eng\\build.cmd -pack"
59+
},
60+
"presentation": {
61+
"reveal": "always",
62+
"panel": "new"
63+
}
64+
},
65+
{
66+
"label": "Clean artifacts",
67+
"type": "shell",
68+
"command": "./clean.sh",
69+
"windows": {
70+
"command": ".\\clean.cmd"
71+
},
72+
"group": "none",
73+
"presentation": {
74+
"reveal": "always",
75+
"panel": "new"
76+
},
77+
"problemMatcher": []
78+
}
79+
]
80+
}

docs/BuildFromSource.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ The following extensions are recommended when developing in the ASP.NET Core rep
157157

158158
- [EditorConfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)
159159

160+
- [C# XML Documentation Comments](https://marketplace.visualstudio.com/items?itemName=k--kato.docomment)
161+
160162
#### WiX (Optional)
161163

162164
If you plan on working with the Windows installers defined in [src/Installers/Windows](../src/Installers/Windows), you will need to install the WiX toolkit from <https://wixtoolset.org/releases/>.
@@ -284,6 +286,8 @@ code .
284286
> in `~/.vscode-server/server-env-setup`.
285287
> See <https://code.visualstudio.com/docs/remote/wsl#_advanced-environment-setup-script> for details.
286288
289+
In Visual Studio Code, press `CTRL + SHIFT + P` (`CMD + SHIFT + P` on mac) to open command palette, then search and select for `Run Tasks` option. In task list, there are couple of most used tasks are already defined, in that you can select `Build entire repository` option from it to build the repository. Once you select that option, on next window you need to select configuration type from `Debug` OR `Release`. For development purpose one can go with `Debug` option and for actual testing one can choose `Release` mode as binaries will be optimized in this mode.
290+
287291
### Building on command-line
288292

289293
When developing in VS Code, you'll need to use the `build.cmd` or `build.sh` scripts in order to build the project. You can learn more about the command line options available, check out [the section below](#using-dotnet-on-command-line-in-this-repo).

0 commit comments

Comments
 (0)