From a1cb4925cc483668bce3c27dc20edb324095552a Mon Sep 17 00:00:00 2001 From: GitHub Date: Wed, 22 Mar 2023 03:01:06 +0000 Subject: [PATCH 1/2] chore: update modules/sentry-cocoa to 8.3.2 --- CHANGELOG.md | 6 +++--- modules/sentry-cocoa | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dada16a733..a76d830201 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,9 +12,9 @@ ### Dependencies -- Bump Cocoa SDK from v8.3.0 to v8.3.1 ([#2237](https://github.com/getsentry/sentry-dotnet/pull/2237)) - - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#831) - - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.3.0...8.3.1) +- Bump Cocoa SDK from v8.3.0 to v8.3.2 ([#2237](https://github.com/getsentry/sentry-dotnet/pull/2237), [#2248](https://github.com/getsentry/sentry-dotnet/pull/2248)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#832) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.3.0...8.3.2) - Bump CLI from v2.14.4 to v2.15.2 ([#2238](https://github.com/getsentry/sentry-dotnet/pull/2238), [#2244](https://github.com/getsentry/sentry-dotnet/pull/2244)) - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2152) diff --git a/modules/sentry-cocoa b/modules/sentry-cocoa index 2e7899aff9..3fc79ea6eb 160000 --- a/modules/sentry-cocoa +++ b/modules/sentry-cocoa @@ -1 +1 @@ -Subproject commit 2e7899aff930ed3b8d81be1909492f7684bbd481 +Subproject commit 3fc79ea6ebcfd726e48bea1d98f89bc3a32d5cf2 From 77a69c578199f8195dfcdddf1375458b715bb47b Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Wed, 22 Mar 2023 12:28:00 -0700 Subject: [PATCH 2/2] Update bindings --- scripts/generate-cocoa-bindings.ps1 | 5 +- src/Sentry.Bindings.Cocoa/ApiDefinitions.cs | 318 +++++++++++------- .../PrivateApiDefinitions.cs | 6 +- 3 files changed, 201 insertions(+), 128 deletions(-) diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index d03bb4d38a..502e666d4f 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -22,14 +22,13 @@ if (!(Get-Command sharpie -ErrorAction SilentlyContinue)) { } # Generate bindings -# NOTE: We pull in SentryEnvelope.h manually, because it's in HybridPublic but not imported by PrivateSentrySDKOnly.h Write-Output 'Generating bindings with Objective Sharpie.' sharpie bind -sdk iphoneos -quiet ` -scope "$CocoaSdkPath/Carthage/Headers" ` "$CocoaSdkPath/Carthage/Headers/Sentry.h" ` "$CocoaSdkPath/Carthage/Headers/PrivateSentrySDKOnly.h" ` - "$CocoaSdkPath/Carthage/Headers/SentryEnvelope.h" ` - -o $BindingsPath + -o $BindingsPath ` + -c -Wno-objc-property-no-attribute # Ensure backup path exists if (!(Test-Path $BackupPath)) { diff --git a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs index 456c15870b..265c2f75cd 100644 --- a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs @@ -216,10 +216,6 @@ interface SentryClient [Export ("captureUserFeedback:")] void CaptureUserFeedback (SentryUserFeedback userFeedback); - // -(void)captureSession:(SentrySession * _Nonnull)session __attribute__((swift_name("capture(session:)"))); - [Export ("captureSession:")] - void CaptureSession (SentrySession session); - // -(void)flush:(NSTimeInterval)timeout __attribute__((swift_name("flush(timeout:)"))); [Export ("flush:")] void Flush (double timeout); @@ -1039,10 +1035,6 @@ interface SentryHub [Export ("initWithClient:andScope:")] NativeHandle Constructor ([NullAllowed] SentryClient client, [NullAllowed] SentryScope scope); - // @property (readonly, nonatomic, strong) SentrySession * _Nullable session; - [NullAllowed, Export ("session", ArgumentSemantic.Strong)] - SentrySession Session { get; } - // -(void)startSession; [Export ("startSession")] void StartSession (); @@ -2028,144 +2020,86 @@ interface SentryAppStartMeasurement NSDate DidFinishLaunchingTimestamp { get; } } -// @interface SentryScreenFrames : NSObject +// @interface SentrySdkInfo : NSObject [BaseType (typeof(NSObject))] [DisableDefaultCtor] [Internal] -interface SentryScreenFrames +interface SentrySdkInfo : SentrySerializable { - // -(instancetype _Nonnull)initWithTotal:(NSUInteger)total frozen:(NSUInteger)frozen slow:(NSUInteger)slow; - [Export ("initWithTotal:frozen:slow:")] - NativeHandle Constructor (nuint total, nuint frozen, nuint slow); - - // -(instancetype _Nonnull)initWithTotal:(NSUInteger)total frozen:(NSUInteger)frozen slow:(NSUInteger)slow slowFrameTimestamps:(SentryFrameInfoTimeSeries * _Nonnull)slowFrameTimestamps frozenFrameTimestamps:(SentryFrameInfoTimeSeries * _Nonnull)frozenFrameTimestamps frameRateTimestamps:(SentryFrameInfoTimeSeries * _Nonnull)frameRateTimestamps; - [Export ("initWithTotal:frozen:slow:slowFrameTimestamps:frozenFrameTimestamps:frameRateTimestamps:")] - NativeHandle Constructor (nuint total, nuint frozen, nuint slow, NSDictionary[] slowFrameTimestamps, NSDictionary[] frozenFrameTimestamps, NSDictionary[] frameRateTimestamps); - - // @property (readonly, assign, nonatomic) NSUInteger total; - [Export ("total")] - nuint Total { get; } - - // @property (readonly, assign, nonatomic) NSUInteger frozen; - [Export ("frozen")] - nuint Frozen { get; } + // @property (readonly, copy, nonatomic) NSString * _Nonnull name; + [Export ("name")] + string Name { get; } - // @property (readonly, assign, nonatomic) NSUInteger slow; - [Export ("slow")] - nuint Slow { get; } + // @property (readonly, copy, nonatomic) NSString * _Nonnull version; + [Export ("version")] + string Version { get; } - // @property (readonly, copy, nonatomic) SentryFrameInfoTimeSeries * _Nonnull slowFrameTimestamps; - [Export ("slowFrameTimestamps", ArgumentSemantic.Copy)] - NSDictionary[] SlowFrameTimestamps { get; } + // -(instancetype _Nonnull)initWithName:(NSString * _Nonnull)name andVersion:(NSString * _Nonnull)version __attribute__((objc_designated_initializer)); + [Export ("initWithName:andVersion:")] + [DesignatedInitializer] + NativeHandle Constructor (string name, string version); - // @property (readonly, copy, nonatomic) SentryFrameInfoTimeSeries * _Nonnull frozenFrameTimestamps; - [Export ("frozenFrameTimestamps", ArgumentSemantic.Copy)] - NSDictionary[] FrozenFrameTimestamps { get; } + // -(instancetype _Nonnull)initWithDict:(NSDictionary * _Nonnull)dict; + [Export ("initWithDict:")] + NativeHandle Constructor (NSDictionary dict); - // @property (readonly, copy, nonatomic) SentryFrameInfoTimeSeries * _Nonnull frameRateTimestamps; - [Export ("frameRateTimestamps", ArgumentSemantic.Copy)] - NSDictionary[] FrameRateTimestamps { get; } + // -(instancetype _Nonnull)initWithDict:(NSDictionary * _Nonnull)dict orDefaults:(SentrySdkInfo * _Nonnull)info; + [Export ("initWithDict:orDefaults:")] + NativeHandle Constructor (NSDictionary dict, SentrySdkInfo info); } -// typedef void (^SentryOnAppStartMeasurementAvailable)(SentryAppStartMeasurement * _Nullable); -[Internal] -delegate void SentryOnAppStartMeasurementAvailable ([NullAllowed] SentryAppStartMeasurement appStartMeasurement); - -// @interface PrivateSentrySDKOnly : NSObject +// @interface SentryTraceContext : NSObject [BaseType (typeof(NSObject))] [Internal] -interface PrivateSentrySDKOnly +interface SentryTraceContext : SentrySerializable { - // +(void)storeEnvelope:(SentryEnvelope * _Nonnull)envelope; - [Static] - [Export ("storeEnvelope:")] - void StoreEnvelope (SentryEnvelope envelope); - - // +(void)captureEnvelope:(SentryEnvelope * _Nonnull)envelope; - [Static] - [Export ("captureEnvelope:")] - void CaptureEnvelope (SentryEnvelope envelope); - - // +(SentryEnvelope * _Nullable)envelopeWithData:(NSData * _Nonnull)data; - [Static] - [Export ("envelopeWithData:")] - [return: NullAllowed] - SentryEnvelope EnvelopeWithData (NSData data); - - // +(NSArray * _Nonnull)getDebugImages; - [Static] - [Export ("getDebugImages")] - SentryDebugMeta[] DebugImages { get; } - - // +(void)setSdkName:(NSString * _Nonnull)sdkName andVersionString:(NSString * _Nonnull)versionString; - [Static] - [Export ("setSdkName:andVersionString:")] - void SetSdkName (string sdkName, string versionString); - - // +(void)setSdkName:(NSString * _Nonnull)sdkName; - [Static] - [Export ("setSdkName:")] - void SetSdkName (string sdkName); - - // +(NSString * _Nonnull)getSdkName; - [Static] - [Export ("getSdkName")] - string SdkName { get; } + // @property (readonly, nonatomic) SentryId * _Nonnull traceId; + [Export ("traceId")] + SentryId TraceId { get; } - // +(NSString * _Nonnull)getSdkVersionString; - [Static] - [Export ("getSdkVersionString")] - string SdkVersionString { get; } + // @property (readonly, nonatomic) NSString * _Nonnull publicKey; + [Export ("publicKey")] + string PublicKey { get; } - // @property (copy, nonatomic, class) SentryOnAppStartMeasurementAvailable _Nullable onAppStartMeasurementAvailable; - [Static] - [NullAllowed, Export ("onAppStartMeasurementAvailable", ArgumentSemantic.Copy)] - SentryOnAppStartMeasurementAvailable OnAppStartMeasurementAvailable { get; set; } + // @property (readonly, nonatomic) NSString * _Nullable releaseName; + [NullAllowed, Export ("releaseName")] + string ReleaseName { get; } - // @property (readonly, nonatomic, class) SentryAppStartMeasurement * _Nullable appStartMeasurement; - [Static] - [NullAllowed, Export ("appStartMeasurement")] - SentryAppStartMeasurement AppStartMeasurement { get; } + // @property (readonly, nonatomic) NSString * _Nullable environment; + [NullAllowed, Export ("environment")] + string Environment { get; } - // @property (readonly, copy, nonatomic, class) NSString * _Nonnull installationID; - [Static] - [Export ("installationID")] - string InstallationID { get; } + // @property (readonly, nonatomic) NSString * _Nullable transaction; + [NullAllowed, Export ("transaction")] + string Transaction { get; } - // @property (readonly, copy, nonatomic, class) SentryOptions * _Nonnull options; - [Static] - [Export ("options", ArgumentSemantic.Copy)] - SentryOptions Options { get; } + // @property (readonly, nonatomic) NSString * _Nullable userSegment; + [NullAllowed, Export ("userSegment")] + string UserSegment { get; } - // @property (assign, nonatomic, class) BOOL appStartMeasurementHybridSDKMode; - [Static] - [Export ("appStartMeasurementHybridSDKMode")] - bool AppStartMeasurementHybridSDKMode { get; set; } + // @property (nonatomic) NSString * _Nullable sampleRate; + [NullAllowed, Export ("sampleRate")] + string SampleRate { get; set; } - // @property (assign, nonatomic, class) BOOL framesTrackingMeasurementHybridSDKMode; - [Static] - [Export ("framesTrackingMeasurementHybridSDKMode")] - bool FramesTrackingMeasurementHybridSDKMode { get; set; } + // -(instancetype _Nonnull)initWithTraceId:(SentryId * _Nonnull)traceId publicKey:(NSString * _Nonnull)publicKey releaseName:(NSString * _Nullable)releaseName environment:(NSString * _Nullable)environment transaction:(NSString * _Nullable)transaction userSegment:(NSString * _Nullable)userSegment sampleRate:(NSString * _Nullable)sampleRate; + [Export ("initWithTraceId:publicKey:releaseName:environment:transaction:userSegment:sampleRate:")] + NativeHandle Constructor (SentryId traceId, string publicKey, [NullAllowed] string releaseName, [NullAllowed] string environment, [NullAllowed] string transaction, [NullAllowed] string userSegment, [NullAllowed] string sampleRate); - // @property (readonly, assign, nonatomic, class) BOOL isFramesTrackingRunning; - [Static] - [Export ("isFramesTrackingRunning")] - bool IsFramesTrackingRunning { get; } + // -(instancetype _Nullable)initWithScope:(SentryScope * _Nonnull)scope options:(SentryOptions * _Nonnull)options; + [Export ("initWithScope:options:")] + NativeHandle Constructor (SentryScope scope, SentryOptions options); - // @property (readonly, assign, nonatomic, class) SentryScreenFrames * _Nonnull currentScreenFrames; - [Static] - [Export ("currentScreenFrames", ArgumentSemantic.Assign)] - SentryScreenFrames CurrentScreenFrames { get; } + // -(instancetype _Nullable)initWithDict:(NSDictionary * _Nonnull)dictionary; + [Export ("initWithDict:")] + NativeHandle Constructor (NSDictionary dictionary); - // +(NSArray * _Nonnull)captureScreenshots; - [Static] - [Export ("captureScreenshots")] - NSData[] CaptureScreenshots(); + // -(instancetype _Nullable)initWithTracer:(SentryTracer * _Nonnull)tracer scope:(SentryScope * _Nullable)scope options:(SentryOptions * _Nonnull)options; + [Export ("initWithTracer:scope:options:")] + NativeHandle Constructor (SentryTracer tracer, [NullAllowed] SentryScope scope, SentryOptions options); - // +(NSData * _Nonnull)captureViewHierarchy; - [Static] - [Export ("captureViewHierarchy")] - NSData CaptureViewHierarchy(); + // -(SentryBaggage * _Nonnull)toBaggage; + [Export ("toBaggage")] + SentryBaggage ToBaggage(); } // @interface SentryEnvelopeHeader : NSObject @@ -2283,3 +2217,143 @@ interface SentryEnvelope [Export ("items", ArgumentSemantic.Strong)] SentryEnvelopeItem[] Items { get; } } + +// @interface SentryScreenFrames : NSObject +[BaseType (typeof(NSObject))] +[DisableDefaultCtor] +[Internal] +interface SentryScreenFrames +{ + // -(instancetype _Nonnull)initWithTotal:(NSUInteger)total frozen:(NSUInteger)frozen slow:(NSUInteger)slow; + [Export ("initWithTotal:frozen:slow:")] + NativeHandle Constructor (nuint total, nuint frozen, nuint slow); + + // -(instancetype _Nonnull)initWithTotal:(NSUInteger)total frozen:(NSUInteger)frozen slow:(NSUInteger)slow slowFrameTimestamps:(SentryFrameInfoTimeSeries * _Nonnull)slowFrameTimestamps frozenFrameTimestamps:(SentryFrameInfoTimeSeries * _Nonnull)frozenFrameTimestamps frameRateTimestamps:(SentryFrameInfoTimeSeries * _Nonnull)frameRateTimestamps; + [Export ("initWithTotal:frozen:slow:slowFrameTimestamps:frozenFrameTimestamps:frameRateTimestamps:")] + NativeHandle Constructor (nuint total, nuint frozen, nuint slow, NSDictionary[] slowFrameTimestamps, NSDictionary[] frozenFrameTimestamps, NSDictionary[] frameRateTimestamps); + + // @property (readonly, assign, nonatomic) NSUInteger total; + [Export ("total")] + nuint Total { get; } + + // @property (readonly, assign, nonatomic) NSUInteger frozen; + [Export ("frozen")] + nuint Frozen { get; } + + // @property (readonly, assign, nonatomic) NSUInteger slow; + [Export ("slow")] + nuint Slow { get; } + + // @property (readonly, copy, nonatomic) SentryFrameInfoTimeSeries * _Nonnull slowFrameTimestamps; + [Export ("slowFrameTimestamps", ArgumentSemantic.Copy)] + NSDictionary[] SlowFrameTimestamps { get; } + + // @property (readonly, copy, nonatomic) SentryFrameInfoTimeSeries * _Nonnull frozenFrameTimestamps; + [Export ("frozenFrameTimestamps", ArgumentSemantic.Copy)] + NSDictionary[] FrozenFrameTimestamps { get; } + + // @property (readonly, copy, nonatomic) SentryFrameInfoTimeSeries * _Nonnull frameRateTimestamps; + [Export ("frameRateTimestamps", ArgumentSemantic.Copy)] + NSDictionary[] FrameRateTimestamps { get; } +} + +// typedef void (^SentryOnAppStartMeasurementAvailable)(SentryAppStartMeasurement * _Nullable); +[Internal] +delegate void SentryOnAppStartMeasurementAvailable ([NullAllowed] SentryAppStartMeasurement appStartMeasurement); + +// @interface PrivateSentrySDKOnly : NSObject +[BaseType (typeof(NSObject))] +[Internal] +interface PrivateSentrySDKOnly +{ + // +(void)storeEnvelope:(SentryEnvelope * _Nonnull)envelope; + [Static] + [Export ("storeEnvelope:")] + void StoreEnvelope (SentryEnvelope envelope); + + // +(void)captureEnvelope:(SentryEnvelope * _Nonnull)envelope; + [Static] + [Export ("captureEnvelope:")] + void CaptureEnvelope (SentryEnvelope envelope); + + // +(SentryEnvelope * _Nullable)envelopeWithData:(NSData * _Nonnull)data; + [Static] + [Export ("envelopeWithData:")] + [return: NullAllowed] + SentryEnvelope EnvelopeWithData (NSData data); + + // +(NSArray * _Nonnull)getDebugImages; + [Static] + [Export ("getDebugImages")] + SentryDebugMeta[] DebugImages { get; } + + // +(void)setSdkName:(NSString * _Nonnull)sdkName andVersionString:(NSString * _Nonnull)versionString; + [Static] + [Export ("setSdkName:andVersionString:")] + void SetSdkName (string sdkName, string versionString); + + // +(void)setSdkName:(NSString * _Nonnull)sdkName; + [Static] + [Export ("setSdkName:")] + void SetSdkName (string sdkName); + + // +(NSString * _Nonnull)getSdkName; + [Static] + [Export ("getSdkName")] + string SdkName { get; } + + // +(NSString * _Nonnull)getSdkVersionString; + [Static] + [Export ("getSdkVersionString")] + string SdkVersionString { get; } + + // @property (copy, nonatomic, class) SentryOnAppStartMeasurementAvailable _Nullable onAppStartMeasurementAvailable; + [Static] + [NullAllowed, Export ("onAppStartMeasurementAvailable", ArgumentSemantic.Copy)] + SentryOnAppStartMeasurementAvailable OnAppStartMeasurementAvailable { get; set; } + + // @property (readonly, nonatomic, class) SentryAppStartMeasurement * _Nullable appStartMeasurement; + [Static] + [NullAllowed, Export ("appStartMeasurement")] + SentryAppStartMeasurement AppStartMeasurement { get; } + + // @property (readonly, copy, nonatomic, class) NSString * _Nonnull installationID; + [Static] + [Export ("installationID")] + string InstallationID { get; } + + // @property (readonly, copy, nonatomic, class) SentryOptions * _Nonnull options; + [Static] + [Export ("options", ArgumentSemantic.Copy)] + SentryOptions Options { get; } + + // @property (assign, nonatomic, class) BOOL appStartMeasurementHybridSDKMode; + [Static] + [Export ("appStartMeasurementHybridSDKMode")] + bool AppStartMeasurementHybridSDKMode { get; set; } + + // @property (assign, nonatomic, class) BOOL framesTrackingMeasurementHybridSDKMode; + [Static] + [Export ("framesTrackingMeasurementHybridSDKMode")] + bool FramesTrackingMeasurementHybridSDKMode { get; set; } + + // @property (readonly, assign, nonatomic, class) BOOL isFramesTrackingRunning; + [Static] + [Export ("isFramesTrackingRunning")] + bool IsFramesTrackingRunning { get; } + + // @property (readonly, assign, nonatomic, class) SentryScreenFrames * _Nonnull currentScreenFrames; + [Static] + [Export ("currentScreenFrames", ArgumentSemantic.Assign)] + SentryScreenFrames CurrentScreenFrames { get; } + + // +(NSArray * _Nonnull)captureScreenshots; + [Static] + [Export ("captureScreenshots")] + NSData[] CaptureScreenshots(); + + // +(NSData * _Nonnull)captureViewHierarchy; + [Static] + [Export ("captureViewHierarchy")] + NSData CaptureViewHierarchy(); +} diff --git a/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs index 7f218f7e5b..5e00bf9b34 100644 --- a/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/PrivateApiDefinitions.cs @@ -20,20 +20,20 @@ partial interface SentryScope [Internal] [DisableDefaultCtor] [BaseType (typeof(NSObject))] -interface SentrySession +interface SentryBaggage { } [Internal] [DisableDefaultCtor] [BaseType (typeof(NSObject))] -interface SentrySdkInfo +interface SentrySession { } [Internal] [DisableDefaultCtor] [BaseType (typeof(NSObject))] -interface SentryTraceContext +interface SentryTracer { }