-
Notifications
You must be signed in to change notification settings - Fork 576
Expand file tree
/
Copy pathTestRuntime.cs
More file actions
1873 lines (1717 loc) · 55.6 KB
/
Copy pathTestRuntime.cs
File metadata and controls
1873 lines (1717 loc) · 55.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#if __MACOS__
#define MONOMAC
#endif
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AVFoundation;
using CoreBluetooth;
#if !__TVOS__
using Contacts;
#endif
#if MONOMAC || __MACCATALYST__
using EventKit;
#endif
#if MONOMAC
using AppKit;
#else
#if !__TVOS__
using AddressBook;
#endif
using MediaPlayer;
using UIKit;
#endif
using Xamarin.Utils;
#nullable enable
partial class TestRuntime {
[DllImport (Constants.CoreFoundationLibrary)]
public extern static nint CFGetRetainCount (IntPtr handle);
[DllImport (Constants.CoreFoundationLibrary)]
public extern static nint CFRetain (IntPtr handle);
[DllImport (Constants.CoreFoundationLibrary)]
public extern static void CFRelease (IntPtr handle);
[DllImport ("/usr/lib/system/libdyld.dylib")]
static extern int dyld_get_program_sdk_version ();
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
static extern IntPtr IntPtr_objc_msgSend (IntPtr receiver, IntPtr selector);
public const string BuildVersion_iOS9_GM = "13A340";
// Xcode 12.0 removed macOS 11.0 SDK and moved it up to Xcode 12.2
// we use this constant to make up for that difference when using
// AssertXcodeVersion and CheckXcodeVersion
#if __MACOS__ || __MACCATALYST__
public const int MinorXcode12APIMismatch = 2;
#else
public const int MinorXcode12APIMismatch = 0;
#endif
public static string GetiOSBuildVersion ()
{
#if MONOMAC
throw new Exception ("Can't get iOS Build version on OSX.");
#else
return CFString.FromHandle (IntPtr_objc_msgSend (UIDevice.CurrentDevice.Handle, Selector.GetHandle ("buildVersion")))!;
#endif
}
#if MONOMAC
const int sys1 = 1937339185;
const int sys2 = 1937339186;
const int sys3 = 1937339187;
// Deprecated in OSX 10.8 - but no good alternative is (yet) available
[System.Runtime.InteropServices.DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
static extern int Gestalt (int selector, out int result);
static Version? version;
public static Version OSXVersion {
get {
if (version is null) {
int major, minor, build;
Gestalt (sys1, out major);
Gestalt (sys2, out minor);
Gestalt (sys3, out build);
version = new Version (major, minor, build);
}
return version;
}
}
#elif __MACCATALYST__
public static Version OSXVersion {
get {
return Version.Parse (UIDevice.CurrentDevice.SystemVersion);
}
}
#endif
public static ApplePlatform CurrentPlatform {
get {
#if __MACCATALYST__
return ApplePlatform.MacCatalyst;
#elif __IOS__
return ApplePlatform.iOS;
#elif __TVOS__
return ApplePlatform.TVOS;
#elif __MACOS__
return ApplePlatform.MacOSX;
#else
#error Unknown platform
#endif
}
}
// This returns the string for the platform as used in the OSPlatformAttribute's PlatformName property.
public static string GetOSPlatformName (ApplePlatform platform)
{
switch (platform) {
case ApplePlatform.iOS:
return "ios";
case ApplePlatform.MacOSX:
return "macos";
case ApplePlatform.TVOS:
return "tvos";
case ApplePlatform.MacCatalyst:
return "maccatalyst";
default:
throw new Exception ($"Unknown platform: {platform}");
}
}
public static bool HasOSPlatformAttributeForCurrentPlatform<T> (ICustomAttributeProvider provider) where T : OSPlatformAttribute
{
return HasOSPlatformAttribute<T> (provider, CurrentPlatform);
}
public static bool HasOSPlatformAttribute<T> (ICustomAttributeProvider provider, ApplePlatform platform) where T : OSPlatformAttribute
{
var attribs = provider.GetCustomAttributes (false);
var platformName = GetOSPlatformName (platform);
foreach (var attrib in attribs) {
if (attrib is T platformAttribute) {
if (platformAttribute.PlatformName.StartsWith (platformName, StringComparison.OrdinalIgnoreCase))
return true;
}
}
return false;
}
public static Version GetSDKVersion ()
{
var v = dyld_get_program_sdk_version ();
var major = v >> 16;
var minor = (v >> 8) & 0xFF;
var build = v & 0xFF;
return new Version (major, minor, build);
}
static bool? is_in_ci;
public static bool IsInCI {
get {
if (!is_in_ci.HasValue) {
var in_ci = !string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("BUILD_REVISION"));
in_ci |= !string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("BUILD_SOURCEVERSION")); // set by Azure DevOps
is_in_ci = in_ci;
}
return is_in_ci.Value;
}
}
static bool? is_pull_request;
public static bool IsPullRequest {
get {
if (!is_pull_request.HasValue) {
var pr = string.Equals (Environment.GetEnvironmentVariable ("BUILD_REASON"), "PullRequest", StringComparison.Ordinal);
pr |= string.Equals (Environment.GetEnvironmentVariable ("IS_PR"), "true", StringComparison.OrdinalIgnoreCase);
is_pull_request = pr;
}
return is_pull_request.Value;
}
}
public static void IgnoreInCI (string message)
{
if (!IsInCI) {
Console.WriteLine ($"Not ignoring test, because not running in CI: {message}");
return;
}
Console.WriteLine ($"Ignoring test, because not running in CI: {message}");
NUnit.Framework.Assert.Ignore (message);
}
public static void AssertNotInterpreter (string message = "This test does not run when using the interpreter")
{
if (IsCoreCLR)
return;
if (RuntimeFeature.IsDynamicCodeSupported)
NUnit.Framework.Assert.Ignore (message);
}
public static void AssertXcodeVersion (int major, int minor, int build = 0)
{
if (CheckXcodeVersion (major, minor, build))
return;
NUnit.Framework.Assert.Ignore ("Requires the platform version shipped with Xcode {0}.{1}", major, minor);
}
public static void AssertDevice (string message = "This test only runs on device.")
{
#if !MONOMAC && !__MACCATALYST__
if (ObjCRuntime.Runtime.Arch == Arch.DEVICE)
return;
#endif
NUnit.Framework.Assert.Ignore (message);
}
public static void AssertNotDevice (string message = "This test does not run on device.")
{
#if !MONOMAC && !__MACCATALYST__
if (ObjCRuntime.Runtime.Arch == Arch.DEVICE)
NUnit.Framework.Assert.Ignore (message);
#endif
}
public static void AssertDesktop (string message = "This test only runs on Desktops (macOS or MacCatalyst).")
{
#if !(__MACOS__ || __MACCATALYST__)
NUnit.Framework.Assert.Ignore (message);
#endif
}
public static void AssertNotDesktop (string message = "This test does not run on Desktops (macOS or MacCatalyst).")
{
#if __MACOS__ || __MACCATALYST__
NUnit.Framework.Assert.Ignore (message);
#endif
}
public static void AssertNotX64Desktop (string message = "This test does not run on x64 desktops.")
{
#if __MACOS__ || __MACCATALYST__
if (!IsARM64)
NUnit.Framework.Assert.Ignore (message);
#endif
}
public static void AssertNotARM64Desktop (string message = "This test does not run on an ARM64 desktop.")
{
#if __MACOS__ || __MACCATALYST__
if (IsARM64)
NUnit.Framework.Assert.Ignore (message);
#endif
}
public static void AssertIfSimulatorThenARM64 ()
{
#if !__MACOS__ && !__MACCATALYST__
if (ObjCRuntime.Runtime.Arch != Arch.SIMULATOR)
return;
if (!IsARM64)
NUnit.Framework.Assert.Ignore ("This test does not run simulators that aren't ARM64 simulators.");
#endif
}
public static void AssertOnlyARM64 ()
{
if (!IsARM64)
NUnit.Framework.Assert.Ignore ("This test only runs on ARM64 simulators.");
}
public static void AssertNotSimulator (string message = "This test does not work in the simulator.")
{
if (IsSimulator)
NUnit.Framework.Assert.Ignore (message);
}
public static void AssertSimulator (string message = "This test only works in the simulator.")
{
if (!IsSimulator)
NUnit.Framework.Assert.Ignore (message);
}
public static void AssertSimulatorOrDesktop (string message = "This test only works in the simulator or on the desktop.")
{
if (!IsSimulatorOrDesktop)
NUnit.Framework.Assert.Ignore (message);
}
public static bool IsVM =>
!string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("VM_VENDOR"));
public static void AssertNotVirtualMachine ()
{
#if MONOMAC || __MACCATALYST__
// enviroment variable set by the CI when running on a VM
var vmVendor = Environment.GetEnvironmentVariable ("VM_VENDOR");
if (!string.IsNullOrEmpty (vmVendor))
NUnit.Framework.Assert.Ignore ($"This test only runs on device. Found vm vendor: {vmVendor}");
#endif
}
public static bool IsVSTS =>
!string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("BUILD_BUILDID")); // Env var set by vsts
//
public static void AssertNotVSTS ()
{
if (IsVSTS)
NUnit.Framework.Assert.Ignore ("This test only runs on developer desktops and not on VSTS.");
}
// This function checks if the current Xcode version is exactly (neither higher nor lower) the requested one.
public static bool CheckExactXcodeVersion (int major, int minor, int beta = 0)
{
// Add the Build number minus the one last character, sometimes Apple releases
// different builds from the same Beta, for example in Xcode 9 Beta 3 we have
// 15A5318g on device and 15A5318e on the simulator
var nineb1 = new {
Xcode = new { Major = 9, Minor = 0, Beta = 1 },
iOS = new { Major = 11, Minor = 0, Build = "15A5278" },
tvOS = new { Major = 11, Minor = 0, Build = "?" },
macOS = new { Major = 10, Minor = 13, Build = "?" },
};
var nineb2 = new {
Xcode = new { Major = 9, Minor = 0, Beta = 2 },
iOS = new { Major = 11, Minor = 0, Build = "15A5304" },
tvOS = new { Major = 11, Minor = 0, Build = "?" },
macOS = new { Major = 10, Minor = 13, Build = "?" },
};
var nineb3 = new {
Xcode = new { Major = 9, Minor = 0, Beta = 3 },
iOS = new { Major = 11, Minor = 0, Build = "15A5318" },
tvOS = new { Major = 11, Minor = 0, Build = "?" },
macOS = new { Major = 10, Minor = 13, Build = "?" },
};
var elevenb5 = new {
Xcode = new { Major = 11, Minor = 0, Beta = 5 },
iOS = new { Major = 13, Minor = 0, Build = "17A5547" },
tvOS = new { Major = 13, Minor = 0, Build = "?" },
macOS = new { Major = 10, Minor = 15, Build = "?" },
};
var elevenb6 = new {
Xcode = new { Major = 11, Minor = 0, Beta = 6 },
iOS = new { Major = 13, Minor = 0, Build = "17A5565b" },
tvOS = new { Major = 13, Minor = 0, Build = "?" },
macOS = new { Major = 10, Minor = 15, Build = "?" },
};
var twelvedot2b2 = new {
Xcode = new { Major = 12, Minor = 2, Beta = 2 },
iOS = new { Major = 14, Minor = 2, Build = "18B5061" },
tvOS = new { Major = 14, Minor = 2, Build = "18K5036" },
macOS = new { Major = 11, Minor = 0, Build = "?" },
};
var twelvedot2b3 = new {
Xcode = new { Major = 12, Minor = 2, Beta = 3 },
iOS = new { Major = 14, Minor = 2, Build = "18B5072" },
tvOS = new { Major = 14, Minor = 2, Build = "18K5047" },
macOS = new { Major = 11, Minor = 0, Build = "20A5395" },
};
var twentysixb1 = new {
Xcode = new { Major = 26, Minor = 0, Beta = 1 },
iOS = new { Major = 26, Minor = 0, Build = "23A5260l" },
tvOS = new { Major = 26, Minor = 0, Build = "23J5279m" },
macOS = new { Major = 26, Minor = 0, Build = "25A5279m" },
};
var twentysixb2 = new {
Xcode = new { Major = 26, Minor = 0, Beta = 2 },
iOS = new { Major = 26, Minor = 0, Build = "23A5276e" },
tvOS = new { Major = 26, Minor = 0, Build = "23J5295e" },
macOS = new { Major = 26, Minor = 0, Build = "25A5295e" },
};
var twentysixb3 = new {
Xcode = new { Major = 26, Minor = 0, Beta = 3 },
iOS = new { Major = 26, Minor = 0, Build = "25A5306g" },
tvOS = new { Major = 26, Minor = 0, Build = "23J5306f" },
macOS = new { Major = 26, Minor = 0, Build = "25A5306g" },
};
var versions = new [] {
nineb1,
nineb2,
nineb3,
elevenb5,
elevenb6,
twelvedot2b2,
twelvedot2b3,
twentysixb1,
twentysixb2,
twentysixb3,
};
foreach (var v in versions) {
if (v.Xcode.Major != major)
continue;
if (v.Xcode.Minor != minor)
continue;
if (v.Xcode.Beta != beta)
continue;
#if __IOS__
if (!CheckExactiOSSystemVersion (v.iOS.Major, v.iOS.Minor))
return false;
if (v.iOS.Build == "?")
throw new NotImplementedException ($"Build number for iOS {v.iOS.Major}.{v.iOS.Minor} beta {beta} (candidate: {GetiOSBuildVersion ()})");
var actual = GetiOSBuildVersion ();
return actual.StartsWith (v.iOS.Build, StringComparison.Ordinal);
#elif __TVOS__
if (!CheckExacttvOSSystemVersion (v.tvOS.Major, v.tvOS.Minor))
return false;
if (v.tvOS.Build == "?")
throw new NotImplementedException ($"Build number for tvOS {v.tvOS.Major}.{v.tvOS.Minor} beta {beta} (candidate: {GetiOSBuildVersion ()})");
var actual = GetiOSBuildVersion ();
return actual.StartsWith (v.tvOS.Build, StringComparison.Ordinal);
#elif __MACOS__
if (!CheckExactmacOSSystemVersion (v.macOS.Major, v.macOS.Minor))
return false;
if (v.macOS.Build == "?")
throw new NotImplementedException ($"Build number for macOS {v.macOS.Major}.{v.macOS.Minor} beta {beta} (must be contained within: {NSProcessInfo.ProcessInfo.OperatingSystemVersionString}).");
/*
* I could be parsing the string but docs says it is not suitable for parsing and this is ugly enough so
* an apology in advance (I'm very sorry =]) to my future self or whoever is dealing with this if it broke
* but there are no better solutions at this time. That said this is good enough for the current use case.
* Example: Version 10.16 (Build 20A5395g)
*
* The above statement also applies to 'CheckExactmacOSSystemVersion' =S
*/
return NSProcessInfo.ProcessInfo.OperatingSystemVersionString.Contains (v.macOS.Build, StringComparison.Ordinal);
#else
throw new NotImplementedException ();
#endif
}
throw new NotImplementedException ($"Build information for Xcode version {major}.{minor} beta {beta} not found");
}
public static bool CheckXcodeVersion (int major, int minor, int build = 0)
{
switch (major) {
case 26:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (26, 0);
#elif __IOS__
return CheckiOSSystemVersion (26, 0);
#elif MONOMAC
return CheckMacSystemVersion (26, 0);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 1:
#if __TVOS__
return ChecktvOSSystemVersion (26, 1);
#elif __IOS__
return CheckiOSSystemVersion (26, 1);
#elif MONOMAC
return CheckMacSystemVersion (26, 1);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 2:
case 3: // Xcode 26.3 has the same SDK as 26.2, so we treat them the same here
#if __TVOS__
return ChecktvOSSystemVersion (26, 2);
#elif __IOS__
return CheckiOSSystemVersion (26, 2);
#elif MONOMAC
return CheckMacSystemVersion (26, 2);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 4:
#if __TVOS__
return ChecktvOSSystemVersion (26, 4);
#elif __IOS__
return CheckiOSSystemVersion (26, 4);
#elif MONOMAC
return CheckMacSystemVersion (26, 4);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
default:
throw new NotImplementedException ($"Missing version logic for checking for Xcode {major}.{minor}");
}
case 16:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (18, 0);
#elif __IOS__
return CheckiOSSystemVersion (18, 0);
#elif MONOMAC
return CheckMacSystemVersion (15, 0);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 1:
#if __TVOS__
return ChecktvOSSystemVersion (18, 1);
#elif __IOS__
return CheckiOSSystemVersion (18, 1);
#elif MONOMAC
return CheckMacSystemVersion (15, 1);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (18, 2);
#elif __IOS__
return CheckiOSSystemVersion (18, 2);
#elif MONOMAC
return CheckMacSystemVersion (15, 2);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 3:
#if __TVOS__
return ChecktvOSSystemVersion (18, 4);
#elif __IOS__
return CheckiOSSystemVersion (18, 4);
#elif MONOMAC
return CheckMacSystemVersion (15, 4);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
default:
throw new NotImplementedException ($"Missing version logic for checking for Xcode {major}.{minor}");
}
case 15:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (17, 0);
#elif __IOS__
return CheckiOSSystemVersion (17, 0);
#elif MONOMAC
return CheckMacSystemVersion (14, 0);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 1:
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (17, 2);
#elif __IOS__
return CheckiOSSystemVersion (17, 2);
#elif MONOMAC
return CheckMacSystemVersion (14, 2);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 3:
#if __TVOS__
return ChecktvOSSystemVersion (17, 4);
#elif __IOS__
return CheckiOSSystemVersion (17, 4);
#elif MONOMAC
return CheckMacSystemVersion (14, 4);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 4:
#if __TVOS__
return ChecktvOSSystemVersion (17, 5);
#elif __IOS__
return CheckiOSSystemVersion (17, 5);
#elif MONOMAC
return CheckMacSystemVersion (14, 5);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
default:
throw new NotImplementedException ($"Missing version logic for checking for Xcode {major}.{minor}");
}
case 14:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (16, 0);
#elif __IOS__
return CheckiOSSystemVersion (16, 0);
#elif MONOMAC
return CheckMacSystemVersion (13, 0);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 1:
#if __TVOS__
return ChecktvOSSystemVersion (16, 1);
#elif __IOS__
return CheckiOSSystemVersion (16, 1);
#elif MONOMAC
return CheckMacSystemVersion (13, 0);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (16, 1);
#elif __IOS__
return CheckiOSSystemVersion (16, 2);
#elif MONOMAC
return CheckMacSystemVersion (13, 1);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 3:
#if __TVOS__
return ChecktvOSSystemVersion (16, 4);
#elif __IOS__
return CheckiOSSystemVersion (16, 4);
#elif MONOMAC
return CheckMacSystemVersion (13, 3);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
default:
throw new NotImplementedException ($"Missing version logic for checking for Xcode {major}.{minor}");
}
case 13:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (15, 0);
#elif __IOS__
return CheckiOSSystemVersion (15, 0);
#elif MONOMAC
return CheckMacSystemVersion (12, 0);
#else
throw new NotImplementedException ();
#endif
case 1:
#if __TVOS__
return ChecktvOSSystemVersion (15, 1);
#elif __IOS__
return CheckiOSSystemVersion (15, 1);
#elif MONOMAC
return CheckMacSystemVersion (12, 0);
#else
throw new NotImplementedException ();
#endif
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (15, 2);
#elif __IOS__
return CheckiOSSystemVersion (15, 2);
#elif MONOMAC
return CheckMacSystemVersion (12, 1);
#else
throw new NotImplementedException ();
#endif
case 3:
#if __TVOS__
return ChecktvOSSystemVersion (15, 4);
#elif __IOS__
return CheckiOSSystemVersion (15, 4);
#elif MONOMAC
return CheckMacSystemVersion (12, 3);
#else
throw new NotImplementedException ();
#endif
default:
throw new NotImplementedException ();
}
case 12:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (14, 0);
#elif __IOS__
return CheckiOSSystemVersion (14, 0);
#elif MONOMAC
return CheckMacSystemVersion (10, 15, 6);
#else
throw new NotImplementedException ();
#endif
case 1:
#if __TVOS__
return ChecktvOSSystemVersion (14, 0);
#elif __IOS__
return CheckiOSSystemVersion (14, 1);
#elif MONOMAC
return CheckMacSystemVersion (10, 15, 6);
#else
throw new NotImplementedException ();
#endif
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (14, 2);
#elif __IOS__
return CheckiOSSystemVersion (14, 2);
#elif MONOMAC
return CheckMacSystemVersion (11, 0, 0);
#else
throw new NotImplementedException ();
#endif
case 3:
#if __TVOS__
return ChecktvOSSystemVersion (14, 3);
#elif __IOS__
return CheckiOSSystemVersion (14, 3);
#elif MONOMAC
return CheckMacSystemVersion (11, 1, 0);
#endif
case 5:
#if __TVOS__
return ChecktvOSSystemVersion (14, 5);
#elif __IOS__
return CheckiOSSystemVersion (14, 5);
#elif MONOMAC
return CheckMacSystemVersion (11, 3, 0);
#else
throw new NotImplementedException ();
#endif
default:
throw new NotImplementedException ();
}
case 11:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (13, 0);
#elif __IOS__
return CheckiOSSystemVersion (13, 0);
#elif MONOMAC
return CheckMacSystemVersion (10, 15, 0);
#else
throw new NotImplementedException ();
#endif
case 1:
#if __TVOS__
return ChecktvOSSystemVersion (13, 0);
#elif __IOS__
return CheckiOSSystemVersion (13, 1);
#elif MONOMAC
return CheckMacSystemVersion (10, 15, 0);
#else
throw new NotImplementedException ();
#endif
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (13, 2);
#elif MONOMAC
return CheckMacSystemVersion (10, 15, 1);
#elif __IOS__
return CheckiOSSystemVersion (13, 2);
#else
throw new NotImplementedException ();
#endif
case 3:
#if __TVOS__
return ChecktvOSSystemVersion (13, 3);
#elif __IOS__
return CheckiOSSystemVersion (13, 3);
#elif MONOMAC
return CheckMacSystemVersion (10, 15, 2);
#else
throw new NotImplementedException ();
#endif
case 4:
#if __TVOS__
return ChecktvOSSystemVersion (13, 4);
#elif __IOS__
return CheckiOSSystemVersion (13, 4);
#elif MONOMAC
return CheckMacSystemVersion (10, 15, 4);
#else
throw new NotImplementedException ();
#endif
case 5:
#if __TVOS__
return ChecktvOSSystemVersion (13, 4);
#elif __IOS__
return CheckiOSSystemVersion (13, 5);
#elif MONOMAC
return CheckMacSystemVersion (10, 15, 5);
#else
throw new NotImplementedException ();
#endif
case 6:
#if __TVOS__
return ChecktvOSSystemVersion (13, 4);
#elif __IOS__
return CheckiOSSystemVersion (13, 6);
#elif MONOMAC
return CheckMacSystemVersion (10, 15, 6);
#else
throw new NotImplementedException ();
#endif
default:
throw new NotImplementedException ();
}
case 10:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (12, 0);
#elif __IOS__
return CheckiOSSystemVersion (12, 0);
#elif MONOMAC
return CheckMacSystemVersion (10, 14, 0);
#else
throw new NotImplementedException ();
#endif
case 1:
#if __TVOS__
return ChecktvOSSystemVersion (12, 1);
#elif __IOS__
return CheckiOSSystemVersion (12, 1);
#elif MONOMAC
return CheckMacSystemVersion (10, 14, 3);
#else
throw new NotImplementedException ();
#endif
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (12, 2);
#elif __IOS__
return CheckiOSSystemVersion (12, 2);
#elif MONOMAC
return CheckMacSystemVersion (10, 14, 4);
#else
throw new NotImplementedException ();
#endif
default:
throw new NotImplementedException ();
}
case 9:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (11, 0);
#elif __IOS__
return CheckiOSSystemVersion (11, 0);
#elif MONOMAC
return CheckMacSystemVersion (10, 13, 0);
#else
throw new NotImplementedException ();
#endif
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (11, 2);
#elif __IOS__
return CheckiOSSystemVersion (11, 2);
#elif MONOMAC
return CheckMacSystemVersion (10, 13, 2);
#else
throw new NotImplementedException ();
#endif
case 3:
#if __TVOS__
return ChecktvOSSystemVersion (11, 3);
#elif __IOS__
return CheckiOSSystemVersion (11, 3);
#elif MONOMAC
return CheckMacSystemVersion (10, 13, 4);
#else
throw new NotImplementedException ();
#endif
default:
throw new NotImplementedException ();
}
case 8:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (10, 0);
#elif __IOS__
return CheckiOSSystemVersion (10, 0);
#elif MONOMAC
return CheckMacSystemVersion (10, 12, 0);
#else
throw new NotImplementedException ();
#endif
case 1:
#if __TVOS__
return ChecktvOSSystemVersion (10, 0);
#elif __IOS__
return CheckiOSSystemVersion (10, 1);
#elif MONOMAC
return CheckMacSystemVersion (10, 12, 1);
#else
throw new NotImplementedException ();
#endif
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (10, 1);
#elif __IOS__
return CheckiOSSystemVersion (10, 2);
#elif MONOMAC
return CheckMacSystemVersion (10, 12, 2);
#else
throw new NotImplementedException ();
#endif
case 3:
#if __TVOS__
return ChecktvOSSystemVersion (10, 2);
#elif __IOS__
return CheckiOSSystemVersion (10, 3);
#elif MONOMAC
return CheckMacSystemVersion (10, 12, 4);
#else
throw new NotImplementedException ();
#endif
default:
throw new NotImplementedException ();
}
case 7:
switch (minor) {
case 0:
#if __TVOS__
return ChecktvOSSystemVersion (9, 0);
#elif __IOS__
return CheckiOSSystemVersion (9, 0);
#elif MONOMAC
return CheckMacSystemVersion (10, 11, 0);
#else
throw new NotImplementedException ();
#endif
case 1:
#if __TVOS__
return ChecktvOSSystemVersion (9, 0);
#elif __IOS__
return CheckiOSSystemVersion (9, 1);
#elif MONOMAC
return CheckMacSystemVersion (10, 11, 0 /* yep */);
#else
throw new NotImplementedException ();
#endif
case 2:
#if __TVOS__
return ChecktvOSSystemVersion (9, 1);
#elif __IOS__
return CheckiOSSystemVersion (9, 2);
#elif MONOMAC
return CheckMacSystemVersion (10, 11, 2);
#else
throw new NotImplementedException ();
#endif
case 3:
#if __TVOS__
return ChecktvOSSystemVersion (9, 2);
#elif __IOS__
return CheckiOSSystemVersion (9, 3);
#elif MONOMAC
return CheckMacSystemVersion (10, 11, 4);
#else
throw new NotImplementedException ();
#endif
default:
throw new NotImplementedException ();
}
case 6:
#if __IOS__
switch (minor) {
case 0:
return CheckiOSSystemVersion (8, 0);
case 1:
return CheckiOSSystemVersion (8, 1);
case 2:
return CheckiOSSystemVersion (8, 2);
case 3:
return CheckiOSSystemVersion (8, 3);
default:
throw new NotImplementedException ();
}
#elif __TVOS__
return true;
#elif MONOMAC
switch (minor) {
case 0:
return CheckMacSystemVersion (10, 9, 0);
case 1:
return CheckMacSystemVersion (10, 10, 0);
case 2:
return CheckMacSystemVersion (10, 10, 0);
case 3:
return CheckMacSystemVersion (10, 10, 0);
default:
throw new NotImplementedException ();
}
#else
throw new NotImplementedException ();
#endif
case 5:
#if __IOS__
switch (minor) {