diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e0aab881b..4436f1bd6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Fix missing exception StackTraces in some situations ([#3215](https://github.com/getsentry/sentry-dotnet/pull/3215)) - Scopes now get applied to OTEL spans in ASP.NET Core ([#3221](https://github.com/getsentry/sentry-dotnet/pull/3221)) - Fixed InvalidCastException when setting the SampleRate on Android ([#3258](https://github.com/getsentry/sentry-dotnet/pull/3258)) +- Fixed MAUI iOS build issue related to `SentryVersionNumber` and `SentryVersionString` ([#3278](https://github.com/getsentry/sentry-dotnet/pull/3278)) ### API changes diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index a49124802f..2e37a8926c 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -139,17 +139,25 @@ $Text = $Text -replace '(?ms)@protocol (SentrySerializable|SentrySpan).+?\[Proto $Text = $Text -replace 'interface SentrySpan\b', "[BaseType (typeof(NSObject))]`n`$&" # Fix string constants -$Text = $Text -replace 'byte\[\] SentryVersionString', "[PlainString]`n NSString SentryVersionString" $Text = $Text -replace '(?m)(.*\n){2}^\s{4}NSString k.+?\n\n?', '' $Text = $Text -replace '(?m)(.*\n){4}^partial interface Constants\n{\n}\n', '' $Text = $Text -replace '\[Verify \(ConstantsInterfaceAssociation\)\]\n', '' +# Remove SentryVersionNumber +$Text = $Text -replace '.*SentryVersionNumber.*\n?', '' + +# Remove SentryVersionString +$Text = $Text -replace '.*SentryVersionString.*\n?', '' + # Remove duplicate attributes $s = 'partial interface Constants' $t = $Text -split $s, 2 $t[1] = $t[1] -replace "\[Static\]\n\[Internal\]\n$s", $s $Text = $t -join $s +# Remove empty Constants block +$Text = $Text -replace '\[Static\]\s*\[Internal\]\s*partial\s+interface\s+Constants\s\{[\s\n]*\}\n\n', '' + # Update MethodToProperty translations $Text = $Text -replace '(Export \("get\w+"\)\]\n)\s*\[Verify \(MethodToProperty\)\]\n(.+ \{ get; \})', '$1$2' $Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+ (?:Hash|Value|DefaultIntegrations) \{ get; \})', '$1' diff --git a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs index 924cb19a46..6cc492a195 100644 --- a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs @@ -10,20 +10,6 @@ namespace Sentry.CocoaSdk; -[Static] -[Internal] -partial interface Constants -{ - // extern double SentryVersionNumber; - [Field ("SentryVersionNumber", "__Internal")] - double SentryVersionNumber { get; } - - // extern const unsigned char[] SentryVersionString; - [Field ("SentryVersionString", "__Internal")] - [PlainString] - NSString SentryVersionString { get; } -} - // typedef void (^SentryRequestFinished)(NSError * _Nullable); [Internal] delegate void SentryRequestFinished ([NullAllowed] NSError error);