Skip to content

Commit

Permalink
Merge branch 'dev-container' into main
Browse files Browse the repository at this point in the history
This adds dev container configuration.

This is mostly a proof of concept to support my client work.
  • Loading branch information
timabell committed Nov 27, 2024
2 parents eb5c499 + 5b0211e commit 0e507fd
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "C# (.NET)",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"extensions": [
"formulahendry.dotnet-test-explorer",
"ms-dotnettools.csharp",
"k--kato.docomment"
]
}
}
}
7 changes: 7 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3.8'
services:
app:
image: mcr.microsoft.com/dotnet/sdk:8.0
volumes:
- ..:/workspace
command: sleep infinity
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Tests/bin/Debug/net8.0/Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/Tests",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/SlnEditor.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/SlnEditor.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/SlnEditor.sln"
],
"problemMatcher": "$msCompile"
}
]
}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,9 @@ The usual host of people asking on stackoverflow, with mixed responses for this
- <https://stackoverflow.com/questions/8742316/how-to-create-visual-studio-solution-sln-files-programmatically-including-we>
- <https://stackoverflow.com/questions/2736260/programmatically-generate-visual-studio-solution>
- <https://stackoverflow.com/questions/14153614/how-to-generate-a-new-visual-studio-project-in-a-visual-studio-project-programma>
# Developer setup

You can either build/run/test this locally or in [dev containers](https://containers.dev/)
You should be able to use the dev tools of your choice - VSCode, Rider, Visual Studio etc
7 changes: 7 additions & 0 deletions SlnEditor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\publish.yml = .github\workflows\publish.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".devcontainer", ".devcontainer", "{14894B5B-C9EE-48B8-82CD-69EA4332FE0E}"
ProjectSection(SolutionItems) = preProject
.devcontainer\devcontainer.json = .devcontainer\devcontainer.json
.devcontainer\docker-compose.yml = .devcontainer\docker-compose.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -67,6 +73,7 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{803BB6CD-EA92-4CB8-9F51-9D65A0B46CF5} = {E8290A65-86C3-4F21-8516-395E04033831}
{14894B5B-C9EE-48B8-82CD-69EA4332FE0E} = {E8290A65-86C3-4F21-8516-395E04033831}
{66FD9CD4-7970-4C68-A98D-54CCDFC6139C} = {803BB6CD-EA92-4CB8-9F51-9D65A0B46CF5}
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
Expand Down

0 comments on commit 0e507fd

Please sign in to comment.