diff --git a/CHANGELOG.md b/CHANGELOG.md index d93d10421..b171f7794 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Unreleased + +### Fixes + +- Dropped support for Sentry options as Json ([#709](https://github.com/getsentry/sentry-unity/pull/709)) + - If you're migrating from version 0.3.0 or older, make sure to upgrade to 0.15.0 first, as it is the last version supporting the automated conversion of the options as Json file to a Scriptable Object. + ## 0.15.0 ### Features diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs index 8b268a066..9c52e61ae 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Sentry.Extensibility; -using Sentry.Unity.Json; using UnityEditor; using UnityEngine; @@ -43,7 +42,6 @@ private void Awake() { SetTitle(); - CheckForAndConvertJsonConfig(); Options = LoadOptions(); CliOptions = SentryCliOptions.LoadCliOptions(); } @@ -83,25 +81,6 @@ internal static ScriptableSentryUnityOptions CreateOptions(string? notDefaultCon return scriptableOptions; } - private void CheckForAndConvertJsonConfig() - { - var sentryOptionsTextAsset = - AssetDatabase.LoadAssetAtPath(JsonSentryUnityOptions.GetConfigPath(), typeof(TextAsset)) as TextAsset; - if (sentryOptionsTextAsset is null) - { - // Json config not found, nothing to do. - return; - } - - var scriptableOptions = CreateOptions(SentryOptionsAssetName); - JsonSentryUnityOptions.ToScriptableOptions(sentryOptionsTextAsset, scriptableOptions); - - EditorUtility.SetDirty(scriptableOptions); - AssetDatabase.SaveAssets(); - - AssetDatabase.DeleteAsset(JsonSentryUnityOptions.GetConfigPath()); - } - // ReSharper disable once UnusedMember.Local private void OnGUI() { diff --git a/src/Sentry.Unity/ScriptableSentryUnityOptions.cs b/src/Sentry.Unity/ScriptableSentryUnityOptions.cs index cc807738a..91849e089 100644 --- a/src/Sentry.Unity/ScriptableSentryUnityOptions.cs +++ b/src/Sentry.Unity/ScriptableSentryUnityOptions.cs @@ -71,14 +71,6 @@ public static string GetConfigPath(string? notDefaultConfigName = null) public static SentryUnityOptions? LoadSentryUnityOptions(bool isBuilding = false) { - // TODO: Deprecated and to be removed once we update far enough. - var sentryOptionsTextAsset = Resources.Load($"{ConfigRootFolder}/{ConfigName}"); - if (sentryOptionsTextAsset != null) - { - var options = JsonSentryUnityOptions.LoadFromJson(sentryOptionsTextAsset); - return options; - } - var scriptableOptions = Resources.Load($"{ConfigRootFolder}/{ConfigName}"); if (scriptableOptions is not null) { diff --git a/test/Sentry.Unity.Tests/ScriptableSentryUnityOptions.cs b/test/Sentry.Unity.Tests/ScriptableSentryUnityOptions.cs index 885d530db..bf304b09f 100644 --- a/test/Sentry.Unity.Tests/ScriptableSentryUnityOptions.cs +++ b/test/Sentry.Unity.Tests/ScriptableSentryUnityOptions.cs @@ -32,17 +32,6 @@ class TestOptionsConfiguration : ScriptableOptionsConfiguration public void Setup() => _fixture = new Fixture(); private Fixture _fixture = null!; - [Test] - public void Options_ReadFromJson_Success() - { - var optionsFilePath = GetTestOptionsFilePath(); - Assert.IsTrue(File.Exists(optionsFilePath)); - - var jsonTextAsset = new TextAsset(File.ReadAllText(GetTestOptionsFilePath())); - - JsonSentryUnityOptions.LoadFromJson(jsonTextAsset); - } - [Test] [TestCase(true)] [TestCase(false)]