1+ # Reference: https://github.com/xamarin/xamarin-macios/blob/main/docs/website/binding_types_reference_guide.md
2+
13Set-StrictMode - Version Latest
24$ErrorActionPreference = ' Stop'
35
@@ -173,41 +175,6 @@ $Text = $Text -replace '\bpublic\b', 'internal'
173175# Remove static CFunctions class
174176$Text = $Text -replace ' (?ms)\nstatic class CFunctions.*?}\n' , ' '
175177
176- # This enum resides in the Sentry-Swift.h
177- # Appending it here so we don't need to import and create bindings for the entire header
178- $SentryLevel = @'
179-
180- [Native]
181- internal enum SentryLevel : ulong
182- {
183- None = 0,
184- Debug = 1,
185- Info = 2,
186- Warning = 3,
187- Error = 4,
188- Fatal = 5
189- }
190- '@
191-
192- # This enum resides in the Sentry-Swift.h
193- # Appending it here so we don't need to import and create bindings for the entire header
194- $SentryTransactionNameSource = @'
195-
196- [Native]
197- internal enum SentryTransactionNameSource : long
198- {
199- Custom = 0,
200- Url = 1,
201- Route = 2,
202- View = 3,
203- Component = 4,
204- Task = 5
205- }
206- '@
207-
208- $Text += " `n $SentryLevel "
209- $Text += " `n $SentryTransactionNameSource "
210-
211178# Add header and output file
212179$Text = " $Header `n`n $Text "
213180$Text | Out-File " $BindingsPath /$File "
@@ -238,6 +205,9 @@ $Text = $Text -replace '\bISentrySerializable\b', 'SentrySerializable'
238205# Remove INSCopying due to https://github.com/xamarin/xamarin-macios/issues/17130
239206$Text = $Text -replace ' : INSCopying,' , ' :' -replace ' \s?[:,] INSCopying' , ' '
240207
208+ # Remove iOS attributes like [iOS (13, 0)]
209+ $Text = $Text -replace ' \[iOS \(13, 0\)\]\n?' , ' '
210+
241211# Fix delegate argument names
242212$Text = $Text -replace ' (NSError) arg\d' , ' $1 error'
243213$Text = $Text -replace ' (NSHttpUrlResponse) arg\d' , ' $1 response'
@@ -279,7 +249,7 @@ $Text = $Text -replace '\[Static\]\s*\[Internal\]\s*partial\s+interface\s+Consta
279249
280250# Update MethodToProperty translations
281251$Text = $Text -replace ' (Export \("get\w+"\)\]\n)\s*\[Verify \(MethodToProperty\)\]\n(.+ \{ get; \})' , ' $1$2'
282- $Text = $Text -replace ' \[Verify \(MethodToProperty\)\]\n\s*(.+ (?:Hash|Value|DefaultIntegrations) \{ get; \})' , ' $1'
252+ $Text = $Text -replace ' \[Verify \(MethodToProperty\)\]\n\s*(.+ (?:Hash|Value|DefaultIntegrations|AppStartMeasurementWithSpans|BaggageHttpHeader ) \{ get; \})' , ' $1'
283253$Text = $Text -replace ' \[Verify \(MethodToProperty\)\]\n\s*(.+) \{ get; \}' , ' $1();'
284254
285255# Allow weakly typed NSArray
@@ -292,7 +262,7 @@ $Text = $Text -replace '(DEPRECATED_MSG_ATTRIBUTE\()\n\s*', '$1'
292262# Remove default IsEqual implementation (already implemented by NSObject)
293263$Text = $Text -replace ' (?ms)\n?^ *// [^\n]*isEqual:.*?$.*?;\n' , ' '
294264
295- # Replace obsolete platform avaialbility attributes
265+ # Replace obsolete platform availability attributes
296266$Text = $Text -replace ' ([\[,] )MacCatalyst \(' , ' $1Introduced (PlatformName.MacCatalyst, '
297267$Text = $Text -replace ' ([\[,] )Mac \(' , ' $1Introduced (PlatformName.MacOSX, '
298268$Text = $Text -replace ' ([\[,] )iOS \(' , ' $1Introduced (PlatformName.iOS, '
@@ -305,7 +275,6 @@ $Text = $Text -replace '(?m)(^\s*\/\/[^\r\n]*$\s*\[Export \("serialize"\)\]$\s*)
305275
306276$Text = $Text -replace ' .*SentryEnvelope .*?[\s\S]*?\n\n' , ' '
307277$Text = $Text -replace ' .*typedef.*SentryOnAppStartMeasurementAvailable.*?[\s\S]*?\n\n' , ' '
308- $Text = $Text -replace ' \n.*SentryReplayBreadcrumbConverter.*?[\s\S]*?\);\n' , ' '
309278
310279$propertiesToRemove = @ (
311280 ' SentryAppStartMeasurement' ,
@@ -321,41 +290,6 @@ foreach ($property in $propertiesToRemove)
321290 $Text = $Text -replace " \n.*property.*$property .*?[\s\S]*?\}\n" , ' '
322291}
323292
324- # This interface resides in the Sentry-Swift.h
325- # Appending it here so we don't need to import and create bindings for the entire header
326- $SentryId = @'
327-
328- // @interface SentryId : NSObject
329- [BaseType (typeof(NSObject), Name = "_TtC6Sentry8SentryId")]
330- [Internal]
331- interface SentryId
332- {
333- // @property (nonatomic, strong, class) SentryId * _Nonnull empty;
334- [Static]
335- [Export ("empty", ArgumentSemantic.Strong)]
336- SentryId Empty { get; set; }
337-
338- // @property (readonly, copy, nonatomic) NSString * _Nonnull sentryIdString;
339- [Export ("sentryIdString")]
340- string SentryIdString { get; }
341-
342- // -(instancetype _Nonnull)initWithUuid:(NSUUID * _Nonnull)uuid __attribute__((objc_designated_initializer));
343- [Export ("initWithUuid:")]
344- [DesignatedInitializer]
345- NativeHandle Constructor (NSUuid uuid);
346-
347- // -(instancetype _Nonnull)initWithUUIDString:(NSString * _Nonnull)uuidString __attribute__((objc_designated_initializer));
348- [Export ("initWithUUIDString:")]
349- [DesignatedInitializer]
350- NativeHandle Constructor (string uuidString);
351-
352- // @property (readonly, nonatomic) NSUInteger hash;
353- [Export ("hash")]
354- nuint Hash { get; }
355- }
356- '@
357-
358- $Text += " `n $SentryId "
359293
360294# Add header and output file
361295$Text = " $Header `n`n $Text "
0 commit comments