From 99a8befdd8d9d4680eb5372f84f9dd5e2a881813 Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Fri, 6 Sep 2024 15:31:06 +0200 Subject: [PATCH] update headers --- sentry-kotlin-multiplatform/build.gradle.kts | 10 +- .../multiplatform/CocoaScopeProvider.kt | 4 +- .../multiplatform/SentryBridge.apple.kt | 5 +- .../nsexception/SentryUnhandledExceptions.kt | 114 ++++++++++-------- .../cinterop/Sentry.Internal.def | 5 + .../cinterop/Sentry.NSException.def | 7 -- .../cinterop/Sentry.PrivateSentrySDKOnly.def | 2 - .../nativeInterop/cinterop/Sentry.Scope.def | 2 - .../PrivateSentrySDKOnly.h | 0 .../Private => SentryInternal}/SentryClient.h | 12 +- ...ryCrashMonitor_NSException+NSExceptionKt.h | 6 +- .../SentryCrashMonitor_NSException.h | 2 +- .../SentryCrashStackCursor.h | 2 +- .../SentryDebugImageProvider.h | 4 +- .../SentryDependencyContainer.h | 0 .../SentryEnvelope.h | 4 +- .../Private => SentryInternal}/SentryEvent.h | 9 +- .../Private => SentryInternal}/SentryHook.h | 0 .../SentryHub.h | 3 +- .../Private => SentryInternal}/SentrySDK.h | 6 +- .../SentryScope.h | 13 +- .../SentryStacktraceBuilder.h | 5 +- .../SentryThreadInspector.h | 5 +- .../Private/SentryTraceContext.h | 23 ---- .../cinterop/SentryNSException/SentryClient.h | 23 ---- .../SentryNSException/SentryDebugMeta.h | 23 ---- .../SentryNSException/SentryDefines.h | 28 ----- .../cinterop/SentryNSException/SentryEvent.h | 35 ------ .../SentryNSException/SentryException.h | 31 ----- .../cinterop/SentryNSException/SentryId.h | 23 ---- .../SentryMechanism+NSExceptionKt.h | 22 ---- .../SentryNSException/SentryMechanism.h | 27 ----- .../SentryNSException/SentryOptions.h | 23 ---- .../cinterop/SentryNSException/SentrySDK.h | 26 ---- .../cinterop/SentryNSException/SentryScope.h | 25 ---- .../SentryNSException/SentryStacktrace.h | 23 ---- .../SentryThread+NSExceptionKt.h | 22 ---- .../cinterop/SentryNSException/SentryThread.h | 29 ----- .../cinterop/SentryScope/SentryDefines.h | 10 -- .../cinterop/SentryScope/SentryUser.h | 33 ----- 40 files changed, 112 insertions(+), 534 deletions(-) create mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.NSException.def delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.PrivateSentrySDKOnly.def delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Scope.def rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryPrivateSentrySDKOnly => SentryInternal}/PrivateSentrySDKOnly.h (100%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentryClient.h (84%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentryCrashMonitor_NSException+NSExceptionKt.h (88%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentryCrashMonitor_NSException.h (96%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentryCrashStackCursor.h (98%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException => SentryInternal}/SentryDebugImageProvider.h (95%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentryDependencyContainer.h (100%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException => SentryInternal}/SentryEnvelope.h (95%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentryEvent.h (85%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentryHook.h (100%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException => SentryInternal}/SentryHub.h (97%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentrySDK.h (87%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryScope => SentryInternal}/SentryScope.h (65%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentryStacktraceBuilder.h (93%) rename sentry-kotlin-multiplatform/src/nativeInterop/cinterop/{SentryNSException/Private => SentryInternal}/SentryThreadInspector.h (94%) delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryTraceContext.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryClient.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDebugMeta.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDefines.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryEvent.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryException.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryId.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryMechanism+NSExceptionKt.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryMechanism.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryOptions.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentrySDK.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryScope.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryStacktrace.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryThread+NSExceptionKt.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryThread.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryDefines.h delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryUser.h diff --git a/sentry-kotlin-multiplatform/build.gradle.kts b/sentry-kotlin-multiplatform/build.gradle.kts index ccc81d10..1dbea644 100644 --- a/sentry-kotlin-multiplatform/build.gradle.kts +++ b/sentry-kotlin-multiplatform/build.gradle.kts @@ -177,14 +177,8 @@ kotlin { macosArm64() ).forEach { it.compilations.getByName("main") { - cinterops.create("Sentry.NSException") { - includeDirs("$projectDir/src/nativeInterop/cinterop/SentryNSException") - } - cinterops.create("Sentry.Scope") { - includeDirs("$projectDir/src/nativeInterop/cinterop/SentryScope") - } - cinterops.create("Sentry.PrivateSentrySDKOnly") { - includeDirs("$projectDir/src/nativeInterop/cinterop/SentryPrivateSentrySDKOnly") + cinterops.create("Sentry.Internal") { + includeDirs("$projectDir/src/nativeInterop/cinterop/SentryInternal") } } } diff --git a/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/CocoaScopeProvider.kt b/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/CocoaScopeProvider.kt index f7906086..88870d1e 100644 --- a/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/CocoaScopeProvider.kt +++ b/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/CocoaScopeProvider.kt @@ -8,16 +8,14 @@ import io.sentry.kotlin.multiplatform.extensions.toKmpUser import io.sentry.kotlin.multiplatform.extensions.toMutableMap import io.sentry.kotlin.multiplatform.protocol.Breadcrumb import io.sentry.kotlin.multiplatform.protocol.User -import Scope.Sentry.SentryScope as PrivateCocoaScope internal class CocoaScopeProvider(private val scope: CocoaScope) : Scope { - /* This bridge exposes private Cocoa SDK API to fetch internal properties such as user, level, etc. We need this in order to return properties because the Cocoa SDK doesn't implement getters. This is only used for get methods. */ - private val privateScope = scope as? PrivateCocoaScope + private val privateScope = scope as? Internal.Sentry.SentryScope override var level: SentryLevel? set(value) { diff --git a/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/SentryBridge.apple.kt b/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/SentryBridge.apple.kt index fad46614..cad8180d 100644 --- a/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/SentryBridge.apple.kt +++ b/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/SentryBridge.apple.kt @@ -1,7 +1,6 @@ package io.sentry.kotlin.multiplatform -import NSException.Sentry.SentryEvent -import PrivateSentrySDKOnly.Sentry.PrivateSentrySDKOnly +import Internal.Sentry.PrivateSentrySDKOnly import cocoapods.Sentry.SentrySDK import io.sentry.kotlin.multiplatform.extensions.toCocoaBreadcrumb import io.sentry.kotlin.multiplatform.extensions.toCocoaUser @@ -38,7 +37,7 @@ internal actual fun SentryPlatformOptions.prepareForInit() { sdk["packages"] = packages event?.sdk = sdk - dropKotlinCrashEvent(event as SentryEvent?) as CocoaSentryEvent? + dropKotlinCrashEvent(event) } cocoa?.setBeforeSend(modifiedBeforeSend) diff --git a/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/nsexception/SentryUnhandledExceptions.kt b/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/nsexception/SentryUnhandledExceptions.kt index 9f8619c6..c9908e1d 100644 --- a/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/nsexception/SentryUnhandledExceptions.kt +++ b/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/nsexception/SentryUnhandledExceptions.kt @@ -14,33 +14,37 @@ package io.sentry.kotlin.multiplatform.nsexception -import NSException.Sentry.NSExceptionKt_SentryCrashStackCursorFromNSException -import NSException.Sentry.NSExceptionKt_SentryMechanismSetNotHandled -import NSException.Sentry.NSExceptionKt_SentryThreadSetCrashed -import NSException.Sentry.SentryDependencyContainer -import NSException.Sentry.SentryEnvelope -import NSException.Sentry.SentryEnvelopeHeader -import NSException.Sentry.SentryEnvelopeItem -import NSException.Sentry.SentryEvent -import NSException.Sentry.SentryException -import NSException.Sentry.SentryMechanism -import NSException.Sentry.SentrySDK -import NSException.Sentry.SentryThread -import NSException.Sentry.SentryThreadInspector -import NSException.Sentry.currentHub -import NSException.Sentry.isCrashEvent -import NSException.Sentry.kSentryLevelFatal -import NSException.Sentry.prepareEvent -import NSException.Sentry.storeEnvelope -import NSException.Sentry.threadInspector +import Internal.Sentry.NSExceptionKt_SentryCrashStackCursorFromNSException +import Internal.Sentry.kSentryLevelFatal import platform.Foundation.NSException import platform.Foundation.NSNumber +private typealias InternalSentryEvent = Internal.Sentry.SentryEvent +private typealias InternalSentrySDK = Internal.Sentry.SentrySDK +private typealias InternalSentryEnvelope = Internal.Sentry.SentryEnvelope +private typealias InternalSentryDependencyContainer = Internal.Sentry.SentryDependencyContainer +private typealias InternalSentryEnvelopeHeader = Internal.Sentry.SentryEnvelopeHeader +private typealias InternalSentryEnvelopeItem = Internal.Sentry.SentryEnvelopeItem +private typealias InternalSentryThreadInspector = Internal.Sentry.SentryThreadInspector + +private typealias CocoapodsSentryEvent = cocoapods.Sentry.SentryEvent +private typealias CocoapodsSentrySDK = cocoapods.Sentry.SentrySDK +private typealias CocoapodsSentryStacktrace = cocoapods.Sentry.SentryStacktrace +private typealias CocoapodsSentryException = cocoapods.Sentry.SentryException +private typealias CocoapodsSentryMechanism = cocoapods.Sentry.SentryMechanism +private typealias CocoapodsSentryThread = cocoapods.Sentry.SentryThread + /** * Drops the Kotlin crash that follows an unhandled Kotlin exception except our custom SentryEvent. */ -internal fun dropKotlinCrashEvent(event: SentryEvent?): SentryEvent? { - return event?.takeUnless { it.isCrashEvent && (it.tags?.containsKey(KOTLIN_CRASH_TAG) ?: false) } +internal fun dropKotlinCrashEvent(event: CocoapodsSentryEvent?): CocoapodsSentryEvent? { + return event?.takeUnless { + (it as InternalSentryEvent).isCrashEvent && ( + it.tags?.containsKey( + KOTLIN_CRASH_TAG + ) ?: false + ) + } } /** @@ -53,8 +57,8 @@ public fun setSentryUnhandledExceptionHook(): Unit = wrapUnhandledExceptionHook val envelope = throwable.asSentryEnvelope() // The envelope will be persisted, so we can safely terminate afterwards. // https://github.com/getsentry/sentry-cocoa/blob/678172142ac1d10f5ed7978f69d16ab03e801057/Sources/Sentry/SentryClient.m#L409 - SentrySDK.storeEnvelope(envelope) - SentrySDK.configureScope { scope -> + InternalSentrySDK.storeEnvelope(envelope) + CocoapodsSentrySDK.configureScope { scope -> scope?.setTagValue(KOTLIN_CRASH_TAG, KOTLIN_CRASH_TAG) } } @@ -67,56 +71,60 @@ internal const val KOTLIN_CRASH_TAG = "nsexceptionkt.kotlin_crashed" /** * Converts `this` [Throwable] to a [SentryEnvelope]. */ -internal fun Throwable.asSentryEnvelope(): SentryEnvelope { - val event = asSentryEvent() - val preparedEvent = SentrySDK.currentHub().let { hub -> - hub.getClient()?.prepareEvent(event, hub.scope, alwaysAttachStacktrace = false, isCrashEvent = true) +internal fun Throwable.asSentryEnvelope(): InternalSentryEnvelope { + val event = asSentryEvent() as InternalSentryEvent + val preparedEvent = InternalSentrySDK.currentHub().let { hub -> + hub.getClient() + ?.prepareEvent(event, hub.scope, alwaysAttachStacktrace = false, isCrashEvent = true) } ?: event - val item = SentryEnvelopeItem(preparedEvent) + val item = InternalSentryEnvelopeItem(preparedEvent) // TODO: pass traceState when enabling performance monitoring for KMP SDK - val header = SentryEnvelopeHeader(preparedEvent.eventId, null) - return SentryEnvelope(header, listOf(item)) + val header = InternalSentryEnvelopeHeader(preparedEvent.eventId, null) + return InternalSentryEnvelope(header, listOf(item)) } /** * Converts `this` [Throwable] to a [SentryEvent]. */ @Suppress("UnnecessaryOptInAnnotation") -private fun Throwable.asSentryEvent(): SentryEvent = SentryEvent(kSentryLevelFatal).apply { - isCrashEvent = true - @Suppress("UNCHECKED_CAST") - val threads = threadInspector?.getCurrentThreadsWithStackTrace() as List? - this.threads = threads - val currentThread = threads?.firstOrNull { it.current?.boolValue ?: false }?.apply { - NSExceptionKt_SentryThreadSetCrashed(this) - // Crashed threats shouldn't have a stacktrace, the thread_id should be set on the exception instead - // https://develop.sentry.dev/sdk/event-payloads/threads/ - stacktrace = null +private fun Throwable.asSentryEvent(): CocoapodsSentryEvent = + CocoapodsSentryEvent(kSentryLevelFatal).apply { + @Suppress("UNCHECKED_CAST") + val threads = + threadInspector?.getCurrentThreadsWithStackTrace() as List? + this.threads = threads + val currentThread = threads?.firstOrNull { it.current?.boolValue ?: false }?.apply { + setCrashed(NSNumber(true)) + // Crashed threats shouldn't have a stacktrace, the thread_id should be set on the exception instead + // https://develop.sentry.dev/sdk/event-payloads/threads/ + stacktrace = null + } + debugMeta = threads?.let { + InternalSentryDependencyContainer.sharedInstance().debugImageProvider.getDebugImagesForThreads( + it + ) + } + exceptions = this@asSentryEvent + .let { throwable -> throwable.causes.asReversed() + throwable } + .map { it.asNSException().asSentryException(currentThread?.threadId) } } - debugMeta = threads?.let { - SentryDependencyContainer.sharedInstance().debugImageProvider.getDebugImagesForThreads(it) - } - exceptions = this@asSentryEvent - .let { throwable -> throwable.causes.asReversed() + throwable } - .map { it.asNSException().asSentryException(currentThread?.threadId) } -} /** * Converts `this` [NSException] to a [SentryException]. */ private fun NSException.asSentryException( threadId: NSNumber? -): SentryException = SentryException(reason ?: "", name ?: "Throwable").apply { +): CocoapodsSentryException = CocoapodsSentryException(reason ?: "", name ?: "Throwable").apply { this.threadId = threadId - mechanism = SentryMechanism("generic").apply { - NSExceptionKt_SentryMechanismSetNotHandled(this) + mechanism = CocoapodsSentryMechanism("generic").apply { + setHandled(NSNumber(false)) } stacktrace = threadInspector?.stacktraceBuilder?.let { stacktraceBuilder -> val cursor = NSExceptionKt_SentryCrashStackCursorFromNSException(this@asSentryException) val stacktrace = stacktraceBuilder.retrieveStacktraceFromCursor(cursor) - stacktrace + stacktrace as CocoapodsSentryStacktrace } } -private val threadInspector: SentryThreadInspector? - get() = SentrySDK.currentHub().getClient()?.threadInspector +private val threadInspector: InternalSentryThreadInspector? + get() = InternalSentrySDK.currentHub().getClient()?.threadInspector diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def new file mode 100644 index 00000000..9b35615a --- /dev/null +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def @@ -0,0 +1,5 @@ +language = Objective-C +headers = SentryClient.h SentryDebugImageProvider.h SentryEnvelope.h \ SentryHub.h SentryScope.h \ + SentryCrashMonitor_NSException.h SentryCrashMonitor_NSException+NSExceptionKt.h \ + SentryCrashStackCursor.h SentryDependencyContainer.h SentryHook.h SentrySDK.h \ + SentryStacktraceBuilder.h SentryThreadInspector.h PrivateSentrySDKOnly.h \ diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.NSException.def b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.NSException.def deleted file mode 100644 index 71ba6253..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.NSException.def +++ /dev/null @@ -1,7 +0,0 @@ -language = Objective-C -headers = SentryClient.h SentryDebugImageProvider.h SentryDebugMeta.h SentryDefines.h SentryEnvelope.h SentryEvent.h \ - SentryException.h SentryHub.h SentryId.h SentryMechanism.h SentryMechanism+NSExceptionKt.h SentryOptions.h \ - SentryScope.h SentrySDK.h SentryStacktrace.h SentryThread.h SentryThread+NSExceptionKt.h Private/SentryClient.h \ - Private/SentryCrashMonitor_NSException.h Private/SentryCrashMonitor_NSException+NSExceptionKt.h \ - Private/SentryCrashStackCursor.h Private/SentryDependencyContainer.h Private/SentryEvent.h Private/SentryHook.h \ - Private/SentrySDK.h Private/SentryStacktraceBuilder.h Private/SentryThreadInspector.h Private/SentryTraceContext.h diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.PrivateSentrySDKOnly.def b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.PrivateSentrySDKOnly.def deleted file mode 100644 index 44786412..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.PrivateSentrySDKOnly.def +++ /dev/null @@ -1,2 +0,0 @@ -language = Objective-C -headers = PrivateSentrySDKOnly.h diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Scope.def b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Scope.def deleted file mode 100644 index b83cfa63..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Scope.def +++ /dev/null @@ -1,2 +0,0 @@ -language = Objective-C -headers = SentryScope.h SentryUser.h SentryDefines.h diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryPrivateSentrySDKOnly/PrivateSentrySDKOnly.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/PrivateSentrySDKOnly.h similarity index 100% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryPrivateSentrySDKOnly/PrivateSentrySDKOnly.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/PrivateSentrySDKOnly.h diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryClient.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryClient.h similarity index 84% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryClient.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryClient.h index 1225dcc6..3203a233 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryClient.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryClient.h @@ -1,6 +1,6 @@ // The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. // -// https://github.com/getsentry/sentry-cocoa/blob/64a7645a598b90e217be42333594c981a3ddc642/Sources/Sentry/SentryClient.m +// https://github.com/getsentry/sentry-cocoa/blob/64a7645a598b90e217be42333594c981a3ddc642/Sources/Sentry/Public/SentryClient.h // // The MIT License (MIT) // @@ -16,12 +16,12 @@ // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. -#import -#import -#import -#import +#import +#import "SentryThreadInspector.h" -@interface SentryClient () +@class SentryEvent, SentryScope, SentryClient; + +@interface SentryClient : NSObject @property (nonatomic, strong, nonnull) SentryThreadInspector *threadInspector; diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryCrashMonitor_NSException+NSExceptionKt.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryCrashMonitor_NSException+NSExceptionKt.h similarity index 88% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryCrashMonitor_NSException+NSExceptionKt.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryCrashMonitor_NSException+NSExceptionKt.h index f7f687f6..65bbcfee 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryCrashMonitor_NSException+NSExceptionKt.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryCrashMonitor_NSException+NSExceptionKt.h @@ -1,4 +1,4 @@ -// https://github.com/rickclephas/NSExceptionKt/blob/master/nsexception-kt-sentry/src/nativeInterop/cinterop/Sentry/Private/SentryCrashMonitor_NSException%2BNSExceptionKt.h +// https://github.com/rickclephas/NSExceptionKt/blob/master/nsexception-kt-sentry/src/nativeInterop/cinterop/Sentry/SentryCrashMonitor_NSException%2BNSExceptionKt.h // // Copyright (c) 2022 Rick Clephas // @@ -13,8 +13,8 @@ // copies or substantial portions of the Software. #import -#import -#import +#import +#import // Similar to how Sentry converts stacktraces from NSExceptions // https://github.com/getsentry/sentry-cocoa/blob/167de8bea5a0effef3aaa5c99c540088de30b361/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_NSException.m#L60 diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryCrashMonitor_NSException.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryCrashMonitor_NSException.h similarity index 96% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryCrashMonitor_NSException.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryCrashMonitor_NSException.h index 805ac133..5b1083d2 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryCrashMonitor_NSException.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryCrashMonitor_NSException.h @@ -15,6 +15,6 @@ // in this source code. #import -#import +#import extern void sentrycrashsc_initWithBacktrace(SentryCrashStackCursor *cursor, const uintptr_t *backtrace, int backtraceLength, int skipEntries); diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryCrashStackCursor.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryCrashStackCursor.h similarity index 98% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryCrashStackCursor.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryCrashStackCursor.h index 6c03bdfd..da43c512 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryCrashStackCursor.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryCrashStackCursor.h @@ -14,7 +14,7 @@ // The above copyright notice and this permission notice shall remain in place // in this source code. -#import +#import #define SentryCrashSC_CONTEXT_SIZE 100 diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDebugImageProvider.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryDebugImageProvider.h similarity index 95% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDebugImageProvider.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryDebugImageProvider.h index 233feac4..16a6bb8a 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDebugImageProvider.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryDebugImageProvider.h @@ -17,8 +17,8 @@ // copies or substantial portions of the Software. #import -#import -#import + +@class SentryDebugMeta, SentryThread; @interface SentryDebugImageProvider : NSObject diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryDependencyContainer.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryDependencyContainer.h similarity index 100% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryDependencyContainer.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryDependencyContainer.h diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryEnvelope.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEnvelope.h similarity index 95% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryEnvelope.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEnvelope.h index 3b225da1..fe737ec2 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryEnvelope.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEnvelope.h @@ -17,9 +17,9 @@ // copies or substantial portions of the Software. #import -#import #import -#import + +@class SentryId, SentryTraceContext; @interface SentryEnvelopeHeader : NSObject diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryEvent.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEvent.h similarity index 85% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryEvent.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEvent.h index 07859276..9f02eea8 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryEvent.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEvent.h @@ -17,10 +17,13 @@ // copies or substantial portions of the Software. #import -#import -@interface SentryEvent () +@class SentryId; -@property (nonatomic) BOOL isCrashEvent; +@interface SentryEvent : NSObject + +@property (nonatomic, assign) BOOL isCrashEvent; + +@property (nonatomic, strong) SentryId *eventId; @end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryHook.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryHook.h similarity index 100% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryHook.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryHook.h diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryHub.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryHub.h similarity index 97% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryHub.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryHub.h index 922d4fe5..2dacf65a 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryHub.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryHub.h @@ -18,7 +18,8 @@ #import #import -#import + +@class SentryScope; @interface SentryHub : NSObject diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentrySDK.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentrySDK.h similarity index 87% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentrySDK.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentrySDK.h index 2e68ea79..c099f79d 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentrySDK.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentrySDK.h @@ -18,14 +18,10 @@ #import #import -#import -#import -@interface SentrySDK () +@interface SentrySDK : NSObject + (void)storeEnvelope:(SentryEnvelope *_Nonnull)envelope; + (SentryHub *_Nonnull)currentHub; -@property (nonatomic, nullable, readonly, class) SentryOptions *options; - @end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryScope.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryScope.h similarity index 65% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryScope.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryScope.h index 42f3620a..12ca27dd 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryScope.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryScope.h @@ -1,6 +1,15 @@ #import -#import "SentryUser.h" -#import "SentryDefines.h" + +@class SentryUser; + +typedef NS_ENUM(NSUInteger, SentryLevel) { +kSentryLevelNone = 0, + kSentryLevelDebug = 1, + kSentryLevelInfo = 2, + kSentryLevelWarning = 3, + kSentryLevelError = 4, + kSentryLevelFatal = 5 +}; @interface SentryScope : NSObject diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryStacktraceBuilder.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryStacktraceBuilder.h similarity index 93% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryStacktraceBuilder.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryStacktraceBuilder.h index 0804314d..214753f5 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryStacktraceBuilder.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryStacktraceBuilder.h @@ -17,8 +17,9 @@ // copies or substantial portions of the Software. #import -#import -#import +#import + +@class SentryStacktrace; @interface SentryStacktraceBuilder : NSObject diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryThreadInspector.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryThreadInspector.h similarity index 94% rename from sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryThreadInspector.h rename to sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryThreadInspector.h index 1bf58ecf..013ec777 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryThreadInspector.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryThreadInspector.h @@ -18,8 +18,9 @@ // copies or substantial portions of the Software. #import -#import -#import +#import + +@class SentryThread; @interface SentryThreadInspector : NSObject diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryTraceContext.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryTraceContext.h deleted file mode 100644 index de705da0..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/Private/SentryTraceContext.h +++ /dev/null @@ -1,23 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/678172142ac1d10f5ed7978f69d16ab03e801057/Sources/Sentry/include/SentryTraceContext.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import - -@interface SentryTraceContext : NSObject - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryClient.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryClient.h deleted file mode 100644 index 7b3275c9..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryClient.h +++ /dev/null @@ -1,23 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/64a7645a598b90e217be42333594c981a3ddc642/Sources/Sentry/Public/SentryClient.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import - -@interface SentryClient : NSObject - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDebugMeta.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDebugMeta.h deleted file mode 100644 index acfeaa42..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDebugMeta.h +++ /dev/null @@ -1,23 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/825b2e1f8aa0569f29f45b7ca2e2a72b41637660/Sources/Sentry/Public/SentryDebugMeta.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import - -@interface SentryDebugMeta : NSObject - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDefines.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDefines.h deleted file mode 100644 index 8a5d9845..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryDefines.h +++ /dev/null @@ -1,28 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/f893682911568e14782eb0bb507af5a12332b033/Sources/Sentry/Public/SentryDefines.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import - -typedef NS_ENUM(NSUInteger, SentryLevel) { - kSentryLevelNone = 0, - kSentryLevelDebug = 1, - kSentryLevelInfo = 2, - kSentryLevelWarning = 3, - kSentryLevelError = 4, - kSentryLevelFatal = 5 -}; diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryEvent.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryEvent.h deleted file mode 100644 index f2e487b4..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryEvent.h +++ /dev/null @@ -1,35 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/167de8bea5a0effef3aaa5c99c540088de30b361/Sources/Sentry/Public/SentryEvent.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import -#import -#import -#import -#import - -@interface SentryEvent : NSObject - -- (instancetype)initWithLevel:(enum SentryLevel)level NS_DESIGNATED_INITIALIZER; - -@property (nonatomic, strong, nonnull) SentryId *eventId; -@property (nonatomic, strong) NSDictionary *_Nullable tags; -@property (nonatomic, strong) NSArray *_Nullable threads; -@property (nonatomic, strong) NSArray *_Nullable exceptions; -@property (nonatomic, strong) NSArray *_Nullable debugMeta; - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryException.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryException.h deleted file mode 100644 index dfccefae..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryException.h +++ /dev/null @@ -1,31 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/167de8bea5a0effef3aaa5c99c540088de30b361/Sources/Sentry/Public/SentryException.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import -#import -#import - -@interface SentryException : NSObject - -- (instancetype)initWithValue:(NSString *_Nonnull)value type:(NSString *_Nonnull)type; - -@property (nonatomic, strong) SentryMechanism *_Nullable mechanism; -@property (nonatomic, copy) NSNumber *_Nullable threadId; -@property (nonatomic, strong) SentryStacktrace *_Nullable stacktrace; - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryId.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryId.h deleted file mode 100644 index c26c81f9..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryId.h +++ /dev/null @@ -1,23 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/167de8bea5a0effef3aaa5c99c540088de30b361/Sources/Sentry/Public/SentryId.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import - -@interface SentryId : NSObject - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryMechanism+NSExceptionKt.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryMechanism+NSExceptionKt.h deleted file mode 100644 index dc862d98..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryMechanism+NSExceptionKt.h +++ /dev/null @@ -1,22 +0,0 @@ -// https://github.com/rickclephas/NSExceptionKt/blob/master/nsexception-kt-sentry/src/nativeInterop/cinterop/Sentry/SentryThread%2BNSExceptionKt.h -// -// Copyright (c) 2022 Rick Clephas -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import -#import - -// When we create the NSNumber in Kotlin it isn't converted to a boolean, -// so we are using this wrapper function instead. -void NSExceptionKt_SentryMechanismSetNotHandled(SentryMechanism *mechanism) { - mechanism.handled = @(NO); -} diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryMechanism.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryMechanism.h deleted file mode 100644 index a5b611ec..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryMechanism.h +++ /dev/null @@ -1,27 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/167de8bea5a0effef3aaa5c99c540088de30b361/Sources/Sentry/Public/SentryMechanism.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import - -@interface SentryMechanism : NSObject - -- (instancetype)initWithType:(NSString *_Nonnull)type; - -@property (nonatomic, copy) NSNumber *_Nullable handled; - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryOptions.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryOptions.h deleted file mode 100644 index 34dd85f1..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryOptions.h +++ /dev/null @@ -1,23 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/678172142ac1d10f5ed7978f69d16ab03e801057/Sources/Sentry/Public/SentryOptions.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import - -@interface SentryOptions : NSObject - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentrySDK.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentrySDK.h deleted file mode 100644 index 4f98c0a8..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentrySDK.h +++ /dev/null @@ -1,26 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/167de8bea5a0effef3aaa5c99c540088de30b361/Sources/Sentry/Public/SentrySDK.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import -#import - -@interface SentrySDK : NSObject - -+ (void)configureScope:(void (^)(SentryScope *_Nonnull scope))callback; - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryScope.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryScope.h deleted file mode 100644 index 4480696a..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryScope.h +++ /dev/null @@ -1,25 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/678172142ac1d10f5ed7978f69d16ab03e801057/Sources/Sentry/Public/SentryScope.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import - -@interface SentryScope : NSObject - -- (void)setTagValue:(NSString *_Nonnull)value forKey:(NSString *_Nonnull)key; - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryStacktrace.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryStacktrace.h deleted file mode 100644 index 0b3d5c9d..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryStacktrace.h +++ /dev/null @@ -1,23 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/167de8bea5a0effef3aaa5c99c540088de30b361/Sources/Sentry/Public/SentryStacktrace.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import - -@interface SentryStacktrace : NSObject - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryThread+NSExceptionKt.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryThread+NSExceptionKt.h deleted file mode 100644 index ab60c8c3..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryThread+NSExceptionKt.h +++ /dev/null @@ -1,22 +0,0 @@ -// https://github.com/rickclephas/NSExceptionKt/blob/master/nsexception-kt-sentry/src/nativeInterop/cinterop/Sentry/SentryThread%2BNSExceptionKt.h -// -// Copyright (c) 2022 Rick Clephas -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import -#import - -// When we create the NSNumber in Kotlin it isn't converted to a boolean, -// so we are using this wrapper function instead. -void NSExceptionKt_SentryThreadSetCrashed(SentryThread *thread) { - thread.crashed = @(YES); -} diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryThread.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryThread.h deleted file mode 100644 index b2f0e997..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryNSException/SentryThread.h +++ /dev/null @@ -1,29 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/167de8bea5a0effef3aaa5c99c540088de30b361/Sources/Sentry/Public/SentryThread.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import -#import - -@interface SentryThread : NSObject - -@property (nonatomic, copy, nonnull) NSNumber *threadId; -@property (nonatomic, strong) SentryStacktrace *_Nullable stacktrace; -@property (nonatomic, copy) NSNumber *_Nullable crashed; -@property (nonatomic, copy) NSNumber *_Nullable current; - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryDefines.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryDefines.h deleted file mode 100644 index c963ec7b..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryDefines.h +++ /dev/null @@ -1,10 +0,0 @@ -#import - -typedef NS_ENUM(NSUInteger, SentryLevel) { - kSentryLevelNone = 0, - kSentryLevelDebug = 1, - kSentryLevelInfo = 2, - kSentryLevelWarning = 3, - kSentryLevelError = 4, - kSentryLevelFatal = 5 -}; diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryUser.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryUser.h deleted file mode 100644 index aa1b48f9..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryScope/SentryUser.h +++ /dev/null @@ -1,33 +0,0 @@ -NS_ASSUME_NONNULL_BEGIN - -NS_SWIFT_NAME(User) -@interface SentryUser : NSObject - -/** - * Optional: Id of the user - */ -@property (atomic, copy) NSString *userId; - -/** - * Optional: Email of the user - */ -@property (atomic, copy) NSString *_Nullable email; - -/** - * Optional: Username - */ -@property (atomic, copy) NSString *_Nullable username; - -/** - * Optional: IP Address - */ -@property (atomic, copy) NSString *_Nullable ipAddress; - -/** - * Optional: Additional data - */ -@property (atomic, strong) NSDictionary *_Nullable data; - -@end - -NS_ASSUME_NONNULL_END