Skip to content

Commit

Permalink
feat (Codespaces) - Added Commonly used tasks to tasks.json for VSC…
Browse files Browse the repository at this point in the history
…ode 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!
  • Loading branch information
ShreyasJejurkar authored Nov 1, 2021
1 parent 94bc5e6 commit fa25640
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,27 @@
"NODE_VERSION": "lts/*"
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp"
"ms-dotnettools.csharp",
"EditorConfig.EditorConfig",
"k--kato.docomment"
],

"settings": {
// Loading projects on demand is better for larger codebases
"omnisharp.enableMsBuildLoadProjectsOnDemand": true
"omnisharp.enableMsBuildLoadProjectsOnDemand": true,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.enableEditorConfigSupport": true,
},

// Use 'postCreateCommand' to run commands after the container is created.
"onCreateCommand": "bash -i ${containerWorkspaceFolder}/.devcontainer/scripts/container-creation.sh",

// Add the locally installed dotnet to the path to ensure that it is activated
// This is needed so that things like the C# extension can resolve the correct SDK version
"remoteEnv": {
"PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}",
"DOTNET_MULTILEVEL_LOOKUP": "0",
"TARGET": "net7.0"
},

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
80 changes: 80 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"version": "2.0.0",

"inputs": [
{
"type": "pickString",
"default": "Debug",
"options": ["Debug","Release"],
"id": "configurationType",
"description": "Select configuration type",
}
],
"tasks": [
{
"label": "Restore projects",
"type": "shell",
"command": "./restore.sh",
"windows": {
"command": ".\\restore.cmd"
},
"group": "build",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Build entire repository (Debug/Release)",
"type": "shell",
"command": "./eng/build.sh -Configuration ${input:configurationType}",
"windows": {
"command": ".\\eng\\build.cmd -Configuration ${input:configurationType}"
},
"group": "build",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Run all test projects",
"type": "shell",
"command": "./eng/build.sh -test",
"windows": {
"command": ".\\eng\\build.cmd -test"
},
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Pack assets",
"type": "shell",
"command": "./eng/build.sh --pack",
"windows": {
"command": ".\\eng\\build.cmd -pack"
},
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Clean artifacts",
"type": "shell",
"command": "./clean.sh",
"windows": {
"command": ".\\clean.cmd"
},
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
}
]
}
4 changes: 4 additions & 0 deletions docs/BuildFromSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ The following extensions are recommended when developing in the ASP.NET Core rep

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

- [C# XML Documentation Comments](https://marketplace.visualstudio.com/items?itemName=k--kato.docomment)

#### WiX (Optional)

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/>.
Expand Down Expand Up @@ -284,6 +286,8 @@ code .
> in `~/.vscode-server/server-env-setup`.
> See <https://code.visualstudio.com/docs/remote/wsl#_advanced-environment-setup-script> for details.
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.

### Building on command-line

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).
Expand Down

0 comments on commit fa25640

Please sign in to comment.