Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
-->
<PropertyGroup Condition="'$(TargetFramework)' != ''">
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">13.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">15.0</SupportedOSPlatformVersion>
Copy link
Copy Markdown
Member

@Flash0ver Flash0ver Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: breaking change?

Just to be sure ... now that I actually write it down I don't think there is a breaking change for .NET MAUI 9 or .NET MAUI 10 consumers, but just to be sure:

Cocoa SDK v9 bumped the minimum iOS version to 15.0. Sentry .NET should probably bump SupportedOSPlatformVersion accordingly?

Yeah we can/should definitely do that then 👍🏻

In this Directory.Build.props, we declare:

<LatestIosTfm>net10.0-ios26</LatestIosTfm>
<PreviousIosTfm>net9.0-ios18.0</PreviousIosTfm>
<LatestMacCatalystTfm>net10.0-maccatalyst26</LatestMacCatalystTfm>
<PreviousMacCatalystTfm>net9.0-maccatalyst18.0</PreviousMacCatalystTfm>

In the .NET MAUI SDK Sentry.Maui, we then use:

<TargetFrameworks>$(LatestTfm);$(PreviousTfm)</TargetFrameworks>
<TargetFrameworks Condition="'$(NO_ANDROID)' == ''">$(TargetFrameworks);$(LatestAndroidTfm);$(PreviousAndroidTfm)</TargetFrameworks>
<TargetFrameworks Condition="'$(NO_IOS)' == '' And $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);$(LatestIosTfm);$(PreviousIosTfm)</TargetFrameworks>
<TargetFrameworks Condition="'$(NO_MACCATALYST)' == '' And $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);$(LatestMacCatalystTfm);$(PreviousMacCatalystTfm)</TargetFrameworks>
<TargetFrameworks Condition="'$(NO_WINDOWS)' == '' And !$([MSBuild]::IsOSPlatform('Linux'))">$(TargetFrameworks);$(PreviousWindowsTfm)</TargetFrameworks>

Just to make sure:
Our in this changeset unchanged iOS and Mac Catalyst version is 18.0 for .NET 9 (and 26.0 for .NET 10),
and now bumping sentry-cocoa to 9.2.0, where 9.0.0 notes

