Skip to content

Fix packaging errors on unsupported platforms #1000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions plugin-dev/Source/Sentry/Private/HAL/PlatformSentryScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#pragma once

#ifdef SENTRY_PLATFORM_NULL
#include "Null/NullSentryScope.h"
#else
#if PLATFORM_ANDROID
#include "Android/AndroidSentryScope.h"
#elif PLATFORM_APPLE
Expand All @@ -13,8 +16,4 @@
#else
#include "Null/NullSentryScope.h"
#endif

static TSharedPtr<ISentryScope> CreateSharedSentryScope()
{
return MakeShareable(new FPlatformSentryScope);
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "GenericPlatform/GenericPlatformSentryAttachment.h"

#if USE_SENTRY_NATIVE

void FMicrosoftSentryScope::AddFileAttachment(TSharedPtr<FGenericPlatformSentryAttachment> attachment, sentry_scope_t* scope)
{
sentry_attachment_t* nativeAttachment =
Expand All @@ -29,4 +31,6 @@ void FMicrosoftSentryScope::AddByteAttachment(TSharedPtr<FGenericPlatformSentryA
sentry_attachment_set_content_type(nativeAttachment, TCHAR_TO_UTF8(*attachment->GetContentType()));

attachment->SetNativeObject(nativeAttachment);
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class FNullSentrySubsystem : public ISentrySubsystem
virtual void AddBreadcrumb(TSharedPtr<ISentryBreadcrumb> breadcrumb) override {}
virtual void AddBreadcrumbWithParams(const FString& Message, const FString& Category, const FString& Type, const TMap<FString, FSentryVariant>& Data, ESentryLevel Level) override {}
virtual void ClearBreadcrumbs() override {}
virtual void AddAttachment(TSharedPtr<ISentryAttachment> attachment) override {}
virtual void RemoveAttachment(TSharedPtr<ISentryAttachment> attachment) override {}
virtual void ClearAttachments() override {}
virtual TSharedPtr<ISentryId> CaptureMessage(const FString& message, ESentryLevel level) override { return nullptr; }
virtual TSharedPtr<ISentryId> CaptureMessageWithScope(const FString& message, ESentryLevel level, const FSentryScopeDelegate& onConfigureScope) override { return nullptr; }
virtual TSharedPtr<ISentryId> CaptureEvent(TSharedPtr<ISentryEvent> event) override { return nullptr; }
Expand All @@ -24,7 +27,6 @@ class FNullSentrySubsystem : public ISentrySubsystem
virtual void CaptureUserFeedback(TSharedPtr<ISentryUserFeedback> userFeedback) override {}
virtual void SetUser(TSharedPtr<ISentryUser> user) override {}
virtual void RemoveUser() override {}
virtual void ConfigureScope(const FSentryScopeDelegate& onConfigureScope) override {}
virtual void SetContext(const FString& key, const TMap<FString, FSentryVariant>& values) override {}
virtual void SetTag(const FString& key, const FString& value) override {}
virtual void RemoveTag(const FString& key) override {}
Expand Down
2 changes: 1 addition & 1 deletion plugin-dev/Source/Sentry/Private/SentryScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

void USentryScope::Initialize()
{
NativeImpl = CreateSharedSentryScope();
NativeImpl = MakeShareable(new FPlatformSentryScope);
}

void USentryScope::AddBreadcrumb(USentryBreadcrumb* Breadcrumb)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void SentryScopeSpec::Define()
{
BeforeEach([this]()
{
SentryScope = USentryScope::Create(CreateSharedSentryScope());
SentryScope = USentryScope::Create(MakeShareable(new FPlatformSentryScope));

TestTags.Add(TEXT("TagsKey1"), TEXT("TagsVal1"));
TestTags.Add(TEXT("TagsKey2"), TEXT("TagsVal2"));
Expand Down