Skip to content

Commit

Permalink
Add support for .NET 9 (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlock authored Dec 22, 2024
1 parent 1a9d82a commit 2313453
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 42 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/BuildAndPack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
7.0.x
6.0.x
Expand Down Expand Up @@ -67,6 +68,7 @@ jobs:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
7.0.x
6.0.x
Expand Down Expand Up @@ -98,6 +100,7 @@ jobs:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
7.0.x
6.0.x
Expand Down
54 changes: 30 additions & 24 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"enum": [
"Debug",
"Release"
]
},
"GithubToken": {
"type": "string"
},
"NuGetToken": {
"type": "string"
},
"PackagesDirectory": {
"type": "string"
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
}
},
"definitions": {
"Host": {
"type": "string",
Expand Down Expand Up @@ -124,5 +101,34 @@
}
}
},
"$ref": "#/definitions/NukeBuild"
"allOf": [
{
"properties": {
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"enum": [
"Debug",
"Release"
]
},
"GithubToken": {
"type": "string"
},
"NuGetToken": {
"type": "string"
},
"PackagesDirectory": {
"type": "string"
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
}
}
},
{
"$ref": "#/definitions/NukeBuild"
}
]
}
10 changes: 5 additions & 5 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Build : NukeBuild
.Executes(() =>
{
DotNetRestore(s => s
.When(!string.IsNullOrEmpty(PackagesDirectory), x=>x.SetPackageDirectory(PackagesDirectory))
.When(_ => !string.IsNullOrEmpty(PackagesDirectory), x=>x.SetPackageDirectory(PackagesDirectory))
.SetProjectFile(Solution));
});

Expand All @@ -61,7 +61,7 @@ class Build : NukeBuild
DotNetBuild(s => s
.SetProjectFile(Solution)
.SetConfiguration(Configuration)
.When(IsServerBuild, x => x.SetProperty("ContinuousIntegrationBuild", "true"))
.When(_ => IsServerBuild, x => x.SetProperty("ContinuousIntegrationBuild", "true"))
.EnableNoRestore());
});

Expand All @@ -85,7 +85,7 @@ class Build : NukeBuild
DotNetPack(s => s
.SetConfiguration(Configuration)
.SetOutputDirectory(ArtifactsDirectory)
.When(IsServerBuild, x => x.SetProperty("ContinuousIntegrationBuild", "true"))
.When(_ => IsServerBuild, x => x.SetProperty("ContinuousIntegrationBuild", "true"))
.EnableNoBuild()
.EnableNoRestore()
.SetProject(Solution));
Expand All @@ -110,12 +110,12 @@ class Build : NukeBuild
}

DotNetRestore(s => s
.When(!string.IsNullOrEmpty(PackagesDirectory), x => x.SetPackageDirectory(PackagesDirectory))
.When(_ => !string.IsNullOrEmpty(PackagesDirectory), x => x.SetPackageDirectory(PackagesDirectory))
.SetConfigFile(RootDirectory / "NuGet.integration-tests.config")
.CombineWith(projectFiles, (s, p) => s.SetProjectFile(p)));

DotNetBuild(s => s
.When(!string.IsNullOrEmpty(PackagesDirectory), x=>x.SetPackageDirectory(PackagesDirectory))
.When(_ => !string.IsNullOrEmpty(PackagesDirectory), x=>x.SetPackageDirectory(PackagesDirectory))
.EnableNoRestore()
.SetConfiguration(Configuration)
.CombineWith(projectFiles, (s, p) => s.SetProjectFile(p)));
Expand Down
4 changes: 2 additions & 2 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
Expand All @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="8.1.0" />
<PackageReference Include="Nuke.Common" Version="9.0.3" />
</ItemGroup>

</Project>
15 changes: 10 additions & 5 deletions test/IntegrationLibraries.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<Project>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.11" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0*" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.20" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
Expand All @@ -30,7 +35,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Dapper" Version="2.0.90" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net48;$(TargetFrameworks)</TargetFrameworks>
<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net48;$(TargetFrameworks)</TargetFrameworks>
<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net48;$(TargetFrameworks)</TargetFrameworks>
<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net48;$(TargetFrameworks)</TargetFrameworks>
<IsPackable>false</IsPackable>
<DefineConstants>STRONGLY_TYPED_ID_EMBED_ATTRIBUTES</DefineConstants>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net48;$(TargetFrameworks)</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/StronglyTypedIds.Tests/StronglyTypedIds.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net48;$(TargetFrameworks)</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down

0 comments on commit 2313453

Please sign in to comment.