### Breaking Changes
- Bumped minimum OS versions to iOS 15.0, macOS 10.14.0, tvOS 15.0, visionOS 1.0, and watchOS 8.0 (https://github.com/getsentry/sentry-cocoa/pull/6873)

we are not introducing any breaking changes, are we?

Also considering the related conversation from the preceding changeset of

And also considering the Supported platforms for .NET MAUI apps.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from #4781 (comment), on which I'll follow up on Monday.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means anyone using the apps developed by Sentry SDK customers would need to upgrades from iOS 13 to 15 in order to be able to continue to use those apps... so it's not breaking for our SDK users and it's just part of the normal phasing out of old platforms for Apple.

<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">13.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
Expand Down
2 changes: 1 addition & 1 deletion modules/sentry-cocoa.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 8.57.3
version = 9.2.0
repo = https://github.com/getsentry/sentry-cocoa
Comment thread
jamescrosswell marked this conversation as resolved.
Comment thread
sentry[bot] marked this conversation as resolved.
Comment thread
sentry[bot] marked this conversation as resolved.
2 changes: 1 addition & 1 deletion samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">13.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate-cocoa-bindings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ foreach ($file in $filesToPatch)
Write-Host "File not found: $file"
}
}
$privateHeaderFile = "$PrivateHeadersPath/PrivatesHeader.h"
$privateHeaderFile = "$HeadersPath/PrivatesHeader.h"
if (Test-Path $privateHeaderFile)
{
$content = Get-Content -Path $privateHeaderFile -Raw
Expand Down Expand Up @@ -169,7 +169,7 @@ sharpie bind -sdk $iPhoneSdkVersion `
-scope "$CocoaSdkPath" `
"$HeadersPath/Sentry.h" `
"$HeadersPath/Sentry-Swift.h" `
"$PrivateHeadersPath/PrivateSentrySDKOnly.h" `
"$HeadersPath/PrivateSentrySDKOnly.h" `
-o $BindingsPath `
-c -Wno-objc-property-no-attribute `
-F"$iPhoneSdkPath/System/Library/SubFrameworks" # needed for UIUtilities.framework in Xcode 26+
Expand Down
70 changes: 60 additions & 10 deletions scripts/patch-cocoa-bindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
.WithAttribute("SentryBeforeBreadcrumbCallback", "return: NullAllowed")
.WithAttribute("SentryBeforeSendEventCallback", "return: NullAllowed")
.WithAttribute("SentryTracesSamplerCallback", "return: NullAllowed")
// Fix nullable return attributes
.RemoveAttribute("PrivateSentrySDKOnly", "CaptureScreenshots", "NullAllowed")
.RemoveAttribute("PrivateSentrySDKOnly", "CaptureViewHierarchy", "NullAllowed")
.WithAttribute("PrivateSentrySDKOnly", "CaptureScreenshots", "return: NullAllowed")
.WithAttribute("PrivateSentrySDKOnly", "CaptureViewHierarchy", "return: NullAllowed")
// For PrivateApiDefinitions.cs
.WithModifier("SentryScope", "partial")
// error CS0246: The type or namespace name 'iOS' could not be found
Expand All @@ -84,24 +89,28 @@
.RemoveMethod("Sentry*", "IsEqual")
// error CS0246: The type or namespace name '_NSZone' could not be found
.RemoveMethod("Sentry*", "CopyWithZone")
// error CS0111: Type 'SentryAttribute' already defines a member called 'Constructor' with the same parameter types
.RemoveMethod("SentryLog", "SetAttribute")
// SentryEnvelope* is not whitelisted
.RemoveMethod("PrivateSentrySDKOnly", "CaptureEnvelope")
.RemoveMethod("PrivateSentrySDKOnly", "EnvelopeWithData")
.RemoveMethod("PrivateSentrySDKOnly", "StoreEnvelope")
// deprecated
.RemoveMethod("Sentry*", "CaptureUserFeedback")
// SentryLoggerDelegate and SentryCurrentDateProvider are not whitelisted
.RemoveMethod("SentryLogger", "Constructor")
// SentryAppStartMeasurement is not whitelisted
.RemoveDelegate("SentryOnAppStartMeasurementAvailable")
// deprecated
// unused
.RemoveDelegate("SentryUserFeedbackConfigurationBlock")
// error CS0114: 'SentryXxx.Description' hides inherited member 'NSObject.Description'.
.RemoveProperty("Sentry*", "Description")
// SentryAppStartMeasurement is not whitelisted
.RemoveProperty("PrivateSentrySDKOnly", "*AppStartMeasurement*")
// SentryStructuredLogAttribute is not whitelisted
.RemoveProperty("SentryLog", "Attributes")
// deprecated
// Minimize SentryDependencyContainer
.RemoveMethod("SentryDependencyContainer", "*")
.KeepProperties("SentryDependencyContainer", "SharedInstance", "DebugImageProvider")
// SentryUserFeedbackConfiguration is not whitelisted
.RemoveProperty("SentryOptions", "ConfigureUserFeedback")
.RemoveProperty("SentryOptions", "UserFeedbackConfiguration")
.KeepInterfaces(
"ISentryRRWebEvent",
"PrivateSentrySDKOnly",
Expand All @@ -111,6 +120,7 @@
"SentryClient",
"SentryDebugImageProvider",
"SentryDebugMeta",
"SentryDependencyContainer",
"SentryDsn",
"SentryEvent",
"SentryException",
Expand All @@ -129,7 +139,7 @@
"SentryMeasurementUnitFraction",
"SentryMeasurementUnitInformation",
"SentryMechanism",
"SentryMechanismMeta",
"SentryMechanismContext",
Comment thread
cursor[bot] marked this conversation as resolved.
"SentryMessage",
"SentryNSError",
"SentryOptions",
Expand Down Expand Up @@ -157,9 +167,8 @@
"SentryViewScreenshotOptions",
"SentryViewScreenshotProvider"
)
// Rename and retarget the experimental options property
.RenameProperty("SentryOptions", "_swiftExperimentalOptions", "Experimental")
.ChangePropertyType("SentryOptions", "Experimental", "SentryExperimentalOptions");
// error CS0311: The type 'SentryXxx' cannot be used as type parameter 'TValue' in the generic type or method 'NSDictionary<TKey, TValue>'.
.ChangeGenericTypeArgument("NSDictionary", "Sentry*", "NSObject");
Comment thread
cursor[bot] marked this conversation as resolved.

var formatted = CodeFormatter.Format(nodes, new AdhocWorkspace());
File.WriteAllText(args[0], formatted.ToFullString() + "\n");
Expand Down Expand Up @@ -219,6 +228,19 @@ public static CompilationUnitSyntax RemoveAttribute(
.RemoveByPredicate<AttributeListSyntax>(node => node.Attributes.Count == 0);
}

public static CompilationUnitSyntax RemoveAttribute(
this CompilationUnitSyntax root,
string type,
string name,
string attribute)
{
return root.RemoveByPredicate<AttributeSyntax>(node =>
node.Name.Matches(attribute) &&
node.Parent?.Parent is MethodDeclarationSyntax method &&
method.Identifier.Matches(name) &&
method.HasParent(type));
}

public static CompilationUnitSyntax RemoveBaseType(
this CompilationUnitSyntax root,
string name)
Expand Down Expand Up @@ -275,6 +297,18 @@ public static CompilationUnitSyntax WithAttribute(
return root.ReplaceNodes(nodes, (node, _) => node.WithAttribute(attribute));
}

public static CompilationUnitSyntax WithAttribute(
this CompilationUnitSyntax root,
string type,
string name,
string attribute)
{
var nodes = root.DescendantNodes()
.OfType<MethodDeclarationSyntax>()
.Where(node => node.Identifier.Matches(name) && node.HasParent(type) && !node.HasAttribute(attribute));
return root.ReplaceNodes(nodes, (node, _) => node.WithAttribute(attribute));
}

public static CompilationUnitSyntax AsInternal(
this CompilationUnitSyntax root,
string name,
Expand Down Expand Up @@ -417,6 +451,22 @@ public static CompilationUnitSyntax ChangePropertyType(
return root.ReplaceNodes(nodes, (node, _) => node.WithType(SyntaxFactory.ParseTypeName(newType)));
}

public static CompilationUnitSyntax ChangeGenericTypeArgument(
this CompilationUnitSyntax root,
string type,
string from,
string to)
{
var nodes = root.DescendantNodes()
.OfType<GenericNameSyntax>()
.Where(node => node.Identifier.Matches(type) && node.TypeArgumentList.Arguments.Any(arg => arg.Matches(from)));

return root.ReplaceNodes(nodes, (node, _) =>
{
var args = node.TypeArgumentList.Arguments.Select(arg => arg.Matches(from) ? SyntaxFactory.ParseTypeName(to) : arg);
return node.WithTypeArgumentList(node.TypeArgumentList.WithArguments(SyntaxFactory.SeparatedList(args)));
});
}
}

internal static class SyntaxNodeExtensions
Expand Down
Loading
Loading