Skip to content

Commit

Permalink
feat: support .NET 9.0 and update dependence packages (#357)
Browse files Browse the repository at this point in the history
* feat: support .NET 9.0 and update dependence packages

Signed-off-by: Taoyuesong <[email protected]>

* fix: azure pipeline error

Signed-off-by: Taoyuesong <[email protected]>

---------

Signed-off-by: Taoyuesong <[email protected]>
  • Loading branch information
Taoyuesong authored Jun 6, 2024
1 parent 9429ca7 commit e133b78
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
include-prerelease: true

- name: Check .NET info
Expand Down Expand Up @@ -115,6 +116,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
include-prerelease: true

- name: Check .NET info
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/infersharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
include-prerelease: true

- name: Check .NET info
Expand All @@ -33,11 +34,11 @@ jobs:
- name: Build solution
run: dotnet build -c Release --no-restore

- name: Run net8.0 Infer#
- name: Run net8.0 Infer#
uses: microsoft/[email protected]
with:
binary-path: ./Casbin/bin/Release/net8.0

- name: Print net8.0 Infer# analysis results
run: cat infer-out/report.txt

Expand All @@ -47,11 +48,11 @@ jobs:
name: "infersharp-net8.0-results"
path: './infer-out/report.txt'

- name: Run net7.0 Infer#
- name: Run net7.0 Infer#
uses: microsoft/[email protected]
with:
binary-path: ./Casbin/bin/Release/net7.0

- name: Print net7.0 Infer# analysis results
run: cat infer-out/report.txt

Expand All @@ -61,44 +62,44 @@ jobs:
name: "infersharp-net7.0-results"
path: './infer-out/report.txt'

- name: Run net6.0 Infer#
- name: Run net6.0 Infer#
uses: microsoft/[email protected]
with:
binary-path: ./Casbin/bin/Release/net6.0

- name: Print net6.0 Infer# analysis results
run: cat infer-out/report.txt

- name: Upload net6.0 infer# results artefacts
uses: actions/[email protected]
with:
name: "infersharp-net6.0-results"
path: './infer-out/report.txt'

- name: Run net5.0 Infer#
- name: Run net5.0 Infer#
uses: microsoft/[email protected]
with:
binary-path: ./Casbin/bin/Release/net5.0

- name: Print net5.0 Infer# analysis results
run: cat infer-out/report.txt

- name: Upload net5.0 infer# results artefacts
uses: actions/[email protected]
with:
name: "infersharp-net5.0-results"
path: './infer-out/report.txt'

- name: Run net3.1 Infer#
- name: Run net3.1 Infer#
uses: microsoft/[email protected]
with:
binary-path: ./Casbin/bin/Release/netcoreapp3.1

- name: Print net3.1 Infer# analysis results
run: cat infer-out/report.txt

- name: Upload net3.1 infer# results artefacts
uses: actions/[email protected]
with:
name: "infersharp-net3.1-results"
path: './infer-out/report.txt'
path: './infer-out/report.txt'
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
include-prerelease: true

- name: Check .NET info
Expand Down Expand Up @@ -120,6 +121,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
include-prerelease: true

- name: Check .NET info
Expand Down
2 changes: 2 additions & 0 deletions Casbin.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE = LICENSE
README.md = README.md
.github\workflows\release.yml = .github\workflows\release.yml
.github\workflows\infersharp.yml = .github\workflows\infersharp.yml
.github\workflows\semantic.yml = .github\workflows\semantic.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Casbin.Benchmark", "Casbin.Benchmark\Casbin.Benchmark.csproj", "{1DBC2931-4981-4DB5-A30B-FF6EB8622B04}"
Expand Down
10 changes: 3 additions & 7 deletions Casbin.UnitTests/Casbin.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;net461;net452</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;net462;net461;net452</TargetFrameworks>
<DebugType>full</DebugType>
<IsPackable>false</IsPackable>
<LangVersion>10.0</LangVersion>
Expand All @@ -19,7 +19,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -34,9 +34,5 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<Folder Include="Mock\" />
</ItemGroup>


</Project>
31 changes: 23 additions & 8 deletions Casbin/Casbin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0;net462;net461;net452;</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0;net462;net461;net452;</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591;CS0618</NoWarn>
<LangVersion>11</LangVersion>
</PropertyGroup>
Expand Down Expand Up @@ -42,73 +42,89 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="DotNet.Glob" Version="3.1.3" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.Github" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.Github" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="9.0.0-preview.4.24266.19" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0-preview.4.24266.19" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="8.0.0-rc.1.23419.4" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0-rc.1.23419.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="3.1.32" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.32" />
<PackageReference Include="IsExternalInit" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="IsExternalInit" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="IsExternalInit" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="IsExternalInit" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="CsvHelper" Version="32.0.3" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="IsExternalInit" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="DynamicExpresso.Core" Version="2.10.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="IsExternalInit" Version="1.0.3" PrivateAssets="all" />
Expand All @@ -118,6 +134,5 @@
<None Include="../README.md" Pack="true" PackagePath="" />
<None Include="casbin.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>



</Project>
7 changes: 7 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ stages:
version: '8.0.x'
includePreviewVersions: true

- task: UseDotNet@2
displayName: Setup 9.0.x .NET SDKs
inputs:
packageType: 'sdk'
version: '9.0.x'
includePreviewVersions: true

- task: DotNetCoreCLI@2
displayName: Restore projects
inputs:
Expand Down

0 comments on commit e133b78

Please sign in to comment.