diff --git a/src/Sentry/Platforms/Unity/Sentry.Unity.props b/src/Sentry/Platforms/Unity/Sentry.Unity.props new file mode 100644 index 0000000000..ba9f0f42d2 --- /dev/null +++ b/src/Sentry/Platforms/Unity/Sentry.Unity.props @@ -0,0 +1,15 @@ + + + + netstandard2.0;netstandard2.1 + + false + $(DefineConstants);SENTRY_UNITY + + + + + + + + diff --git a/src/Sentry/Platforms/Unity/SentrySdk.Unity.cs b/src/Sentry/Platforms/Unity/SentrySdk.Unity.cs new file mode 100644 index 0000000000..28cecb3361 --- /dev/null +++ b/src/Sentry/Platforms/Unity/SentrySdk.Unity.cs @@ -0,0 +1,21 @@ +#if SENTRY_UNITY + +namespace Sentry; + +/// +/// Internal Sentry SDK entrypoint. +/// +/// +/// This class is now internal. Use Sentry.Unity.SentrySdk instead. +/// +/// To migrate your code: +/// +/// Change using Sentry; to using Sentry.Unity; +/// Keep using the SentrySdk API itself - no changes needed to method calls +/// Add using Sentry; if you need access to types like SentryId, SentryLevel, etc. +/// +/// +/// +internal static partial class SentrySdk; + +#endif diff --git a/src/Sentry/Sentry.csproj b/src/Sentry/Sentry.csproj index b987d1042e..2e98629933 100644 --- a/src/Sentry/Sentry.csproj +++ b/src/Sentry/Sentry.csproj @@ -7,29 +7,19 @@ true - + net9.0;net8.0;netstandard2.1;netstandard2.0;net462 $(TargetFrameworks);net9.0-android35.0;net8.0-android34.0 $(TargetFrameworks);net9.0-ios18.0;net8.0-ios17.0 $(TargetFrameworks);net9.0-maccatalyst18.0;net8.0-maccatalyst17.0 - - - netstandard2.0;netstandard2.1 - - false - - - - - - - + + true diff --git a/src/Sentry/SentrySdk.cs b/src/Sentry/SentrySdk.cs index d00b002576..ba151a50c1 100644 --- a/src/Sentry/SentrySdk.cs +++ b/src/Sentry/SentrySdk.cs @@ -6,6 +6,7 @@ namespace Sentry; +#if !SENTRY_UNITY /// /// Sentry SDK entrypoint. /// @@ -14,7 +15,9 @@ namespace Sentry; /// It allows safe static access to a client and scope management. /// When the SDK is uninitialized, calls to this class result in no-op so no callbacks are invoked. /// -public static partial class SentrySdk +public +#endif +static partial class SentrySdk { internal static IHub CurrentHub = DisabledHub.Instance;