-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: seperate build & runtime scriptable options configure() (#1046)
- Loading branch information
Showing
47 changed files
with
555 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
samples/unity-of-bugs/Assets/Editor/SentryBuildtimeOptionsConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using UnityEngine; | ||
using Sentry.Unity; | ||
using Sentry.Unity.Editor; | ||
|
||
[CreateAssetMenu(fileName = "Assets/Plugins/Sentry/SentryBuildtimeOptionsConfiguration.asset", menuName = "Sentry/Assets/Plugins/Sentry/SentryBuildtimeOptionsConfiguration.asset", order = 999)] | ||
public class SentryBuildtimeOptionsConfiguration : Sentry.Unity.Editor.ScriptableOptionsConfiguration | ||
{ | ||
/// See base class for documentation. | ||
/// Learn more at https://docs.sentry.io/platforms/unity/configuration/options/#programmatic-configuration | ||
public override void Configure(SentryUnityOptions options, SentryCliOptions cliOptions) | ||
{ | ||
Debug.Log("SentryBuildtimeOptionsConfiguration::Configure() called"); | ||
Debug.Log("SentryBuildtimeOptionsConfiguration::Configure() finished"); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...cripts/CustomOptionsConfiguration.cs.meta → ...ntryBuildtimeOptionsConfiguration.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
samples/unity-of-bugs/Assets/Plugins/Sentry/SentryBuildtimeOptionsConfiguration.asset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 59bc41c2bf823704a9122d2a5995ffcf, type: 3} | ||
m_Name: SentryBuildtimeOptionsConfiguration | ||
m_EditorClassIdentifier: |
8 changes: 8 additions & 0 deletions
8
samples/unity-of-bugs/Assets/Plugins/Sentry/SentryBuildtimeOptionsConfiguration.asset.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
samples/unity-of-bugs/Assets/Resources/Sentry/SentryRuntimeOptionsConfiguration.asset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 91e386628575c034e89d0f7632eb69b8, type: 3} | ||
m_Name: SentryRuntimeOptionsConfiguration | ||
m_EditorClassIdentifier: |
8 changes: 8 additions & 0 deletions
8
samples/unity-of-bugs/Assets/Resources/Sentry/SentryRuntimeOptionsConfiguration.asset.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
samples/unity-of-bugs/Assets/Scripts/CustomOptionsConfiguration.cs
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
samples/unity-of-bugs/Assets/Scripts/SentryRuntimeOptionsConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using UnityEngine; | ||
using Sentry.Unity; | ||
|
||
[CreateAssetMenu(fileName = "Assets/Resources/Sentry/SentryRuntimeOptionsConfiguration.asset", menuName = "Sentry/Assets/Resources/Sentry/SentryRuntimeOptionsConfiguration.asset", order = 999)] | ||
public class SentryRuntimeOptionsConfiguration : Sentry.Unity.ScriptableOptionsConfiguration | ||
{ | ||
/// See base class for documentation. | ||
/// Learn more at https://docs.sentry.io/platforms/unity/configuration/options/#programmatic-configuration | ||
public override void Configure(SentryUnityOptions options) | ||
{ | ||
Debug.Log("SentryRuntimeOptionsConfiguration::Configure() called"); | ||
|
||
/// BeforeSend is only relevant at runtime. It wouldn't hurt to be set at build time, just wouldn't do anything. | ||
options.BeforeSend = sentryEvent => | ||
{ | ||
if (sentryEvent.Tags.ContainsKey("SomeTag")) | ||
{ | ||
// Don't send events with a tag SomeTag to Sentry | ||
return null; | ||
} | ||
return sentryEvent; | ||
}; | ||
|
||
Debug.Log("SentryRuntimeOptionsConfiguration::Configure() finished"); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
samples/unity-of-bugs/Assets/Scripts/SentryRuntimeOptionsConfiguration.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.