Skip to content

Commit

Permalink
BREAKING: drops net6.0 support. adds net9.0 support. updates packages (
Browse files Browse the repository at this point in the history
…#109)

Drops net6.0 support EOL November 2024 and adds support for net9.0
---------

Co-authored-by: Leonardo Chaia <[email protected]>
  • Loading branch information
sant11h and leonardochaia authored Dec 10, 2024
1 parent 60dd23b commit 93869d4
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ jobs:
- name: Run Tool PowerShell
if: matrix.os == 'windows-latest'
shell: pwsh
run: ./src/dotnet-affected/bin/Debug/net6.0/dotnet-affected -p $Env:GITHUB_WORKSPACE --assume-changes dotnet-affected -v
run: ./src/dotnet-affected/bin/Debug/net9.0/dotnet-affected -p $Env:GITHUB_WORKSPACE --assume-changes dotnet-affected -v

- name: Run Tool Bash
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
shell: bash
run: ./src/dotnet-affected/bin/Debug/net6.0/dotnet-affected -p $GITHUB_WORKSPACE --assume-changes dotnet-affected -v
run: ./src/dotnet-affected/bin/Debug/net9.0/dotnet-affected -p $GITHUB_WORKSPACE --assume-changes dotnet-affected -v

- name: Pack
if: success() && matrix.os == 'ubuntu-latest'
Expand All @@ -82,4 +82,4 @@ jobs:
if: success() && matrix.os == 'ubuntu-latest'
with:
name: artifacts
path: src/dotnet-affected/bin/Debug/net8.0/
path: src/dotnet-affected/bin/Debug/net9.0/
5 changes: 4 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>

<LangVersion>9.0</LangVersion>

<GenerateAssemblyInfo>true</GenerateAssemblyInfo>

<!-- https://github.com/NuGet/Home/wiki/Centrally-managing-NuGet-package-versions -->
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>

<NuGetAudit>true</NuGetAudit>
<NuGetAuditMode>direct</NuGetAuditMode>
</PropertyGroup>

<!-- Some general configuration applied to all projects -->
Expand Down
20 changes: 10 additions & 10 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
<PackageVersion Include="Microsoft.Build.Prediction" Version="1.2.18" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />

<PackageVersion Include="BenchmarkDotNet" Version="0.13.5" />
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.12.1" Condition="'$(OS)' == 'Windows_NT'"/>

<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" Condition="'$(ContinuousIntegrationBuild)' == 'true'"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageVersion Include="Microsoft.Build" Version="17.3.2" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.3.2" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.3.2" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
<PackageVersion Include="System.CodeDom" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Build" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.11.4" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
<PackageVersion Include="System.CodeDom" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.Build" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
<PackageVersion Include="System.CodeDom" Version="9.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion eng/install-sdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ $globalJsonFile = "$PSScriptRoot\..\global.json"
$dotnetInstallDir = "$PSScriptRoot\.dotnet"

. $installScript -InstallDir $dotnetInstallDir -JSonFile $globalJsonFile
. $installScript -InstallDir $dotnetInstallDir -Channel 6.0
. $installScript -InstallDir $dotnetInstallDir -Channel 8.0
2 changes: 1 addition & 1 deletion eng/install-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ global_json_file="$(dirname "$0")/../global.json"
dotnet_install_dir="$(dirname "$0")/.dotnet"

"$install_script" --install-dir "$dotnet_install_dir" --jsonfile "$global_json_file"
"$install_script" --install-dir "$dotnet_install_dir" --channel 6.0
"$install_script" --install-dir "$dotnet_install_dir" --channel 8.0
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.101",
"allowPrerelease": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ public Task<string> Format(IEnumerable<IProjectInfo> projects)
var stringReader = new StringReader(projectRootElement);
var xmlReader = new XmlTextReader(stringReader);
var root = ProjectRootElement.Create(xmlReader);

var project = new Project(root);

// REMARKS: IgnoreMissingImports is required due to the Microsoft.Build.Traversal Sdk not being found
// on macos/darwin. We don't really need to evaluate the project, we just need to build the RawXml.
var project = new Project(root, null, null, ProjectCollection.GlobalProjectCollection, ProjectLoadSettings.IgnoreMissingImports);

// Find all affected and add them as project references
foreach (var projectInfo in projects)
Expand Down
8 changes: 4 additions & 4 deletions test/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<Import Project="../Directory.Packages.props" />
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.core" Version="2.4.1" />
<PackageVersion Include="xunit.core" Version="2.9.2" />
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0-pre.35"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0-pre.49"/>
<PackageVersion Include="coverlet.collector" Version="6.0.2"/>
<PackageVersion Include="XunitXml.TestLogger" Version="4.0.254" />
<PackageVersion Include="XunitXml.TestLogger" Version="4.1.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static ProjectRootElement CreateMsBuildProject(
// Directory.Build.Props / Directory.Packages.props
project.Sdk = "Microsoft.NET.Sdk";
// Required for net8.0 MSBuild Project Creation
project.AddProperty("TargetFrameworks", "net6.0,net8.0");
project.AddProperty("TargetFrameworks", "net8.0;net9.0");
customizer?.Invoke(project);

project.Save();
Expand Down

0 comments on commit 93869d4

Please sign in to comment.