Skip to content

Commit

Permalink
[Resources.OperatingSystem] Replace .NET 6 target with .NET 8 and add…
Browse files Browse the repository at this point in the history
… .NET Standard 2.0 target (#2169)
  • Loading branch information
joegoldman2 authored Oct 4, 2024
1 parent 6f35936 commit 5e7c50d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Resources.OperatingSystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Drop support for .NET 6 as this target is no longer supported
and add .NET 8/.NET Standard 2.0 targets.
([#2169](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2169))

## 0.1.0-alpha.4

Released 2024-Sep-09
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Extensions - Operating System Resource Detector for .NET</Description>
<Description>OpenTelemetry Resource Detectors for Operating System.</Description>
<MinVerTagPrefix>Resources.OperatingSystem-</MinVerTagPrefix>
</PropertyGroup>

<!--Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property.-->
<!-- Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property. -->
<PropertyGroup>
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestVersion)" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#if NET
#if !NETFRAMEWORK
using System.Runtime.InteropServices;
#endif
#if NET
using System.Xml.Linq;
#endif

using static OpenTelemetry.Resources.OperatingSystem.OperatingSystemSemanticConventions;

namespace OpenTelemetry.Resources.OperatingSystem;
Expand All @@ -18,16 +19,16 @@ internal sealed class OperatingSystemDetector : IResourceDetector
private const string RegistryKey = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion";
private const string KernelOsRelease = "/proc/sys/kernel/osrelease";
private static readonly string[] DefaultEtcOsReleasePaths =
[
"/etc/os-release",
"/usr/lib/os-release"
];
[
"/etc/os-release",
"/usr/lib/os-release"
];

private static readonly string[] DefaultPlistFilePaths =
[
"/System/Library/CoreServices/SystemVersion.plist",
"/System/Library/CoreServices/ServerVersion.plist"
];
[
"/System/Library/CoreServices/SystemVersion.plist",
"/System/Library/CoreServices/ServerVersion.plist"
];

private readonly string? osType;
private readonly string? registryKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Unit test project for Operating System Detector for OpenTelemetry</Description>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
<TargetFrameworks>$(SupportedNetTargetsWithoutNet6)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>Unit test project for Operating System Detector for OpenTelemetry.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 5e7c50d

Please sign in to comment.