Skip to content

Commit

Permalink
Update to .NET 9 SDK + 1.10 OTel SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejgordon committed Nov 13, 2024
1 parent 365270f commit d98cc42
Show file tree
Hide file tree
Showing 27 changed files with 188 additions and 107 deletions.
3 changes: 2 additions & 1 deletion .github/.github.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/bootstrap/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ runs:
with:
global-json-file: ./global.json

- name: Install Aspire workload
shell: bash
run: dotnet workload install aspire

- id: dotnet
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="all" />
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="all" />
</ItemGroup>
</Project>
36 changes: 19 additions & 17 deletions build/build.fsproj
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);NU1701</NoWarn>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Argu" Version="6.1.4"/>
<PackageReference Include="Bullseye" Version="4.2.1"/>
<PackageReference Include="Argu" Version="6.1.4" />
<PackageReference Include="Bullseye" Version="4.2.1" />
<PackageReference Include="Octokit" Version="13.0.1" />
<PackageReference Include="Proc.Fs" Version="0.8.1"/>
<PackageReference Include="Fake.Tools.Git" Version="5.20.3"/>
<PackageReference Remove="FSharp.Core"/>
<PackageReference Include="FSharp.Core" Version="8.0.101"/>
<PackageReference Include="Proc.Fs" Version="0.8.1" />
<PackageReference Include="Fake.Tools.Git" Version="5.20.3" />
<PackageReference Remove="FSharp.Core" />
<PackageReference Include="FSharp.Core" Version="8.0.101" />
</ItemGroup>

<ItemGroup>
<None Include="..\*" LinkBase="_root"/>
<None Include="..\*" LinkBase="_root" />
</ItemGroup>

<ItemGroup>
<Compile Include="scripts\BuildInformation.fs"/>
<Compile Include="scripts\CommandLine.fs"/>
<Compile Include="scripts\BuildInformation.fs" />
<Compile Include="scripts\CommandLine.fs" />
<Compile Include="scripts\Packaging.fs" />
<Compile Include="scripts\Targets.fs"/>
<Compile Include="scripts\Program.fs"/>
<None Include="**\*"/>
<None Remove="bin\**"/>
<None Remove="obj\**"/>
<None Remove="scripts\**"/>
<None Remove="output\**"/>
<Compile Include="scripts\Targets.fs" />
<Compile Include="scripts\Program.fs" />
<None Include="**\*" />
<None Remove="bin\**" />
<None Remove="obj\**" />
<None Remove="scripts\**" />
<None Remove="output\**" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions build/scripts/Targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ let private runTests suite _ =


