@@ -49,14 +49,14 @@ if (!(Test-Path '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/
4949 # Verify checksum
5050 Write-Output " Verifying package checksum..."
5151 $actualSha256 = (Get-FileHash - Path $downloadPath - Algorithm SHA256).Hash.ToLower()
52-
52+
5353 if ($actualSha256 -ne $expectedSha256 )
5454 {
5555 Write-Error " Checksum verification failed. Expected: $expectedSha256 , Actual: $actualSha256 "
5656 Remove-Item $downloadPath - Force - ErrorAction SilentlyContinue
5757 exit 1
5858 }
59-
59+
6060 Write-Output " Checksum verification passed."
6161
6262 if (Test-Path $downloadPath )
@@ -108,7 +108,7 @@ foreach ($file in $filesToPatch)
108108 {
109109 $content = Get-Content - Path $file - Raw
110110 $content = $content -replace ' <Sentry/([^>]+)>' , ' "$1"'
111- $content = $content -replace ' #import SENTRY_HEADER\(([^)]+)\)' , ' #import "$1.h"'
111+ $content = $content -replace ' #\s* import SENTRY_HEADER\(([^)]+)\)' , ' #import "$1.h"'
112112 Set-Content - Path $file - Value $content
113113 }
114114 else
@@ -209,7 +209,10 @@ $Text = $Text -replace '\bISentrySerializable\b', 'SentrySerializable'
209209$Text = $Text -replace ' : INSCopying,' , ' :' -replace ' \s?[:,] INSCopying' , ' '
210210
211211# Remove iOS attributes like [iOS (13, 0)]
212- $Text = $Text -replace ' \[iOS \(13,\s?0\)\]\n?' , ' '
212+ $Text = $Text -replace ' \[iOS \(13,\s?0\)\]\n?\s*' , ' '
213+
214+ # Remove Unavailable attributes like [Unavailable (PlatformName.iOSAppExtension)]
215+ $Text = $Text -replace ' \[Unavailable \(PlatformName\.\w+\)\]\n?\s*' , ' '
213216
214217# Fix delegate argument names
215218$Text = $Text -replace ' (NSError) arg\d' , ' $1 error'
@@ -219,6 +222,7 @@ $Text = $Text -replace '(SentrySamplingContext) arg\d', '$1 samplingContext'
219222$Text = $Text -replace ' (SentryBreadcrumb) arg\d' , ' $1 breadcrumb'
220223$Text = $Text -replace ' (SentrySpan) arg\d' , ' $1 span'
221224$Text = $Text -replace ' (SentryAppStartMeasurement) arg\d' , ' $1 appStartMeasurement'
225+ $Text = $Text -replace ' (SentryLog) arg\d' , ' $1 log'
222226
223227# Adjust nullable return delegates (though broken until this is fixed: https://github.com/xamarin/xamarin-macios/issues/17109)
224228$Text = $Text -replace ' delegate \w+ Sentry(BeforeBreadcrumb|BeforeSendEvent|TracesSampler)Callback' , " [return: NullAllowed]`n $&"
@@ -259,8 +263,9 @@ $Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+) \{ get; \}', '$
259263# We have some that accept either NSString or NSRegularExpression, which have no common type so they use NSObject
260264$Text = $Text -replace ' \s*\[Verify \(StronglyTypedNSArray\)\]\n' , ' '
261265
262- # Fix broken line comment
266+ # Fix broken multi- line comments
263267$Text = $Text -replace ' (DEPRECATED_MSG_ATTRIBUTE\()\n\s*' , ' $1'
268+ $Text = $Text -replace ' (DEPRECATED_MSG_ATTRIBUTE\([^)]*?)"\s*\r?\n\s*"' , ' $1 '
264269
265270# Remove default IsEqual implementation (already implemented by NSObject)
266271$Text = $Text -replace ' (?ms)\n?^ *// [^\n]*isEqual:.*?$.*?;\n' , ' '
0 commit comments