Skip to content

Commit 0b952f1

Browse files
authored
Bump build projects to .NET10 (#4644)
internally it bump Nuke to 10.0.0
1 parent 3e9873a commit 0b952f1

File tree

8 files changed

+29
-10
lines changed

8 files changed

+29
-10
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"nuke.globaltool": {
6-
"version": "9.0.4",
6+
"version": "10.0.0",
77
"commands": [
88
"nuke"
99
]

build/Build.NuGet.Steps.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
using Extensions;
33
using Nuke.Common;
44
using Nuke.Common.IO;
5+
#if NET10_0
6+
using Nuke.Common.ProjectModel;
7+
#endif
58
using Nuke.Common.Tools.DotNet;
69
using Nuke.Common.Tools.NuGet;
710
using Nuke.Common.Utilities.Collections;
@@ -125,7 +128,11 @@ partial class Build
125128
var nuspecSolutionFolder = Solution.GetSolutionFolder("nuget")
126129
?? throw new InvalidOperationException("Couldn't find the expected \"nuget\" solution folder.");
127130

128-
var nuspecProjects = nuspecSolutionFolder.Items.Keys.ToArray();
131+
#if NET9_0
132+
throw new InvalidOperationException("NuSpec packaging requires .NET 10 or greater to run.");
133+
#else
134+
var nuspecProjects = nuspecSolutionFolder.GetModel().Files!;
135+
129136
foreach (var nuspecProject in nuspecProjects)
130137
{
131138
NuGetTasks.NuGetPack(s => s
@@ -134,6 +141,8 @@ partial class Build
134141
.SetProperties(nuspecCommonProperties)
135142
.SetOutputDirectory(NuGetArtifactsDirectory));
136143
}
144+
#endif
145+
137146
});
138147

139148
Target BuildNuGetPackagesTests => _ => _

build/Directory.Packages.props

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33

44
<ItemGroup>
55
<PackageVersion Include="Mono.Cecil" Version="0.11.6" />
6-
<PackageVersion Include="Nuke.Common" Version="9.0.4" />
6+
<PackageVersion Include="Nuke.Common" Version="10.0.0" />
7+
<PackageVersion Include="Nuget.CommandLine" Version="7.0.0" />
8+
</ItemGroup>
9+
10+
<ItemGroup Condition=" '$(IsLegacyUbuntu)' != '' " >
11+
<PackageVersion Update="Nuke.Common" Version="9.0.4" />
712
<!-- Microsoft.Build is an indirect reference from Nuke.Common. Fixes https://github.com/advisories/GHSA-w3q9-fxm7-j8fq -->
813
<PackageVersion Include="Microsoft.Build" Version="17.14.28" />
914
<!-- Microsoft.Build.Tasks.Core is an indirect reference from Nuke.Common. Fixes https://github.com/advisories/GHSA-w3q9-fxm7-j8fq -->
1015
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.14.28" />
11-
<PackageVersion Include="Nuget.CommandLine" Version="7.0.0" />
1216
</ItemGroup>
1317
</Project>

build/_build.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework Condition=" '$(IsLegacyUbuntu)' == '' " >net10.0</TargetFramework>
6+
<TargetFramework Condition=" '$(IsLegacyUbuntu)' != '' " >net9.0</TargetFramework>
67
<RootNamespace></RootNamespace>
78
<NoWarn>CS0649;CS0169</NoWarn>
89
<NukeRootDirectory>..\</NukeRootDirectory>
@@ -19,11 +20,13 @@
1920
<ItemGroup>
2021
<PackageReference Include="Mono.Cecil" />
2122
<PackageReference Include="Nuke.Common" />
23+
<PackageReference Include="Nuget.CommandLine" ExcludeAssets="all" />
24+
</ItemGroup>
25+
<ItemGroup Condition=" '$(IsLegacyUbuntu)' != '' " >
2226
<!-- Microsoft.Build is an indirect reference from Nuke.Common. Fixes https://github.com/advisories/GHSA-w3q9-fxm7-j8fq -->
2327
<PackageReference Include="Microsoft.Build" />
2428
<!-- Microsoft.Build.Tasks.Core is an indirect reference from Nuke.Common. Fixes https://github.com/advisories/GHSA-w3q9-fxm7-j8fq -->
2529
<PackageReference Include="Microsoft.Build.Tasks.Core" />
26-
<PackageReference Include="Nuget.CommandLine" ExcludeAssets="all" />
2730
</ItemGroup>
2831
<ItemGroup>
2932
<PackageReference Include="DotNet.ReproducibleBuilds">

docker/ubuntu1604.dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ RUN chmod +x ./dotnet-install.sh \
3737
&& ./dotnet-install.sh -v 9.0.308 --install-dir /usr/share/dotnet --no-path \
3838
&& rm dotnet-install.sh
3939

40+
ENV IsLegacyUbuntu=true
41+
4042
WORKDIR /project

test/OpenTelemetry.AutoInstrumentation.Tests/NetFrameworkDistroTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// This test is defined in NET 9.0 because the tool is written in .NET 9.0
55
// The actual test is testing .NET Framework context.
6-
#if NET9_0
6+
#if NET10_0
77

88
using System.Reflection;
99
using System.Runtime.InteropServices;

test/OpenTelemetry.AutoInstrumentation.Tests/OpenTelemetry.AutoInstrumentation.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<PackageReference Include="Newtonsoft.Json" />
55
<PackageReference Include="Xunit.SkippableFact" />
66
<PackageReference Include="log4net" />
7-
<PackageReference Include="Microsoft.Build" Condition=" '$(TargetFramework)' == 'net9.0' " />
7+
<PackageReference Include="Microsoft.Build" Condition=" '$(TargetFramework)' == 'net10.0' " />
88
</ItemGroup>
99

1010
<ItemGroup>
1111
<ProjectReference Include="..\..\src\OpenTelemetry.AutoInstrumentation\OpenTelemetry.AutoInstrumentation.csproj" />
12-
<ProjectReference Include="..\..\tools\DependencyListGenerator\DependencyListGenerator.csproj" Condition=" '$(TargetFramework)' == 'net9.0' " />
12+
<ProjectReference Include="..\..\tools\DependencyListGenerator\DependencyListGenerator.csproj" Condition=" '$(TargetFramework)' == 'net10.0' " />
1313
</ItemGroup>
1414

1515
<ItemGroup>

tools/DependencyListGenerator/DependencyListGenerator.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework Condition=" '$(IsLegacyUbuntu)' == '' " >net10.0</TargetFramework>
5+
<TargetFramework Condition=" '$(IsLegacyUbuntu)' != '' " >net9.0</TargetFramework>
56
<ImplicitUsings>enable</ImplicitUsings>
67
<Nullable>disable</Nullable>
78
<SignAssembly>true</SignAssembly>

0 commit comments

Comments
 (0)