Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
- Potential crash in SentryLogger if removed early ([#323](https://github.com/getsentry/sentry-godot/pull/323))
- Ensure compatibility with minSdk 24 on Android ([#324](https://github.com/getsentry/sentry-godot/pull/324))

## Other changes

- Move native and Android internal code into respective namespaces ([#333](https://github.com/getsentry/sentry-godot/pull/333))

### Dependencies

- Bump Cocoa SDK from v8.54.0 to v8.55.0 ([#318](https://github.com/getsentry/sentry-godot/pull/318))
Expand Down
6 changes: 3 additions & 3 deletions src/register_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ void register_runtime_classes() {
GDREGISTER_INTERNAL_CLASS(SentryLogger);

#ifdef SDK_NATIVE
GDREGISTER_INTERNAL_CLASS(NativeEvent);
GDREGISTER_INTERNAL_CLASS(native::NativeEvent);
#endif

#ifdef SDK_ANDROID
GDREGISTER_INTERNAL_CLASS(AndroidEvent);
GDREGISTER_INTERNAL_CLASS(SentryAndroidBeforeSendHandler);
GDREGISTER_INTERNAL_CLASS(android::AndroidEvent);
GDREGISTER_INTERNAL_CLASS(android::SentryAndroidBeforeSendHandler);
#endif

#ifdef SDK_COCOA
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/android/android_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "android_string_names.h"

namespace sentry {
namespace sentry::android {

String AndroidEvent::get_id() const {
ERR_FAIL_NULL_V(android_plugin, String());
Expand Down Expand Up @@ -153,4 +153,4 @@ AndroidEvent::~AndroidEvent() {
}
}

} // namespace sentry
} //namespace sentry::android
4 changes: 2 additions & 2 deletions src/sentry/android/android_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using namespace godot;

namespace sentry {
namespace sentry::android {

// Event class that is used with the AndroidSDK.
class AndroidEvent : public SentryEvent {
Expand Down Expand Up @@ -66,6 +66,6 @@ class AndroidEvent : public SentryEvent {
virtual ~AndroidEvent() override;
};

} // namespace sentry
} //namespace sentry::android

#endif // SENTRY_ANDROID_EVENT_H
4 changes: 2 additions & 2 deletions src/sentry/android/android_sdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

using namespace godot;

namespace sentry {
namespace sentry::android {

void SentryAndroidBeforeSendHandler::_initialize(Object *p_android_plugin) {
android_plugin = p_android_plugin;
Expand Down Expand Up @@ -167,4 +167,4 @@ AndroidSDK::~AndroidSDK() {
}
}

} //namespace sentry
} //namespace sentry::android
4 changes: 2 additions & 2 deletions src/sentry/android/android_sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using namespace godot;

namespace sentry {
namespace sentry::android {

class SentryAndroidBeforeSendHandler : public Object {
GDCLASS(SentryAndroidBeforeSendHandler, Object);
Expand Down Expand Up @@ -57,6 +57,6 @@ class AndroidSDK : public InternalSDK {
virtual ~AndroidSDK() override;
};

} //namespace sentry
} //namespace sentry::android

#endif // SENTRY_ANDROID_SDK_H
4 changes: 2 additions & 2 deletions src/sentry/android/android_string_names.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "sentry/android/android_string_names.h"

namespace sentry {
namespace sentry::android {

AndroidStringNames *AndroidStringNames::singleton = nullptr;

Expand Down Expand Up @@ -62,4 +62,4 @@ AndroidStringNames::AndroidStringNames() {
eventAddException = StringName("eventAddException");
}

} // namespace sentry
} //namespace sentry::android
6 changes: 3 additions & 3 deletions src/sentry/android/android_string_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using namespace godot;

namespace sentry {
namespace sentry::android {

/**
* Stores StringName constants for Android SDK implementation.
Expand Down Expand Up @@ -74,8 +74,8 @@ class AndroidStringNames {
StringName eventAddException;
};

} // namespace sentry
} //namespace sentry::android

#define ANDROID_SN(m_arg) sentry::AndroidStringNames::get_singleton()->m_arg
#define ANDROID_SN(m_arg) sentry::android::AndroidStringNames::get_singleton()->m_arg

#endif // SENTRY_ANDROID_STRING_NAMES_H
4 changes: 2 additions & 2 deletions src/sentry/native/native_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void sentry_event_merge_context(sentry_value_t p_event, const char *p_context_na

} // unnamed namespace

namespace sentry {
namespace sentry::native {

String NativeEvent::get_id() const {
sentry_value_t id = sentry_value_get_by_key(native_event, "event_id");
Expand Down Expand Up @@ -242,4 +242,4 @@ NativeEvent::~NativeEvent() {
sentry_value_decref(native_event); // release ownership
}

} // namespace sentry
} //namespace sentry::native
4 changes: 2 additions & 2 deletions src/sentry/native/native_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <sentry.h>

namespace sentry {
namespace sentry::native {

// Event class that is used with the NativeSDK.
class NativeEvent : public SentryEvent {
Expand Down Expand Up @@ -63,6 +63,6 @@ class NativeEvent : public SentryEvent {
virtual ~NativeEvent() override;
};

} // namespace sentry
} //namespace sentry::native

#endif // NATIVE_EVENT_H
6 changes: 3 additions & 3 deletions src/sentry/native/native_sdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace {

using NativeEvent = sentry::NativeEvent;
using NativeEvent = sentry::native::NativeEvent;

sentry_value_t _handle_before_send(sentry_value_t event, void *hint, void *closure) {
Ref<NativeEvent> event_obj = memnew(NativeEvent(event, false));
Expand Down Expand Up @@ -119,7 +119,7 @@ inline String _uuid_as_string(sentry_uuid_t p_uuid) {

} // unnamed namespace

namespace sentry {
namespace sentry::native {

void NativeSDK::set_context(const String &p_key, const Dictionary &p_value) {
ERR_FAIL_COND(p_key.is_empty());
Expand Down Expand Up @@ -339,4 +339,4 @@ NativeSDK::~NativeSDK() {
sentry_close();
}

} //namespace sentry
} //namespace sentry::native
4 changes: 2 additions & 2 deletions src/sentry/native/native_sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <sentry.h>
#include <godot_cpp/classes/mutex.hpp>

namespace sentry {
namespace sentry::native {

// Internal SDK utilizing sentry-native.
class NativeSDK : public InternalSDK {
Expand Down Expand Up @@ -42,6 +42,6 @@ class NativeSDK : public InternalSDK {
virtual ~NativeSDK() override;
};

} //namespace sentry
} //namespace sentry::native

#endif // NATIVE_SDK_H
4 changes: 2 additions & 2 deletions src/sentry/sentry_sdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,13 @@ SentrySDK::SentrySDK() {
user_mutex.instantiate();

#ifdef SDK_NATIVE
internal_sdk = std::make_shared<NativeSDK>();
internal_sdk = std::make_shared<sentry::native::NativeSDK>();
#elif SDK_ANDROID
if (unlikely(OS::get_singleton()->has_feature("editor"))) {
sentry::util::print_debug("Sentry SDK is disabled in Android editor mode (only supported in exported Android projects)");
internal_sdk = std::make_shared<DisabledSDK>();
} else {
auto sdk = std::make_shared<AndroidSDK>();
auto sdk = std::make_shared<sentry::android::AndroidSDK>();
if (sdk->has_android_plugin()) {
internal_sdk = sdk;
} else {
Expand Down
Loading