Standardize conditional compilation (#2143)

This commit is contained in:
Piotr Kiełkowicz 2023-02-02 11:22:49 +01:00 committed by GitHub
parent 9dedd85aea
commit f857312cf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 15 additions and 15 deletions

View File

@ -43,7 +43,7 @@ internal static class ContinuationsHelper
return typeof(object);
}
#if !NET6_0_OR_GREATER
#if NETFRAMEWORK
internal static TTo Convert<TFrom, TTo>(TFrom value)
{
return Converter<TFrom, TTo>.Convert(value);

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;

View File

@ -43,7 +43,7 @@ public static class LoggingBuilderIntegration
/// <returns>A default CallTargetReturn to satisfy the CallTarget contract</returns>
internal static CallTargetReturn OnMethodEnd<TTarget>(TTarget instance, Exception exception, CallTargetState state)
{
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
if (instance is not null)
{
var logBuilderExtensionsType = Type.GetType("OpenTelemetry.AutoInstrumentation.Logger.LogBuilderExtensions, OpenTelemetry.AutoInstrumentation");

View File

@ -33,7 +33,7 @@ namespace OpenTelemetry.AutoInstrumentation.Instrumentations.MySqlData;
type: InstrumentationType.Trace)]
public static class MySqlConnectionStringBuilderIntegration
{
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
private static readonly object TrueAsObject = true;
#endif
@ -49,7 +49,7 @@ public static class MySqlConnectionStringBuilderIntegration
internal static CallTargetReturn<TReturn> OnMethodEnd<TTarget, TReturn>(TReturn returnValue, Exception exception, CallTargetState state)
where TTarget : struct
{
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
var alwaysReturnTrue = (TReturn)TrueAsObject;
return new CallTargetReturn<TReturn>(alwaysReturnTrue);

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
using FluentAssertions;
using FluentAssertions.Execution;
using IntegrationTests.Helpers;

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
using IntegrationTests.Helpers;
using Xunit.Abstractions;

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
using IntegrationTests.Helpers;
using Xunit;
using Xunit.Abstractions;

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
using System.Threading.Tasks;
using DotNet.Testcontainers.Builders;
using DotNet.Testcontainers.Containers;

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if !NETFRAMEWORK
#if NET6_0_OR_GREATER
using IntegrationTests.Helpers;
using Xunit;
using Xunit.Abstractions;

View File

@ -144,7 +144,7 @@ public class SmokeTests : TestHelper
collector.ResourceExpector.AssertExpectations();
}
#if !NETFRAMEWORK // The feature is not supported on .NET Framework
#if NET6_0_OR_GREATER // The feature is not supported on .NET Framework
[Fact]
[Trait("Category", "EndToEnd")]
public void LogsResource()
@ -196,7 +196,7 @@ public class SmokeTests : TestHelper
collector.AssertExpectations();
}
#if NETFRAMEWORK // The test is flaky on Linux and macOS, becasue of https://github.com/dotnet/runtime/issues/28658#issuecomment-462062760
#if NETFRAMEWORK // The test is flaky on Linux and macOS, because of https://github.com/dotnet/runtime/issues/28658#issuecomment-462062760
[Fact]
[Trait("Category", "EndToEnd")]
public void PrometheusExporter()
@ -245,7 +245,7 @@ public class SmokeTests : TestHelper
}
#endif
#if !NETFRAMEWORK // The feature is not supported on .NET Framework
#if NET6_0_OR_GREATER // The feature is not supported on .NET Framework
[Fact]
[Trait("Category", "EndToEnd")]
public void SubmitLogs()

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if NET462
#if NETFRAMEWORK
using Xunit.Abstractions;
namespace IntegrationTests;