Skip to content

Commit e663c9f

Browse files
Migrate solution to SLNX (#269)
* Migrate solution to SLNX Migrates the .NET solution to use the new [`.slnx`][slnx] file format. [slnx]: https://devblogs.microsoft.com/dotnet/introducing-slnx-support-dotnet-cli/ Contributes to martincostello/repo-migrations#85. Signed-off-by: costellobot[bot] <102247573+costellobot[bot]@users.noreply.github.com> * Migrate to SLNX Migrate to the new `.slnx` file format. --------- Signed-off-by: costellobot[bot] <102247573+costellobot[bot]@users.noreply.github.com> Co-authored-by: costellobot[bot] <102247573+costellobot[bot]@users.noreply.github.com> Co-authored-by: Martin Costello <[email protected]>
1 parent b0615b6 commit e663c9f

File tree

7 files changed

+60
-111
lines changed

7 files changed

+60
-111
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ indent_style = space
99
insert_final_newline = true
1010
trim_trailing_whitespace = true
1111

12-
[*.{config,csproj,json,props,ruleset,targets,yml}]
12+
[*.{config,csproj,json,props,ruleset,slnx,targets,yml}]
1313
indent_size = 2
1414

1515
[*.{received,verified}.{txt,xml,json}]

TodoApp.sln

Lines changed: 0 additions & 104 deletions
This file was deleted.

TodoApp.slnx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<Solution>
2+
<Folder Name="/perf/">
3+
<Project Path="perf/TodoApp.Benchmarks/TodoApp.Benchmarks.csproj" />
4+
</Folder>
5+
<Folder Name="/Solution Items/">
6+
<File Path=".editorconfig" />
7+
<File Path=".gitattributes" />
8+
<File Path=".gitignore" />
9+
<File Path=".markdownlint.json" />
10+
<File Path=".vsconfig" />
11+
<File Path="build.ps1" />
12+
<File Path="CODE_OF_CONDUCT.md" />
13+
<File Path="Directory.Build.props" />
14+
<File Path="global.json" />
15+
<File Path="LICENSE" />
16+
<File Path="NuGet.config" />
17+
<File Path="omnisharp.json" />
18+
<File Path="README.md" />
19+
<File Path="SECURITY.md" />
20+
<File Path="startvs.cmd" />
21+
<File Path="startvscode.cmd" />
22+
<File Path="TodoApp.ruleset" />
23+
</Folder>
24+
<Folder Name="/Solution Items/.github/">
25+
<File Path=".github/actionlint-matcher.json" />
26+
<File Path=".github/CODEOWNERS" />
27+
<File Path=".github/CONTRIBUTING.md" />
28+
<File Path=".github/dependabot.yml" />
29+
<File Path=".github/FUNDING.yml" />
30+
<File Path=".github/ISSUE_TEMPLATE.md" />
31+
<File Path=".github/PULL_REQUEST_TEMPLATE.md" />
32+
</Folder>
33+
<Folder Name="/Solution Items/.github/ISSUE_TEMPLATE/">
34+
<File Path=".github/ISSUE_TEMPLATE/bug_report.md" />
35+
<File Path=".github/ISSUE_TEMPLATE/config.yml" />
36+
</Folder>
37+
<Folder Name="/Solution Items/.github/workflows/">
38+
<File Path=".github/workflows/build.yml" />
39+
<File Path=".github/workflows/code-scan.yml" />
40+
<File Path=".github/workflows/lint.yml" />
41+
</Folder>
42+
<Folder Name="/Solution Items/.vscode/">
43+
<File Path=".vscode/extensions.json" />
44+
<File Path=".vscode/launch.json" />
45+
<File Path=".vscode/tasks.json" />
46+
</Folder>
47+
<Folder Name="/src/">
48+
<Project Path="src/TodoApp/TodoApp.csproj" />
49+
</Folder>
50+
<Folder Name="/tests/">
51+
<Project Path="tests/TodoApp.Tests/TodoApp.Tests.csproj" />
52+
</Folder>
53+
</Solution>

build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if ($installDotNetSdk -eq $true) {
6969
}
7070

7171
function DotNetTest {
72-
param([string]$Project)
72+
param()
7373

7474
$additionalArgs = @()
7575

@@ -78,7 +78,7 @@ function DotNetTest {
7878
$additionalArgs += "GitHubActions;report-warnings=false"
7979
}
8080

81-
& $dotnet test $Project --configuration "Release" $additionalArgs
81+
& $dotnet test --configuration "Release" $additionalArgs
8282

8383
if ($LASTEXITCODE -ne 0) {
8484
throw "dotnet test failed with exit code $LASTEXITCODE"
@@ -100,5 +100,5 @@ DotNetPublish (Join-Path $solutionPath "src" "TodoApp" "TodoApp.csproj")
100100

101101
if (-Not $SkipTests) {
102102
Write-Host "Testing solution..." -ForegroundColor Green
103-
DotNetTest(Join-Path $solutionPath "tests" "TodoApp.Tests" "TodoApp.Tests.csproj")
103+
DotNetTest
104104
}

perf/TodoApp.Benchmarks/OpenApiBenchmarks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private static string GetContentRoot()
101101

102102
do
103103
{
104-
string? solutionPath = Directory.EnumerateFiles(directoryInfo.FullName, "TodoApp.sln").FirstOrDefault();
104+
string? solutionPath = Directory.EnumerateFiles(directoryInfo.FullName, "TodoApp.slnx").FirstOrDefault();
105105

106106
if (solutionPath is not null)
107107
{

startvs.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86
1010
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use.
1111
SET PATH=%DOTNET_ROOT%;%PATH%
1212

13-
SET sln=%~dp0TodoApp.sln
13+
SET sln=%~dp0TodoApp.slnx
1414

1515
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
1616
echo The .NET SDK has not yet been installed. Run `%~dp0build.ps1` to install it

tests/TodoApp.Tests/TodoAppFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)
4949
builder.ConfigureLogging(loggingBuilder => loggingBuilder.ClearProviders().AddXUnit(this));
5050

5151
// Configure the correct content root for the static content and Razor pages
52-
builder.UseSolutionRelativeContentRoot(Path.Combine("src", "TodoApp"));
52+
builder.UseSolutionRelativeContentRoot(Path.Combine("src", "TodoApp"), "*.slnx");
5353
}
5454
}

0 commit comments

Comments
 (0)