Skip to content

Commit

Permalink
Use obsolete attribute to display warning (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
konraddysput authored May 9, 2024
1 parent ccb82ca commit c97ed0a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 37 deletions.
8 changes: 0 additions & 8 deletions Runtime/Attributes.meta

This file was deleted.

9 changes: 0 additions & 9 deletions Runtime/Attributes/NotSupportedAttribute.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Runtime/Attributes/NotSupportedAttribute.cs.meta

This file was deleted.

15 changes: 7 additions & 8 deletions Runtime/Model/BacktraceConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Backtrace.Unity.Attributes;
using Backtrace.Unity.Common;
using Backtrace.Unity.Common;
using Backtrace.Unity.Model.Breadcrumbs;
using Backtrace.Unity.Services;
using Backtrace.Unity.Types;
Expand Down Expand Up @@ -140,7 +139,7 @@ public class BacktraceConfiguration : ScriptableObject
/// <summary>
/// Capture native crashes.
/// </summary>
[NotSupported]
[Obsolete("Not supported")]
#endif
public bool CaptureNativeCrashes = true;

Expand All @@ -150,7 +149,7 @@ public class BacktraceConfiguration : ScriptableObject
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN
[Tooltip("Capture ANR events - Application not responding")]
#else
[NotSupported]
[Obsolete("Not supported")]
#endif
public bool HandleANR = true;

Expand All @@ -161,7 +160,7 @@ public class BacktraceConfiguration : ScriptableObject
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN
[Tooltip("ANR watchdog timeout")]
#else
[NotSupported]
[Obsolete("Not supported")]
#endif
public int AnrWatchdogTimeout = DefaultAnrWatchdogTimeout;

Expand All @@ -171,7 +170,7 @@ public class BacktraceConfiguration : ScriptableObject
#if UNITY_ANDROID || UNITY_IOS
[Tooltip("Send Out of Memory exceptions to Backtrace")]
#else
[NotSupported]
[Obsolete("Not supported")]
#endif
public bool OomReports = false;

Expand All @@ -181,7 +180,7 @@ public class BacktraceConfiguration : ScriptableObject
#if UNITY_2019_2_OR_NEWER && (UNITY_ANDROID || UNITY_IOS)
[Tooltip("Enable client-side unwinding.")]
#else
[NotSupported]
[Obsolete("Not supported")]
#endif
public bool ClientSideUnwinding = false;

Expand All @@ -192,7 +191,7 @@ public class BacktraceConfiguration : ScriptableObject
#if UNITY_2019_2_OR_NEWER && UNITY_ANDROID
[Tooltip("Symbols upload token required to upload symbols to Backtrace")]
#else
[NotSupported]
[Obsolete("Not supported")]
#endif
public string SymbolsUploadToken = string.Empty;

Expand Down
3 changes: 2 additions & 1 deletion Tests/Runtime/BacktraceClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ public void Setup()
}

[UnityTest]
[Obsolete]
public IEnumerator TestClientConfigurationOptions_ValidConfigurationWithAllOptions_AllowsToUseNotSupportedOptions()
{
var clientConfiguration = GetValidClientConfiguration();
clientConfiguration.OomReports = false;
clientConfiguration.HandleANR = false;
clientConfiguration.AnrWatchdogTimeout = 0;
clientConfiguration.CaptureNativeCrashes = false;
clientConfiguration.OomReports = false;
clientConfiguration.ClientSideUnwinding = false;
clientConfiguration.SymbolsUploadToken = string.Empty;
BacktraceClient.Configuration = clientConfiguration;
Expand Down

0 comments on commit c97ed0a

Please sign in to comment.