let settingsArg = ["-s"; "tests/.runsettings"]
let tfmArgs = if OS.Current = OS.Windows then [] else ["-f"; "net8.0"]
let tfmArgs = if OS.Current = OS.Windows then [] else ["-f"; "net9.0"]
exec {
env (Map ["TEST_SUITE", suite.SuitName])
run "dotnet" (
Expand Down Expand Up @@ -128,13 +128,13 @@ let private generateApiChanges _ =
nugetPackages
|> Seq.iter(fun p ->
let outputFile = Path.Combine(output, $"breaking-changes-%s{p}.md")
let tfm = "net8.0"
let tfm = "net9.0"
let args =
[
"assembly-differ"
$"previous-nuget|%s{p}|%s{currentVersion}|%s{tfm}";
//$"directory|.artifacts/bin/%s{p}/release/%s{tfm}";
$"directory|.artifacts/bin/%s{p}/release_net8.0";
$"directory|.artifacts/bin/%s{p}/release_net9.0";
"-a"; "true"; "--target"; p; "-f"; "github-comment"; "--output"; outputFile
]
exec { run "dotnet" args }
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.csproj
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>
<IsPackable>False</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"minver-cli": {
"version": "5.0.0",
"version": "6.0.0",
"commands": [
"minver"
]
Expand Down
6 changes: 4 additions & 2 deletions examples/AppHost/AppHost.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" Version="8.2.0" />
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions examples/AppHost/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15114",
"applicationUrl": "https://localhost:15114",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16161"
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:16161",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22052"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/Example.AspNetCore.Mvc/Example.AspNetCore.Mvc.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand Down
26 changes: 13 additions & 13 deletions examples/Example.Console/Example.Console.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.0.0-rc9.15" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.9.0-beta.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Elastic.OpenTelemetry\Elastic.OpenTelemetry.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Elastic.OpenTelemetry\Elastic.OpenTelemetry.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion examples/Example.MinimalApi/Example.MinimalApi.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions examples/Example.WorkerService/Example.WorkerService.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-Example.Elastic.OpenTelemetry.Worker-3a9724de-5d6b-4e68-a21e-b90c655cc721</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.9.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion examples/ServiceDefaults/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
using OpenTelemetry.Trace;

// ReSharper disable once CheckNamespace
#pragma warning disable IDE0130 // Namespace does not match folder structure
namespace Microsoft.Extensions.Hosting;
#pragma warning restore IDE0130 // Namespace does not match folder structure

public static class Extensions
{
Expand All @@ -30,7 +32,7 @@ public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBu
http.AddStandardResilienceHandler();

// Turn on service discovery by default
http.UseServiceDiscovery();
http.AddServiceDiscovery();
});

return builder;
Expand Down
10 changes: 5 additions & 5 deletions examples/ServiceDefaults/ServiceDefaults.csproj
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>
<IsAspireSharedProject>true</IsAspireSharedProject>
Expand All @@ -10,10 +10,10 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.2.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.0-preview.4.24156.9" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.0.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.9.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
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.100",
"version": "9.0.100",
"rollForward": "latestMajor",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0;net462</TargetFrameworks>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>True</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry.AutoInstrumentation" Version="1.7.0" GeneratePathProperty="true" PrivateAssets="contentfiles" />
<PackageReference Include="OpenTelemetry.AutoInstrumentation" Version="1.9.0" GeneratePathProperty="true" PrivateAssets="contentfiles" />
</ItemGroup>

<ItemGroup>
Expand All @@ -18,31 +18,26 @@
and link it as _instrument.cmd since we manually copy it over in the prebuild event -->
<Content Update="instrument.cmd" CopyToPublishDirectory="Never" CopyToOutputDirectory="Never" />
<Content Remove="instrument.cmd" />
<Content Include="_instrument.cmd" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always"
Pack="True" PackagePath="contentFiles/any/any/_instrument.cmd"/>
<Content Include="instrument.cmd" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always"
Pack="True" PackagePath="contentFiles/any/any/instrument.cmd"/>
<Content Include="_instrument.cmd" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always" Pack="True" PackagePath="contentFiles/any/any/_instrument.cmd" />
<Content Include="instrument.cmd" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always" Pack="True" PackagePath="contentFiles/any/any/instrument.cmd" />

<!-- ensure we remove the linked instrument.sh from base OpenTelemetry.AutoInstrumentation
and link it as _instrument.sh since we manually copy it over in the prebuild event -->

<Content Update="instrument.sh" CopyToPublishDirectory="Never" CopyToOutputDirectory="Never" />
<Content Remove="instrument.sh" />
<Content Include="_instrument.sh" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always"
Pack="True" PackagePath="contentFiles/any/any/_instrument.sh"/>
<Content Include="instrument.sh" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always"
Pack="True" PackagePath="contentFiles/any/any/instrument.sh"/>
<Content Include="_instrument.sh" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always" Pack="True" PackagePath="contentFiles/any/any/_instrument.sh" />
<Content Include="instrument.sh" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always" Pack="True" PackagePath="contentFiles/any/any/instrument.sh" />

<Content Include="instrument.props" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always"
Pack="True" PackagePath="build/elastic.opentelemetry.autoinstrumentation.props"/>
<Content Include="instrument.props" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always" Pack="True" PackagePath="build/elastic.opentelemetry.autoinstrumentation.props" />

</ItemGroup>

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<!-- Copies the content files manually as physical files in the source repository -->
<!-- we manually repackage these as contentfiles (albeit renamed) -->
<Copy SourceFiles="$(PkgOpenTelemetry_AutoInstrumentation)/contentFiles/any/any/instrument.cmd" DestinationFiles="$(MSBuildThisFileDirectory)/_instrument.cmd"/>
<Copy SourceFiles="$(PkgOpenTelemetry_AutoInstrumentation)/contentFiles/any/any/instrument.sh" DestinationFiles="$(MSBuildThisFileDirectory)/_instrument.sh"/>
<Copy SourceFiles="$(PkgOpenTelemetry_AutoInstrumentation)/contentFiles/any/any/instrument.cmd" DestinationFiles="$(MSBuildThisFileDirectory)/_instrument.cmd" />
<Copy SourceFiles="$(PkgOpenTelemetry_AutoInstrumentation)/contentFiles/any/any/instrument.sh" DestinationFiles="$(MSBuildThisFileDirectory)/_instrument.sh" />
</Target>

<ItemGroup>
Expand Down
Loading

0 comments on commit d98cc42

Please sign in to comment.