Skip to content

Update bundled Cocoa SDK to version 7.31.4 #2096

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 21, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Add support for Portable PDB format ([#2050](https://github.com/getsentry/sentry-dotnet/pull/2050))
- Update bundled Android SDK to version 6.10.0([#2095](https://github.com/getsentry/sentry-dotnet/pull/2095))
- Update bundled Cocoa SDK to version 7.31.4 ([#2096](https://github.com/getsentry/sentry-dotnet/pull/2096))

## 3.24.1

Expand Down
2 changes: 1 addition & 1 deletion modules/sentry-cocoa
Submodule sentry-cocoa updated 69 files
+1 −1 .github/workflows/benchmarking.yml
+6 −3 .github/workflows/integration-tests.yml
+1 −1 .github/workflows/profile-data-generator.yml
+1 −1 .github/workflows/saucelabs-UI-tests.yml
+47 −3 .github/workflows/test.yml
+3 −0 .gitignore
+123 −29 Brewfile.lock.json
+26 −1 CHANGELOG.md
+3 −3 Gemfile.lock
+4 −0 Samples/TrendingMovies/TrendingMovies/TMDb/TMDbClient.swift
+4 −4 Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
+7 −3 Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
+38 −24 Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard
+7 −0 Samples/iOS-Swift/iOS-Swift/ViewController.swift
+21 −17 Samples/iOS-Swift/iOS13-Swift/AppDelegate.swift
+1 −1 Sentry.podspec
+22 −2 Sentry.xcodeproj/project.pbxproj
+6 −0 Sentry.xcodeproj/xcshareddata/xcschemes/Sentry.xcscheme
+1 −1 Sources/Configuration/Sentry.xcconfig
+19 −7 Sources/Sentry/SentryClient.m
+2 −3 Sources/Sentry/SentryCoreDataTracker.m
+3 −1 Sources/Sentry/SentryCrashIntegration.m
+1 −8 Sources/Sentry/SentryCrashWrapper.m
+54 −14 Sources/Sentry/SentryHub.m
+1 −1 Sources/Sentry/SentryMeta.m
+5 −4 Sources/Sentry/SentrySDK.m
+27 −11 Sources/Sentry/SentryUIApplication.m
+4 −4 Sources/Sentry/include/SentryClient+Private.h
+1 −5 Sources/Sentry/include/SentryCrashWrapper.h
+5 −3 Sources/Sentry/include/SentryHub+Private.h
+10 −0 Sources/Sentry/include/SentryUIApplication.h
+14 −0 Sources/SentryCrash/Installations/SentryCrashInstallation+Private.h
+5 −0 Sources/SentryCrash/Installations/SentryCrashInstallation.h
+17 −11 Sources/SentryCrash/Installations/SentryCrashInstallation.m
+7 −1 Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor.c
+8 −2 Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor.h
+49 −13 Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_MachException.c
+7 −0 Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_MachException.h
+17 −4 Sources/SentryCrash/Recording/SentryCrash.h
+73 −47 Sources/SentryCrash/Recording/SentryCrash.m
+8 −40 Sources/SentryCrash/Recording/SentryCrashC.c
+2 −7 Sources/SentryCrash/Recording/SentryCrashC.h
+6 −0 Sources/SentryCrash/Recording/SentryCrashCachedData.c
+1 −0 Sources/SentryCrash/Recording/SentryCrashCachedData.h
+0 −31 Sources/SentryCrash/Recording/Tools/SentryCrashLogger.c
+0 −11 Sources/SentryCrash/Recording/Tools/SentryCrashLogger.h
+3 −33 Sources/SentryCrash/Recording/Tools/SentryCrashMachineContext.c
+0 −6 Sources/SentryCrash/Recording/Tools/SentryCrashMachineContext.h
+30 −23 Tests/SentryTests/ClearTestState.swift
+12 −4 Tests/SentryTests/Helper/TestNSNotificationCenterWrapper.swift
+28 −0 Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackerTest.swift
+2 −0 Tests/SentryTests/Integrations/Performance/Network/SentryNetworkTrackerIntegrationTests.swift
+2 −2 Tests/SentryTests/Integrations/SentryCrash/SentryCrashIntegrationTests.swift
+5 −5 Tests/SentryTests/Integrations/Session/SentrySessionTrackerTests.swift
+16 −0 Tests/SentryTests/MockUIScene.h
+16 −0 Tests/SentryTests/MockUIScene.m
+84 −21 Tests/SentryTests/SentryClientTests.swift
+146 −0 Tests/SentryTests/SentryCrash/SentryCrashInstallationTests.m
+0 −25 Tests/SentryTests/SentryCrash/SentryCrashLogger_Tests.m
+1 −1 Tests/SentryTests/SentryCrash/SentryThreadInspectorTests.swift
+1 −1 Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.h
+3 −3 Tests/SentryTests/SentryCrash/TestSentryCrashWrapper.m
+105 −8 Tests/SentryTests/SentryHubTests.swift
+13 −1 Tests/SentryTests/SentrySDKTests.swift
+1 −0 Tests/SentryTests/SentryTests-Bridging-Header.h
+72 −0 Tests/SentryTests/SentryUIApplicationTests.swift
+8 −7 Tests/SentryTests/TestClient.swift
+7 −0 Tests/SentryTests/TestUtils/EmptyIntegration.swift
+14 −9 scripts/xcode-test.sh
79 changes: 41 additions & 38 deletions src/Sentry.Bindings.Cocoa/ApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,44 @@ interface Constants
NSString SentryErrorDomain { get; }
}

// Xamarin bug: Delegate types don't honor the [Internal] attribute.
// Workaround by using Func<T> or Action<T> instead.
// See: https://github.com/xamarin/xamarin-macios/issues/15299
// Leaving code commented here so we can more easily go back when the issue is fixed.

// // typedef void (^SentryRequestFinished)(NSError * _Nullable);
// [Internal]
// delegate void SentryRequestFinished ([NullAllowed] NSError arg0);
// typedef void (^SentryRequestFinished)(NSError * _Nullable);
[Internal]
delegate void SentryRequestFinished ([NullAllowed] NSError error);

// // typedef void (^SentryRequestOperationFinished)(NSHTTPURLResponse * _Nullable, NSError * _Nullable);
// [Internal]
// delegate void SentryRequestOperationFinished ([NullAllowed] NSHttpUrlResponse arg0, [NullAllowed] NSError arg1);
// typedef void (^SentryRequestOperationFinished)(NSHTTPURLResponse * _Nullable, NSError * _Nullable);
[Internal]
delegate void SentryRequestOperationFinished ([NullAllowed] NSHttpUrlResponse response, [NullAllowed] NSError error);

// // typedef SentryBreadcrumb * _Nullable (^SentryBeforeBreadcrumbCallback)(SentryBreadcrumb * _Nonnull);
// [Internal]
// delegate SentryBreadcrumb SentryBeforeBreadcrumbCallback (SentryBreadcrumb arg0);
// typedef SentryBreadcrumb * _Nullable (^SentryBeforeBreadcrumbCallback)(SentryBreadcrumb * _Nonnull);
[Internal]
[return: NullAllowed]
delegate SentryBreadcrumb SentryBeforeBreadcrumbCallback (SentryBreadcrumb breadcrumb);

// // typedef SentryEvent * _Nullable (^SentryBeforeSendEventCallback)(SentryEvent * _Nonnull);
// [Internal]
// delegate SentryEvent SentryBeforeSendEventCallback (SentryEvent arg0);
// typedef SentryEvent * _Nullable (^SentryBeforeSendEventCallback)(SentryEvent * _Nonnull);
[Internal]
[return: NullAllowed]
delegate SentryEvent SentryBeforeSendEventCallback (SentryEvent @event);

// // typedef void (^SentryOnCrashedLastRunCallback)(SentryEvent * _Nonnull);
// [Internal]
// delegate void SentryOnCrashedLastRunCallback (SentryEvent arg0);
// typedef void (^SentryOnCrashedLastRunCallback)(SentryEvent * _Nonnull);
[Internal]
delegate void SentryOnCrashedLastRunCallback (SentryEvent @event);

// // typedef BOOL (^SentryShouldQueueEvent)(NSHTTPURLResponse * _Nullable, NSError * _Nullable);
// [Internal]
// delegate bool SentryShouldQueueEvent ([NullAllowed] NSHttpUrlResponse arg0, [NullAllowed] NSError arg1);
// typedef BOOL (^SentryShouldQueueEvent)(NSHTTPURLResponse * _Nullable, NSError * _Nullable);
[Internal]
delegate bool SentryShouldQueueEvent ([NullAllowed] NSHttpUrlResponse response, [NullAllowed] NSError error);

// // typedef NSNumber * _Nullable (^SentryTracesSamplerCallback)(SentrySamplingContext * _Nonnull);
// [Internal]
// delegate NSNumber SentryTracesSamplerCallback (SentrySamplingContext arg0);
// typedef NSNumber * _Nullable (^SentryTracesSamplerCallback)(SentrySamplingContext * _Nonnull);
[Internal]
[return: NullAllowed]
delegate NSNumber SentryTracesSamplerCallback (SentrySamplingContext samplingContext);

// typedef void (^SentrySpanCallback)(id<SentrySpan> _Nullable);
// [Internal]
// delegate void SentrySpanCallback ([NullAllowed] SentrySpan arg0);
[Internal]
delegate void SentrySpanCallback ([NullAllowed] SentrySpan span);

// // typedef void (^SentryOnAppStartMeasurementAvailable)(SentryAppStartMeasurement * _Nullable);
// [Internal]
// delegate void SentryOnAppStartMeasurementAvailable ([NullAllowed] SentryAppStartMeasurement arg0);
// typedef void (^SentryOnAppStartMeasurementAvailable)(SentryAppStartMeasurement * _Nullable);
[Internal]
delegate void SentryOnAppStartMeasurementAvailable ([NullAllowed] SentryAppStartMeasurement appStartMeasurement);

// @interface PrivateSentrySDKOnly : NSObject
[BaseType (typeof(NSObject), Name="PrivateSentrySDKOnly")]
Expand Down Expand Up @@ -112,7 +110,7 @@ interface PrivateSentrySdkOnly
// @property (copy, nonatomic, class) SentryOnAppStartMeasurementAvailable _Nullable onAppStartMeasurementAvailable;
[Static]
[NullAllowed, Export ("onAppStartMeasurementAvailable", ArgumentSemantic.Copy)]
Action<SentryAppStartMeasurement?> OnAppStartMeasurementAvailable { get; set; }
SentryOnAppStartMeasurementAvailable OnAppStartMeasurementAvailable { get; set; }

// @property (readonly, nonatomic, class) SentryAppStartMeasurement * _Nullable appStartMeasurement;
[Static]
Expand Down Expand Up @@ -148,6 +146,11 @@ interface PrivateSentrySdkOnly
[Static]
[Export ("currentScreenFrames", ArgumentSemantic.Assign)]
SentryScreenFrames CurrentScreenFrames { get; }

// +(NSArray<NSData *> * _Nonnull)captureScreenshots;
[Static]
[Export ("captureScreenshots")]
NSData[] CaptureScreenshots();
}

// @interface SentryAppStartMeasurement : NSObject
Expand Down Expand Up @@ -881,15 +884,15 @@ interface SentryOptions

// @property (copy, nonatomic) SentryBeforeSendEventCallback _Nullable beforeSend;
[NullAllowed, Export ("beforeSend", ArgumentSemantic.Copy)]
Func<SentryEvent?, SentryEvent> BeforeSend { get; set; }
SentryBeforeSendEventCallback BeforeSend { get; set; }

// @property (copy, nonatomic) SentryBeforeBreadcrumbCallback _Nullable beforeBreadcrumb;
[NullAllowed, Export ("beforeBreadcrumb", ArgumentSemantic.Copy)]
Func<SentryBreadcrumb, SentryBreadcrumb?> BeforeBreadcrumb { get; set; }
SentryBeforeBreadcrumbCallback BeforeBreadcrumb { get; set; }

// @property (copy, nonatomic) SentryOnCrashedLastRunCallback _Nullable onCrashedLastRun;
[NullAllowed, Export ("onCrashedLastRun", ArgumentSemantic.Copy)]
Action<SentryEvent> OnCrashedLastRun { get; set; }
SentryOnCrashedLastRunCallback OnCrashedLastRun { get; set; }

// @property (copy, nonatomic) NSArray<NSString *> * _Nullable integrations;
[NullAllowed, Export ("integrations", ArgumentSemantic.Copy)]
Expand Down Expand Up @@ -978,7 +981,7 @@ interface SentryOptions

// @property (nonatomic) SentryTracesSamplerCallback _Nullable tracesSampler;
[NullAllowed, Export ("tracesSampler", ArgumentSemantic.Assign)]
Func<SentrySamplingContext, NSNumber?> TracesSampler { get; set; }
SentryTracesSamplerCallback TracesSampler { get; set; }

// @property (readonly, assign, nonatomic) BOOL isTracingEnabled;
[Export ("isTracingEnabled")]
Expand Down Expand Up @@ -1022,7 +1025,7 @@ interface SentryOptions

// @property (nonatomic) SentryTracesSamplerCallback _Nullable profilesSampler;
[NullAllowed, Export ("profilesSampler", ArgumentSemantic.Assign)]
Func<SentrySamplingContext, NSNumber?> ProfilesSampler { get; set; }
SentryTracesSamplerCallback ProfilesSampler { get; set; }

// @property (readonly, assign, nonatomic) BOOL isProfilingEnabled;
[Export ("isProfilingEnabled")]
Expand Down Expand Up @@ -1981,7 +1984,7 @@ interface SentryScope : SentrySerializable

// -(void)useSpan:(SentrySpanCallback _Nonnull)callback;
[Export ("useSpan:")]
void UseSpan (Action<SentrySpan?> callback);
void UseSpan (SentrySpanCallback callback);
}

// @interface SentryScreenFrames : NSObject
Expand Down
11 changes: 11 additions & 0 deletions src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
<None Include="buildTransitive\Sentry.Bindings.Cocoa.targets" Pack="true" PackagePath="buildTransitive\Sentry.Bindings.Cocoa.targets" />
</ItemGroup>

<!-- Workaround for https://github.com/xamarin/xamarin-macios/issues/15299 -->
<Target Name="_SetGeneratedSupportDelegatesInternal" BeforeTargets="CoreCompile">
<PropertyGroup>
<GeneratedSupportDelegatesFile>$(MSBuildThisFileDirectory)$(GeneratedSourcesDir)SupportDelegates.g.cs</GeneratedSupportDelegatesFile>
</PropertyGroup>
<WriteLinesToFile
File="$(GeneratedSupportDelegatesFile)"
Lines="$([System.IO.File]::ReadAllText($(GeneratedSupportDelegatesFile)).Replace('public delegate','internal delegate'))"
Overwrite="true" />
</Target>

<!-- Build the Sentry Cocoa SDK -->
<Target Name="_BuildSentryCocoaSDK" BeforeTargets="DispatchToInnerBuilds;BeforeBuild" Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<MSBuild Projects="$(MSBuildProjectFile)" Targets="_InnerBuildSentryCocoaSDK" Properties="TargetFramework=once" />
Expand Down