Skip to content

Commit

Permalink
Merge pull request #63 from daviddesmet/net5
Browse files Browse the repository at this point in the history
Added support for .NET 5
  • Loading branch information
daviddesmet authored Nov 22, 2020
2 parents 6ec4ee5 + a4eddee commit d482482
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v1
- name: 'Git Fetch Tags'
run: git fetch --tags
- name: 'Install .NET Core SDK'
- name: 'Install .NET SDK'
uses: actions/setup-dotnet@v1
- name: '.NET Restore'
run: dotnet tool restore
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: csharp
mono: none
dotnet: 3.1
dotnet: 5.0
script:
- dotnet restore
- dotnet test -f netcoreapp3.1 test/NaCl.Core.Tests
- dotnet test -f net5.0 test/NaCl.Core.Tests
22 changes: 14 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ jobs:
# The steps to run to execute the build.
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1'
displayName: 'Use .NET SDK 5.0'
inputs:
packageType: 'sdk'
version: '3.1.x'
version: '5.0.x'
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: 'Build Project in $(BuildConfiguration) mode'
inputs:
command: 'build'
projects: '**/NaCl.Core.csproj'
arguments: '-c $(BuildConfiguration)'
- script: dotnet test -f netcoreapp3.1 test/NaCl.Core.Tests --logger trx /p:CollectCoverage=true /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/ /p:CoverletOutputFormat=cobertura /p:Exclude='[NaCl.Core.Tests]*'
- script: dotnet test -f net5.0 test/NaCl.Core.Tests --logger trx /p:CollectCoverage=true /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/ /p:CoverletOutputFormat=cobertura /p:Exclude='[NaCl.Core.Tests]*'
displayName: 'Unit testing'
enabled: false
- task: DotNetCoreCLI@2
Expand All @@ -86,7 +86,7 @@ jobs:
targetdir: '$(Build.ArtifactStagingDirectory)/TestResults/'
reporttypes: 'HtmlInline_AzurePipelines_Dark;Cobertura;Badges'
enabled: false
- script: dotnet test -f netcoreapp3.1 test/NaCl.Core.Tests --logger trx
- script: dotnet test -f net5.0 test/NaCl.Core.Tests --logger trx
displayName: 'Run Unit Tests'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
Expand All @@ -108,7 +108,7 @@ jobs:
displayName: 'Publish Library'
inputs:
command: 'publish'
arguments: '-c $(BuildConfiguration) -f netcoreapp3.1 -o $(Build.ArtifactStagingDirectory) --no-restore'
arguments: '-c $(BuildConfiguration) -f net5.0 -o $(Build.ArtifactStagingDirectory) --no-restore'
projects: src/NaCl.Core/NaCl.Core.csproj
publishWebProjects: false
modifyOutputPath: true
Expand All @@ -131,11 +131,17 @@ jobs:
variables:
BuildConfiguration: 'release'
steps:
- task: UseDotNet@2
displayName: 'Use .NET SDK 5.0'
inputs:
packageType: 'sdk'
version: '5.0.x'
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet restore
displayName: 'Restore Project'
- script: dotnet build -c $(BuildConfiguration) --no-restore
displayName: 'Build Project in $(BuildConfiguration) mode'
- script: dotnet test -f netcoreapp3.1 test/NaCl.Core.Tests --logger trx
- script: dotnet test -f net5.0 test/NaCl.Core.Tests --logger trx
displayName: 'Run Unit Tests'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
Expand All @@ -158,10 +164,10 @@ jobs:
displayName: 'Authenticate with Azure Artifacts'
condition: ne(variables['Build.Reason'], 'PullRequest')
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1'
displayName: 'Use .NET SDK 5.0'
inputs:
packageType: 'sdk'
version: '3.1.x'
version: '5.0.x'
- task: DotNetCoreCLI@2
displayName: 'Build Project in $(BuildConfiguration) mode'
inputs:
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.1.402",
"version": "5.0.100",
"rollForward": "latestFeature"
}
}
8 changes: 4 additions & 4 deletions src/NaCl.Core/NaCl.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Unix'">netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp3.1;net45;net48</TargetFrameworks>
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Unix'">netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp3.1;net45;net48;net5.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down Expand Up @@ -54,11 +54,11 @@
</PackageReference>
</ItemGroup>

<ItemGroup Label="Package References for Windows" Condition="$(TargetFramework) != 'netcoreapp3.1' AND $(TargetFramework) != 'netstandard2.1'">
<ItemGroup Label="Package References for Windows" Condition="$(TargetFramework) != 'net5.0' AND $(TargetFramework) != 'netcoreapp3.1' AND $(TargetFramework) != 'netstandard2.1'">
<PackageReference Include="System.Memory" Version="4.5.4" />
</ItemGroup>

<PropertyGroup Label="Constants Definition" Condition="$(TargetFramework) == 'netcoreapp3.1'">
<PropertyGroup Label="Constants Definition" Condition="$(TargetFramework) == 'netcoreapp3.1' OR $(TargetFramework) == 'net5.0'">
<DefineConstants>FCL_BITOPS</DefineConstants>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/NaCl.Core.Benchmarks/NaCl.Core.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Build">
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions test/NaCl.Core.Tests/NaCl.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down Expand Up @@ -30,7 +30,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.categories" Version="2.0.4" />
Expand Down

0 comments on commit d482482

Please sign in to comment.