Skip to content

Commit

Permalink
Target .NET 9 (#797)
Browse files Browse the repository at this point in the history
* Target .NET 9

* .NET 9 SDK on Pipeline

* Tweak build

* Fix

* ReleaseNotes.md
  • Loading branch information
thomhurst authored Dec 1, 2024
1 parent 95d39dc commit 324c0b6
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 50 deletions.
35 changes: 0 additions & 35 deletions .github/dependabot.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Cache NuGet
uses: actions/cache@v4
with:
Expand Down
4 changes: 1 addition & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
Expand All @@ -23,8 +23,6 @@
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory).ruleset</CodeAnalysisRuleSet>
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
<AnalysisLevel>preview</AnalysisLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>NU5104;NU1507;NU1903</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" />
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": "8.0.401",
"version": "9.0.100",
"rollForward": "latestMinor",
"allowPrerelease": false
}
Expand Down
2 changes: 1 addition & 1 deletion src/ModularPipelines.Build/Modules/RunUnitTestsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class RunUnitTestsModule : Module<CommandResult[]>
{
Project = unitTestProjectFile.Path,
NoBuild = true,
Framework = "net8.0",
Framework = "net9.0",
Arguments = ["--coverage", "--coverage-output-format", "cobertura"],
Configuration = Configuration.Release,
EnvironmentVariables = new Dictionary<string, string?>
Expand Down
1 change: 1 addition & 0 deletions src/ModularPipelines.Build/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add target for .NET 9
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private class DotNetTestWithFailureModule : Module<CommandResult>
return await context.DotNet().Test(new DotNetTestOptions
{
ProjectSolutionDirectoryDllExe = testProject,
Framework = "net8.0",
Framework = "net9.0",
CommandLogging = CommandLogging.Error,
}, token: cancellationToken);
}
Expand All @@ -44,7 +44,7 @@ private class DotNetTestWithoutFailureModule : Module<CommandResult>
{
ProjectSolutionDirectoryDllExe = testProject,
Filter = "TestCategory=Pass",
Framework = "net8.0",
Framework = "net9.0",
CommandLogging = CommandLogging.Error,
Logger = [$"trx;LogFileName={TrxFile}"]
}, token: cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions test/ModularPipelines.UnitTests/PipelineWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override async Task<GitHubPipelineFileWriterOptions> GetGitHubPipelineFil
PipelineProjectPath = RandomFilePath.Path!,
Environment = "${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }}",
CacheNuGet = true,
DotNetRunFramework = "net8.0",
DotNetRunFramework = "net9.0",
ValuesToMask =
[
"${{ secrets.DOTNET_FORMAT_PUSH_TOKEN }}", "${{ secrets.NuGet__ApiKey }}",
Expand Down Expand Up @@ -134,7 +134,7 @@ await Assert.That((await RandomFilePath.ReadAsync()).Trim()).
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
- name: Run Pipeline
run: dotnet run -c Release --framework net8.0 {{{RandomFilePath}}}
run: dotnet run -c Release --framework net9.0 {{{RandomFilePath}}}
env:
DOTNET_ENVIRONMENT: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Development' }}
NuGet__ApiKey: ${{ secrets.NuGet__ApiKey }}
Expand Down
2 changes: 1 addition & 1 deletion test/ModularPipelines.UnitTests/TrxParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class NUnitModule : Module<DotNetTestResult>
await context.DotNet().Test(new DotNetTestOptions
{
ProjectSolutionDirectoryDllExe = testProject,
Framework = "net8.0",
Framework = "net9.0",
CommandLogging = CommandLogging.Error,
Logger = [$"trx;logfilename={trxFile}"],
ThrowOnNonZeroExitCode = false
Expand Down

0 comments on commit 324c0b6

Please sign in to comment.