Skip to content

Commit

Permalink
chore(deps): update Cocoa SDK to v8.30.0 (#3450)
Browse files Browse the repository at this point in the history
* chore: update modules/sentry-cocoa to 8.30.0

---------

Co-authored-by: GitHub <noreply@github.com>
Co-authored-by: bitsandfoxes <reg@bitfox.at>
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
  • Loading branch information
4 people committed Jul 8, 2024
1 parent 5b35d8e commit 8298362
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 127 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
- Bump Native SDK from v0.7.4 to v0.7.6 ([#3399](https://github.com/getsentry/sentry-dotnet/pull/3399), [#3418](https://github.com/getsentry/sentry-dotnet/pull/3418))
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#076)
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.4...0.7.6)
- Bump Cocoa SDK from v8.26.0 to v8.29.1 ([#3408](https://github.com/getsentry/sentry-dotnet/pull/3408), [#3412](https://github.com/getsentry/sentry-dotnet/pull/3412), [#3430](https://github.com/getsentry/sentry-dotnet/pull/3430))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8291)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.26.0...8.29.1)
- Bump Cocoa SDK from v8.26.0 to v8.30.0 ([#3408](https://github.com/getsentry/sentry-dotnet/pull/3408), [#3412](https://github.com/getsentry/sentry-dotnet/pull/3412), [#3430](https://github.com/getsentry/sentry-dotnet/pull/3430), [#3450](https://github.com/getsentry/sentry-dotnet/pull/3450))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8300)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.26.0...8.30.0)
- Bump Java SDK from v7.9.0 to v7.10.0 ([#3413](https://github.com/getsentry/sentry-dotnet/pull/3413))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7100)
- [diff](https://github.com/getsentry/sentry-java/compare/7.9.0...7.10.0)
Expand Down
2 changes: 1 addition & 1 deletion modules/sentry-cocoa
Submodule sentry-cocoa updated 105 files
121 changes: 71 additions & 50 deletions scripts/generate-cocoa-bindings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Write-Output 'Generating bindings with Objective Sharpie.'
sharpie bind -sdk $iPhoneSdkVersion `
-scope "$CocoaSdkPath/Carthage/Headers" `
"$CocoaSdkPath/Carthage/Headers/Sentry.h" `
"$CocoaSdkPath/Carthage/Headers/Sentry-Swift.h" `
"$CocoaSdkPath/Carthage/Headers/PrivateSentrySDKOnly.h" `
-o $BindingsPath `
-c -Wno-objc-property-no-attribute
Expand Down Expand Up @@ -90,6 +89,41 @@ $Text = $Text -replace '\bpublic\b', 'internal'
# Remove static CFunctions class
$Text = $Text -replace '(?ms)\nstatic class CFunctions.*?}\n', ''

# This enum resides in the Sentry-Swift.h
# Appending it here so we don't need to import and create bindings for the entire header
$SentryLevel = @'
[Native]
internal enum SentryLevel : ulong
{
None = 0,
Debug = 1,
Info = 2,
Warning = 3,
Error = 4,
Fatal = 5
}
'@

# This enum resides in the Sentry-Swift.h
# Appending it here so we don't need to import and create bindings for the entire header
$SentryTransactionNameSource = @'
[Native]
internal enum SentryTransactionNameSource : long
{
Custom = 0,
Url = 1,
Route = 2,
View = 3,
Component = 4,
Task = 5
}
'@

$Text += "`r`n$SentryLevel"
$Text += "`r`n$SentryTransactionNameSource"

# Add header and output file
$Text = "$Header`n`n$Text"
$Text | Out-File "$BindingsPath/$File"
Expand Down Expand Up @@ -189,55 +223,6 @@ $Text = $Text -replace '.*SentryEnvelope .*?[\s\S]*?\n\n', ''
$Text = $Text -replace '.*typedef.*SentryOnAppStartMeasurementAvailable.*?[\s\S]*?\n\n', ''
$Text = $Text -replace '\n.*SentryReplayBreadcrumbConverter.*?[\s\S]*?\);\n', ''

$protocolsToRemove = @(
'SentryMXManagerDelegate',
'SentryMetricsAPIDelegate',
'SentryReplayVideoMaker',
'SentryViewScreenshotProvider',
'SentryRedactOptions',
'SentryReplayBreadcrumbConverter'
)

foreach ($protocol in $protocolsToRemove) {
$Text = $Text -replace ".*protocol $protocol.*?[\s\S]*?[^ ]\}\n\n", ''
}

$interfacesToRemove = @(
'HTTPHeaderSanitizer',
'LocalMetricsAggregator',
'NSURLSessionTask',
'SentryBaggageSerialization',
'SentryCurrentDateProvider',
'SentryEnabledFeaturesBuilder',
'SentryExperimentalOptions',
'SentryMXCallStack',
'SentryMXCallStackTree',
'SentryMXFrame',
'SentryMXManager',
'SentryMetricsAPI',
'SentryMetricsClient',
'SentryOnDemandReplay',
'SentryReplayOptions',
'SentryRRWebEvent',
'SentryRRWebCustomEvent',
'SentryRRWebBreadcrumbEvent',
'SentryRRWebMetaEvent',
'SentryRRWebSpanEvent',
'SentryRRWebVideoEvent',
'SentryReplayBreadcrumbConverter',
'SentryReplayRecording',
'SentryTouchTracker',
'SentryVideoInfo',
'SentryViewPhotographer',
'SwiftDescriptor',
'UrlSanitized',
'URLSessionTaskHelper'
)

foreach ($interface in $interfacesToRemove) {
$Text = $Text -replace ".*interface.*$interface.*?[\s\S]*?[^ ]\}\n\n", ''
}

$propertiesToRemove = @(
'SentryAppStartMeasurement',
'SentryOnAppStartMeasurementAvailable',
Expand All @@ -251,6 +236,42 @@ foreach ($property in $propertiesToRemove) {
$Text = $Text -replace "\n.*property.*$property.*?[\s\S]*?\}\n", ''
}

# This interface resides in the Sentry-Swift.h
# Appending it here so we don't need to import and create bindings for the entire header
$SentryId = @'
// @interface SentryId : NSObject
[BaseType (typeof(NSObject), Name = "_TtC6Sentry8SentryId")]
[Internal]
interface SentryId
{
// @property (nonatomic, strong, class) SentryId * _Nonnull empty;
[Static]
[Export ("empty", ArgumentSemantic.Strong)]
SentryId Empty { get; set; }
// @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString;
[Export ("sentryIdString")]
string SentryIdString { get; }
// -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid __attribute__((objc_designated_initializer));
[Export ("initWithUuid:")]
[DesignatedInitializer]
NativeHandle Constructor (NSUuid uuid);
// -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString __attribute__((objc_designated_initializer));
[Export ("initWithUUIDString:")]
[DesignatedInitializer]
NativeHandle Constructor (string uuidString);
// @property (readonly, nonatomic) NSUInteger hash;
[Export ("hash")]
nuint Hash { get; }
}
'@

$Text += "`r`n$SentryId"

# Add header and output file
$Text = "$Header`n`n$Text"
$Text | Out-File "$BindingsPath/$File"
130 changes: 67 additions & 63 deletions src/Sentry.Bindings.Cocoa/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

using System;
using Foundation;
using MetricKit;
using ObjCRuntime;
using UIKit;

namespace Sentry.CocoaSdk;

Expand All @@ -30,6 +28,10 @@ namespace Sentry.CocoaSdk;
[return: NullAllowed]
delegate SentryEvent SentryBeforeSendEventCallback (SentryEvent @event);

// typedef id<SentrySpan> _Nullable (^SentryBeforeSendSpanCallback)(id<SentrySpan> _Nonnull);
[Internal]
delegate SentrySpan SentryBeforeSendSpanCallback (SentrySpan span);

// typedef BOOL (^SentryBeforeCaptureScreenshotCallback)(SentryEvent * _Nonnull);
[Internal]
delegate bool SentryBeforeCaptureScreenshotCallback (SentryEvent @event);
Expand Down Expand Up @@ -1257,6 +1259,10 @@ interface SentryOptions
[NullAllowed, Export ("beforeSend", ArgumentSemantic.Copy)]
SentryBeforeSendEventCallback BeforeSend { get; set; }

// @property (copy, nonatomic) SentryBeforeSendSpanCallback _Nullable beforeSendSpan;
[NullAllowed, Export ("beforeSendSpan", ArgumentSemantic.Copy)]
SentryBeforeSendSpanCallback BeforeSendSpan { get; set; }

// @property (copy, nonatomic) SentryBeforeBreadcrumbCallback _Nullable beforeBreadcrumb;
[NullAllowed, Export ("beforeBreadcrumb", ArgumentSemantic.Copy)]
SentryBeforeBreadcrumbCallback BeforeBreadcrumb { get; set; }
Expand Down Expand Up @@ -1702,6 +1708,16 @@ interface SentrySDK
[Export ("reportFullyDisplayed")]
void ReportFullyDisplayed ();

// +(void)pauseAppHangTracking;
[Static]
[Export ("pauseAppHangTracking")]
void PauseAppHangTracking ();

// +(void)resumeAppHangTracking;
[Static]
[Export ("resumeAppHangTracking")]
void ResumeAppHangTracking ();

// +(void)flush:(NSTimeInterval)timeout __attribute__((swift_name("flush(timeout:)")));
[Static]
[Export ("flush:")]
Expand Down Expand Up @@ -2022,8 +2038,8 @@ interface SentryUser : SentrySerializable
[NullAllowed, Export ("ipAddress")]
string IpAddress { get; set; }

// @property (copy, atomic) NSString * _Nullable segment;
[NullAllowed, Export ("segment")]
// @property (copy, atomic) DEPRECATED_MSG_ATTRIBUTE("This field is deprecated and will be removed in the next major update.") NSString * segment __attribute__((deprecated("This field is deprecated and will be removed in the next major update.")));
[Export ("segment")]
string Segment { get; set; }

// @property (copy, atomic) NSString * _Nullable name;
Expand Down Expand Up @@ -2078,52 +2094,6 @@ interface SentryUserFeedback : SentrySerializable
string Comments { get; set; }
}

// @interface SentryId : NSObject
[BaseType (typeof(NSObject), Name = "_TtC6Sentry8SentryId")]
[Internal]
interface SentryId
{
// @property (nonatomic, strong, class) SentryId * _Nonnull empty;
[Static]
[Export ("empty", ArgumentSemantic.Strong)]
SentryId Empty { get; set; }

// @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString;
[Export ("sentryIdString")]
string SentryIdString { get; }

// -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid __attribute__((objc_designated_initializer));
[Export ("initWithUuid:")]
[DesignatedInitializer]
NativeHandle Constructor (NSUuid uuid);

// -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString __attribute__((objc_designated_initializer));
[Export ("initWithUUIDString:")]
[DesignatedInitializer]
NativeHandle Constructor (string uuidString);

// @property (readonly, nonatomic) NSUInteger hash;
[Export ("hash")]
nuint Hash { get; }
}

// @protocol SentryIntegrationProtocol <NSObject>
[Protocol (Name = "_TtP6Sentry25SentryIntegrationProtocol_")]
[BaseType (typeof(NSObject), Name = "_TtP6Sentry25SentryIntegrationProtocol_")]
[Internal]
interface SentryIntegrationProtocol
{
// @required -(BOOL)installWithOptions:(SentryOptions * _Nonnull)options __attribute__((warn_unused_result("")));
[Abstract]
[Export ("installWithOptions:")]
bool InstallWithOptions (SentryOptions options);

// @required -(void)uninstall;
[Abstract]
[Export ("uninstall")]
void Uninstall ();
}

// @interface SentryScreenFrames : NSObject <NSCopying>
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -2259,20 +2229,10 @@ interface PrivateSentrySDKOnly
[Export ("captureViewHierarchy")]
NSData CaptureViewHierarchy();

// +(NSDictionary<NSString *,id> * _Nullable)appStartMeasurementWithSpans;
[Static]
[NullAllowed, Export ("appStartMeasurementWithSpans")]
NSDictionary<NSString, NSObject> AppStartMeasurementWithSpans();

// +(SentryUser * _Nonnull)userWithDictionary:(NSDictionary * _Nonnull)dictionary;
[Static]
[Export ("userWithDictionary:")]
SentryUser UserWithDictionary (NSDictionary dictionary);

// +(SentryBreadcrumb * _Nonnull)breadcrumbWithDictionary:(NSDictionary * _Nonnull)dictionary;
// +(void)setCurrentScreen:(NSString * _Nonnull)screenName;
[Static]
[Export ("breadcrumbWithDictionary:")]
SentryBreadcrumb BreadcrumbWithDictionary (NSDictionary dictionary);
[Export ("setCurrentScreen:")]
void SetCurrentScreen (string screenName);

// +(void)captureReplay;
[Static]
Expand All @@ -2293,4 +2253,48 @@ interface PrivateSentrySDKOnly
[Static]
[Export ("addReplayRedactClasses:")]
void AddReplayRedactClasses (Class[] classes);

// +(NSDictionary<NSString *,id> * _Nullable)appStartMeasurementWithSpans;
[Static]
[NullAllowed, Export ("appStartMeasurementWithSpans")]
NSDictionary<NSString, NSObject> AppStartMeasurementWithSpans();

// +(SentryUser * _Nonnull)userWithDictionary:(NSDictionary * _Nonnull)dictionary;
[Static]
[Export ("userWithDictionary:")]
SentryUser UserWithDictionary (NSDictionary dictionary);

// +(SentryBreadcrumb * _Nonnull)breadcrumbWithDictionary:(NSDictionary * _Nonnull)dictionary;
[Static]
[Export ("breadcrumbWithDictionary:")]
SentryBreadcrumb BreadcrumbWithDictionary (NSDictionary dictionary);
}

// @interface SentryId : NSObject
[BaseType (typeof(NSObject), Name = "_TtC6Sentry8SentryId")]
[Internal]
interface SentryId
{
// @property (nonatomic, strong, class) SentryId * _Nonnull empty;
[Static]
[Export ("empty", ArgumentSemantic.Strong)]
SentryId Empty { get; set; }

// @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString;
[Export ("sentryIdString")]
string SentryIdString { get; }

// -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid __attribute__((objc_designated_initializer));
[Export ("initWithUuid:")]
[DesignatedInitializer]
NativeHandle Constructor (NSUuid uuid);

// -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString __attribute__((objc_designated_initializer));
[Export ("initWithUUIDString:")]
[DesignatedInitializer]
NativeHandle Constructor (string uuidString);

// @property (readonly, nonatomic) NSUInteger hash;
[Export ("hash")]
nuint Hash { get; }
}
9 changes: 0 additions & 9 deletions src/Sentry.Bindings.Cocoa/StructsAndEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,6 @@ internal enum SentryLevel : ulong
Fatal = 5
}

[Native]
internal enum SentryRRWebEventType : long
{
None = 0,
Touch = 3,
Meta = 4,
Custom = 5
}

[Native]
internal enum SentryTransactionNameSource : long
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry/Platforms/Cocoa/Extensions/UserExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static CocoaSdk.SentryUser ToCocoaUser(this SentryUser user)
IpAddress = user.IpAddress,
Username = user.Username,
#pragma warning disable CS0618 // Type or member is obsolete
Segment = user.Segment,
Segment = user.Segment ?? "",
#pragma warning restore CS0618 // Type or member is obsolete
Data = user.Other.ToNullableNSDictionary()
};
Expand Down

0 comments on commit 8298362

Please sign in to comment.