Skip to content

Commit

Permalink
[repo] Bump Microsoft.Extensions.Logging.Configuration and clean up n…
Browse files Browse the repository at this point in the history
…et462 targets (#5020)
  • Loading branch information
CodeBlanch authored Nov 3, 2023
1 parent 5e6eca8 commit 5345863
Show file tree
Hide file tree
Showing 24 changed files with 58 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
-->
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0-rc.2.23479.6" />

<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="[3.1.0,)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="[3.1.0,)" />
<PackageVersion Include="OpenTelemetry" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Api" Version="$(OTelLatestStableVer)" />
Expand Down
14 changes: 7 additions & 7 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@

<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<PropertyGroup>
<NetFrameworkMinimumSupportedVersion>net462</NetFrameworkMinimumSupportedVersion>
<NetFrameworkSupportedVersions>net481;net48;net472;net471;net47;net462</NetFrameworkSupportedVersions>

<!-- production TFMs -->
<TargetFrameworksForLibraries>net8.0;net6.0;netstandard2.0;net462</TargetFrameworksForLibraries>
<TargetFrameworksForLibrariesExtended>net8.0;net6.0;netstandard2.1;netstandard2.0;net462</TargetFrameworksForLibrariesExtended>
<TargetFrameworksForLibraries>net8.0;net6.0;netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworksForLibraries>
<TargetFrameworksForLibrariesExtended>net8.0;net6.0;netstandard2.1;netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworksForLibrariesExtended>
<TargetFrameworksForAspNetCoreInstrumentation>net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0</TargetFrameworksForAspNetCoreInstrumentation>
<TargetFrameworksForGrpcNetClientInstrumentation>net8.0;net6.0;netstandard2.1;netstandard2.0</TargetFrameworksForGrpcNetClientInstrumentation>
<TargetFrameworksForPrometheusAspNetCore>net8.0;net6.0</TargetFrameworksForPrometheusAspNetCore>
Expand All @@ -27,11 +30,11 @@
<TargetFrameworksForAotCompatibilityTests>net8.0</TargetFrameworksForAotCompatibilityTests>
<TargetFrameworksForDocs>net8.0;net7.0;net6.0</TargetFrameworksForDocs>
<TargetFrameworksForDocs Condition="$(OS) == 'Windows_NT' And '$(UsingMicrosoftNETSdkWeb)' != 'True'">
$(TargetFrameworksForDocs);net481;net48;net472;net471;net47;net462
$(TargetFrameworksForDocs);$(NetFrameworkSupportedVersions)
</TargetFrameworksForDocs>
<TargetFrameworksForTests>net8.0;net7.0;net6.0</TargetFrameworksForTests>
<TargetFrameworksForTests Condition="$(OS) == 'Windows_NT'">
$(TargetFrameworksForTests);net462
$(TargetFrameworksForTests);$(NetFrameworkMinimumSupportedVersion)
</TargetFrameworksForTests>
</PropertyGroup>

Expand All @@ -52,9 +55,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" Condition="'$(SkipAnalysis)'!='true'" />
<!--
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" PrivateAssets="All" Condition="'$(SkipAnalysis)'!='true'" />
-->
</ItemGroup>

<ItemGroup Condition="'$(IncludeDiagnosticSourceInstrumentationHelpers)'=='true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@

<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Grpc" Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net462'" />
<PackageReference Include="Grpc" Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
<PackageReference Include="Google.Protobuf" />
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\PeriodicExportingMetricReaderHelper.cs" Link="Includes\PeriodicExportingMetricReaderHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\PeerServiceResolver.cs" Link="Includes\PeerServiceResolver.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@

<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.GrpcNetClient\StatusCanonicalCode.cs" Link="Includes\StatusCanonicalCode.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\Shared\RequestMethodHelper.cs" Link="Includes\RequestMethodHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\EnvironmentVariables\*.cs" Link="Includes\EnvironmentVariables\%(Filename).cs" Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'" />
<Compile Include="$(RepoRoot)\src\Shared\EnvironmentVariables\*.cs" Link="Includes\EnvironmentVariables\%(Filename).cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
<Compile Include="$(RepoRoot)\src\Shared\HttpSemanticConventionHelper.cs" Link="Includes\HttpSemanticConventionHelper.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Options\*.cs" Link="Includes\Options\%(Filename).cs" />
<Compile Include="$(RepoRoot)\src\Shared\Shims\NullableAttributes.cs" Link="Includes\Shims\NullableAttributes.cs" />
Expand All @@ -30,27 +30,13 @@
<PackageReference Include="OpenTelemetry" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<PackageReference Include="System.Text.Encodings.Web" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Text.Encodings.Web" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@
<PackageReference Include="OpenTelemetry" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/OpenTelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
ASP.NET Core and HttpClient.
([#5021](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5021))

* Updated `Microsoft.Extensions.Logging.Configuration` package version to
`8.0.0-rc.2.23479.6`.
([#5020](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5020))

## 1.7.0-alpha.1

Released 2023-Oct-16
Expand Down
4 changes: 2 additions & 2 deletions src/Shared/HttpSemanticConventionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ private static bool TryGetConfiguredValues(IConfiguration configuration, [NotNul
{
try
{
var stringValue = configuration![SemanticConventionOptInKeyName];
var stringValue = configuration[SemanticConventionOptInKeyName];

if (string.IsNullOrWhiteSpace(stringValue))
{
values = null;
return false;
}

var stringValues = stringValue.Split(separator: new[] { ',', ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
var stringValues = stringValue!.Split(separator: new[] { ',', ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
values = new HashSet<string>(stringValues, StringComparer.OrdinalIgnoreCase);
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion test/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="Moq" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<PackageReference Include="Grpc.AspNetCore.Server" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.AspNetCore\OpenTelemetry.Instrumentation.AspNetCore.csproj" />
Expand All @@ -38,4 +38,5 @@
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Http\OpenTelemetry.Instrumentation.Http.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Prometheus.HttpListener\OpenTelemetry.Exporter.Prometheus.HttpListener.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion test/Benchmarks/Exporter/ZipkinExporterBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace Benchmarks.Exporter;

#if !NET462
#if !NETFRAMEWORK
[ThreadingDiagnoser]
#endif
public class ZipkinExporterBenchmarks
Expand Down
1 change: 1 addition & 0 deletions test/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Packages.props, $(MSBuildThisFileDirectory)..))" />
<ItemGroup>
<PackageVersion Update="System.Text.Json" Version="6.0.5" />
<PackageVersion Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Condition="'$(TargetFramework)' != 'net462'" Include="Grpc.AspNetCore.Server" />
<PackageReference Condition="'$(TargetFramework)' != 'net462'" Include="Microsoft.AspNetCore.TestHost" />
<PackageReference Include="Grpc.AspNetCore.Server" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="Microsoft.Extensions.Http" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.InMemory\OpenTelemetry.Exporter.InMemory.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\test\OpenTelemetry.Tests\Shared\EventSourceTestHelper.cs" Link="Includes\EventSourceTestHelper.cs" />
<Compile Include="$(RepoRoot)\test\OpenTelemetry.Tests\Shared\TestEventListener.cs" Link="Includes\TestEventListener.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Condition="'$(TargetFramework)' != 'net462'" Include="Microsoft.AspNetCore.TestHost" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="Google.Protobuf" />
<PackageReference Include="Grpc.AspNetCore.Server" Condition="'$(TargetFramework)' != 'net462'" />
<PackageReference Include="Grpc.AspNetCore.Server" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<PackageReference Include="Grpc.Net.Client" />
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
Expand All @@ -25,14 +25,11 @@
</ItemGroup>

<ItemGroup>
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == 'net462'" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.AspNetCore\OpenTelemetry.Instrumentation.AspNetCore.csproj" />
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.AspNetCore\OpenTelemetry.Instrumentation.AspNetCore.csproj" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.GrpcNetClient\OpenTelemetry.Instrumentation.GrpcNetClient.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Http\OpenTelemetry.Instrumentation.Http.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == 'net462'" />
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<ItemGroup>
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<ItemGroup>
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<ItemGroup>
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<ItemGroup>
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void CreatePeriodicExportingMetricReader_ExportTimeoutMilliseconds_FromEn
[Fact]
public void CreatePeriodicExportingMetricReader_FromIConfiguration()
{
var values = new Dictionary<string, string>()
var values = new Dictionary<string, string?>()
{
[PeriodicExportingMetricReaderOptions.OTelMetricExportIntervalEnvVarKey] = "18",
[PeriodicExportingMetricReaderOptions.OTelMetricExportTimeoutEnvVarKey] = "19",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void BatchExportLogRecordProcessorOptions_EnvironmentVariableOverride()
[Fact]
public void ExportLogRecordProcessorOptions_UsingIConfiguration()
{
var values = new Dictionary<string, string>()
var values = new Dictionary<string, string?>()
{
[BatchExportLogRecordProcessorOptions.MaxQueueSizeEnvVarKey] = "1",
[BatchExportLogRecordProcessorOptions.MaxExportBatchSizeEnvVarKey] = "2",
Expand Down
2 changes: 1 addition & 1 deletion test/OpenTelemetry.Tests/Logs/LoggerProviderSdkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void ResourceDetectionUsingIConfigurationTest()
.ConfigureServices(services =>
{
services.AddSingleton<IConfiguration>(
new ConfigurationBuilder().AddInMemoryCollection(new Dictionary<string, string> { ["OTEL_SERVICE_NAME"] = "TestServiceName" }).Build());
new ConfigurationBuilder().AddInMemoryCollection(new Dictionary<string, string?> { ["OTEL_SERVICE_NAME"] = "TestServiceName" }).Build());
})
.Build() as LoggerProviderSdk;

Expand Down
6 changes: 3 additions & 3 deletions test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.InMemory\OpenTelemetry.Exporter.InMemory.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="System.Text.Json" Condition="'$(TargetFramework)' == 'net462'" />
<ItemGroup Condition="'$(TargetFramework)' == '$(NetFrameworkMinimumSupportedVersion)'">
<PackageReference Include="Microsoft.CSharp" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 5345863

Please sign in to comment.