Skip to content

Commit

Permalink
upgrade to net7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adamralph committed Nov 9, 2022
1 parent 73e8358 commit 38a8b11
Show file tree
Hide file tree
Showing 22 changed files with 4,795 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: mcr.microsoft.com/dotnet/sdk:6.0
- image: mcr.microsoft.com/dotnet/sdk:7.0
steps:
- checkout
- run:
Expand Down
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
container:
image: mcr.microsoft.com/dotnet/sdk:6.0
image: mcr.microsoft.com/dotnet/sdk:7.0
build_task:
build_script: ./build
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-6.0
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-7.0

RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install lts/* && npm install -g cspell 2>&1"
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
dotnet-version: |
3.1.425
6.0.403
7.0.100
- uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
build:
image: mcr.microsoft.com/dotnet/sdk:6.0
image: mcr.microsoft.com/dotnet/sdk:7.0
script: ./build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<RollForward>major</RollForward>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion BullseyeSmokeTester.CommandLine/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

#pragma warning disable IDE0028
var cmd = new RootCommand { foo, };
#pragma warning restore IDE0028

// translate from Bullseye to System.CommandLine
cmd.Add(new Argument<string[]>("targets") { Description = "A list of targets to run or list. If not specified, the \"default\" target will be run, or all targets will be listed.", });
#pragma warning restore IDE0028
foreach (var (aliases, description) in Options.Definitions)
{
cmd.Add(new Option<bool>(aliases.ToArray(), description));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<RollForward>major</RollForward>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<RollForward>major</RollForward>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion BullseyeSmokeTester/BullseyeSmokeTester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<RollForward>major</RollForward>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion BullseyeTests/BullseyeTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RollForward>major</RollForward>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
24 changes: 21 additions & 3 deletions BullseyeTests/Dependencies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace BullseyeTests
{
public static class Dependencies
public static partial class Dependencies
{
[Fact]
public static async Task FlatDependencies()
Expand Down Expand Up @@ -158,10 +158,28 @@ public static async Task DoubleTransitiveDependency()
Assert.Equal("first", ran[0]);
Assert.Equal("second", ran[1]);
Assert.Equal("third", ran[2]);
_ = Assert.Single(Regex.Matches(output, "first: Walking dependencies..."));
_ = Assert.Single(Regex.Matches(output, "first: Awaiting..."));
_ = Assert.Single(FirstWalkingDependencies().Matches(output));
_ = Assert.Single(FirstAwaiting().Matches(output));
}

#if NET7_0_OR_GREATER
[GeneratedRegex("first: Walking dependencies...")]
private static partial Regex FirstWalkingDependencies();
#elif NET6_0_OR_GREATER
private static Regex FirstWalkingDependencies() => new("first: Walking dependencies...");
#else
private static Regex FirstWalkingDependencies() => new Regex("first: Walking dependencies...");
#endif

#if NET7_0_OR_GREATER
[GeneratedRegex("first: Awaiting...")]
private static partial Regex FirstAwaiting();
#elif NET6_0_OR_GREATER
private static Regex FirstAwaiting() => new("first: Awaiting...");
#else
private static Regex FirstAwaiting() => new Regex("first: Awaiting...");
#endif

[Fact]
public static async Task NotExistentDependencies()
{
Expand Down
6 changes: 6 additions & 0 deletions BullseyeTests/OutputTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public static async Task DefaultHost()
#if NET6_0
var expectedPath = "../../../output.default.host.net6.0.txt";
#endif
#if NET7_0
var expectedPath = "../../../output.default.host.net7.0.txt";
#endif

await AssertFile.Contains(expectedPath, output.ToString().Replace(Environment.NewLine, "\r\n", StringComparison.Ordinal));
}
Expand Down Expand Up @@ -66,6 +69,9 @@ public static async Task AllHosts(Host host)
#if NET6_0
var expectedPath = $"../../../output.all.hosts.{host}.net6.0.txt";
#endif
#if NET7_0
var expectedPath = $"../../../output.all.hosts.{host}.net7.0.txt";
#endif

await AssertFile.Contains(expectedPath, output.ToString().Replace(Environment.NewLine, "\r\n", StringComparison.Ordinal));
}
Expand Down
Loading

0 comments on commit 38a8b11

Please sign in to comment.