Skip to content

Commit

Permalink
Minor: Add .Net 7 preview as target framework
Browse files Browse the repository at this point in the history
  • Loading branch information
mingyaulee committed Apr 21, 2022
1 parent 45e3f35 commit f688f39
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/JsBind.Net-Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x
include-prerelease: true
- name: Setup Chrome and Chrome Driver
uses: nanasess/setup-chromedriver@master
- name: Checkout
Expand Down Expand Up @@ -77,7 +78,7 @@ jobs:
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"JsBind.Net" /o:"mingyaulee" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /v:"v${{ needs.version.outputs.FullSemVer }}" /d:sonar.cs.vstest.reportsPaths="test/TestResults/*.trx" /d:sonar.cs.opencover.reportsPaths="test/TestResults/**/*.opencover.xml"
dotnet build --no-restore --configuration Release
.\.coverlet\console\coverlet ./test/JsBind.Net.Tests/bin/Release/net6.0/wwwroot/_framework --include "[JsBind.Net*]*" --target "dotnet" --targetargs "test . --no-restore --no-build --configuration Release" --format opencover --output ./test/TestResults/coverage --verbosity detailed
.\.coverlet\console\coverlet ./test/JsBind.Net.Tests/bin/Release/net7.0/wwwroot/_framework --include "[JsBind.Net*]*" --target "dotnet" --targetargs "test . --no-restore --no-build --configuration Release" --format opencover --output ./test/TestResults/coverage --verbosity detailed
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
tag:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/JsBind.Net-Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x
include-prerelease: true
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.11
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Build properties. -->
<PropertyGroup>
<LangVersion>9</LangVersion>
<TargetFrameworks>net6.0;net5.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net5.0</TargetFrameworks>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateDependencyFile>false</GenerateDependencyFile>
Expand All @@ -24,6 +24,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Condition="'$(TargetFramework)' == 'net7.0'" Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0-*" />
<PackageReference Condition="'$(TargetFramework)' == 'net6.0'" Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Condition="'$(TargetFramework)' == 'net5.0'" Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/JsBind.Net/JsBind.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Build properties. -->
<PropertyGroup>
<LangVersion>9</LangVersion>
<TargetFrameworks>net6.0;net5.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net5.0</TargetFrameworks>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateDependencyFile>false</GenerateDependencyFile>
Expand Down Expand Up @@ -35,6 +35,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Condition="'$(TargetFramework)' == 'net7.0'" Include="Microsoft.JSInterop" Version="7.0.0-*" />
<PackageReference Condition="'$(TargetFramework)' == 'net6.0'" Include="Microsoft.JSInterop" Version="6.0.0" />
<PackageReference Condition="'$(TargetFramework)' == 'net5.0'" Include="Microsoft.JSInterop" Version="5.0.0" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions test/JsBind.Net.Tests/JsBind.Net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<_JsBind_Package_Contents_Scripts_Directory>$(MSBuildThisFileDirectory)..\..\src\JsBind.Net\content\dist</_JsBind_Package_Contents_Scripts_Directory>
<BlazorEnableCompression>false</BlazorEnableCompression>
<!-- Disable caching so that we can skip integrity check. This is for coverlet to inject the hits counter into the assembly which will change the integrity hash. -->
Expand All @@ -10,9 +10,9 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-*" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="7.0.0-*" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/JsBind.Net.TestsRunner/JsBind.Net.TestsRunner.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
<OutDir>BuildOutput\$(Configuration)</OutDir>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/JsBind.Net.TestsRunner/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task RunTests()
var configuration = "release";
#endif

var testProjectOutput = $"{solutionDirectory}\\test\\JsBind.Net.Tests\\bin\\{configuration}\\net6.0\\wwwroot\\_framework";
var testProjectOutput = $"{solutionDirectory}\\test\\JsBind.Net.Tests\\bin\\{configuration}\\net7.0\\wwwroot\\_framework";
// delete all gzip files to disable use of gzip and allow code coverage collection
foreach (var gzipFile in Directory.GetFiles(testProjectOutput).Where(file => file.EndsWith(".gz")))
{
Expand Down
4 changes: 2 additions & 2 deletions test/TestBindings/TestBindings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<LangVersion>9</LangVersion>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0-*" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit f688f39

Please sign in to comment.