Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to net7 #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Projctl.Core/Projctl.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>net5;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="Microsoft.Build" Version="16.4.0" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.4.0" ExcludeAssets="runtime" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />
<PackageReference Include="Microsoft.Build" Version="17.4.0" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.5.5" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.4.0" ExcludeAssets="runtime" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

</Project>
9 changes: 5 additions & 4 deletions Projctl.Test/CreateSolutionFilterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
#region Namespace Imports

using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -46,13 +47,13 @@ public async Task ShouldCreateSolutionFilterFile(string projectGlob, params stri
var fileName = Path.Combine(TestSolutionDirectory, "Test.slnf");
await InvokeAsync($"create-solution-filter {projectGlob} --solution {TestSolution} --destination {fileName}");

var json = File.ReadAllText(fileName);
var json = await File.ReadAllTextAsync(fileName);
var solutionFilterFile = JsonConvert.DeserializeObject<SolutionFilterFile>(json);

Verify(results, solutionFilterFile, Path.GetDirectoryName(fileName));
}

private static void Verify(string[] results, SolutionFilterFile solutionFilterFile, string directory)
private static void Verify(IReadOnlyCollection<string> results, SolutionFilterFile solutionFilterFile, string directory)
{
solutionFilterFile.SolutionFilter.Should().NotBeNull();

Expand All @@ -61,8 +62,8 @@ private static void Verify(string[] results, SolutionFilterFile solutionFilterFi
var solutionDirectoryName = Path.GetDirectoryName(TestSolution);

solutionFilterFile.SolutionFilter.Projects.Should()
.HaveCount(results.Length)
.And.Contain(results.Select(p => Path.GetRelativePath(solutionDirectoryName, p)));
.HaveCount(results.Count)
.And.Contain(results.Select(p => Path.GetRelativePath(solutionDirectoryName!, p)));
}
}
}
15 changes: 9 additions & 6 deletions Projctl.Test/Projctl.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>net5;net6.0;net7.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.0.0" />
<PackageReference Include="coverlet.collector" Version="1.0.1" />
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Projctl.Test/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TestBase
private Parser _parser;

protected string Error => _console.Error.ToString();
protected string[] Out => _console.Out.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries);
protected string[] Out => _console.Out.ToString()!.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries);
protected string OutString => _console.Out.ToString();

[AssemblyInitialize]
Expand Down
4 changes: 2 additions & 2 deletions Projctl/Projctl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>net5;net6.0;net7.0</TargetFrameworks>

<PackAsTool>true</PackAsTool>
<ToolCommandName>projctl</ToolCommandName>
Expand All @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20158.1" />
</ItemGroup>

Expand Down