[generator][dotnet] Add support for `[Uns|S]upportedOSPlatformAttribute` (#10580)

This moves our current/legacy attributes to the ones added in dotnet 5 [1].

Short Forms (only in bindings)

| Old                                   | New                                 |
|---------------------------------------|-------------------------------------|
| [iOS (7,0)]                           | [SupportedOSPlatform ("ios7.0")]    |
| [NoIOS]                               | [UnsupportedOSPlatform ("ios")]     |

Long Forms

| Old                                   | New                                 |
|---------------------------------------|-------------------------------------|
| [Introduced (PlatformName.iOS, 7,0)]  | [SupportedOSPlatform ("ios7.0")]    |
| [Obsoleted (PlatformName.iOS, 12,1)]  | [Obsolete (...)]                    |
| [Deprecated (PlatformName.iOS, 14,3)] | [UnsupportedOSPlatform ("ios14.3")] |
| [Unavailable (PlatformName.iOS)]      | [UnsupportedOSPlatform ("ios")]     |

Other changes

* `[SupportedOSPlatform]` and `[UnsupportedOSPlatform]` are not allowed on `interface` [2] which means they cannot be used for protocols. This is currently handled by inlining the existing attributes on all members.
* `[ObsoletedInOSPlatform]` was removed in net5 RC. This PR is now mapping the existing attributes to `[Obsolote]`, however multiple ones cannot be added so they need to be platform specific.

Remaining work (manual bindings update) tracked in https://github.com/xamarin/xamarin-macios/issues/11055

References

* [1] https://github.com/xamarin/xamarin-macios/issues/10170
* [2] https://github.com/dotnet/runtime/issues/47599
* [3] https://github.com/dotnet/runtime/issues/47601
This commit is contained in:
Sebastien Pouliot 2021-04-10 11:09:14 -04:00 коммит произвёл GitHub
Родитель 75e913ed4f
Коммит 4e48aa2ae1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
72 изменённых файлов: 849 добавлений и 51 удалений

Просмотреть файл

@ -133,7 +133,9 @@ namespace CoreAnimation {
}
}
#endif
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public CAContentsFormat ContentsFormat {
get { return CAContentsFormatExtensions.GetValue (_ContentsFormat); }
set { _ContentsFormat = value.GetConstant ()!; }

Просмотреть файл

@ -152,20 +152,24 @@ namespace CoreFoundation {
[DllImport (Constants.libcLibrary)]
internal extern static void dispatch_suspend (IntPtr o);
#if !NET
[Mac (10,12)]
[iOS (10,0)]
[TV (10,0)]
[Watch (3,0)]
#endif
public void Activate ()
{
dispatch_activate (GetCheckedHandle ());
}
[DllImport (Constants.libcLibrary)]
#if !NET
[Mac (10,12)]
[iOS (10,0)]
[TV (10,0)]
[Watch (3,0)]
#endif
extern static void dispatch_activate (/* dispatch_object_t */ IntPtr @object);
#endif // !COREBUILD
}
@ -204,10 +208,12 @@ namespace CoreFoundation {
throw new Exception ("Error creating dispatch queue");
}
#if !NET
[Mac (10,12)]
[iOS (10,0)]
[TV (10,0)]
[Watch (3,0)]
#endif
public DispatchQueue (string label, Attributes attributes, DispatchQueue target = null)
: base (dispatch_queue_create_with_target (label, attributes?.Create () ?? IntPtr.Zero, target.GetHandle ()), true)
{
@ -223,7 +229,9 @@ namespace CoreFoundation {
}
}
#if !NET
[iOS (7,0)]
#endif
public static string CurrentQueueLabel {
get {
return Marshal.PtrToStringAnsi (dispatch_queue_get_label (IntPtr.Zero));
@ -467,8 +475,10 @@ namespace CoreFoundation {
return gchandle.Target;
}
#if !NET
[Mac (10,10)]
[iOS (8,0)]
#endif
public DispatchQualityOfService GetQualityOfService (out int relative_priority)
{
unsafe {
@ -477,8 +487,10 @@ namespace CoreFoundation {
}
}
#if !NET
[Mac (10,10)]
[iOS (8,0)]
#endif
public DispatchQualityOfService QualityOfService {
get {
unsafe {
@ -493,10 +505,12 @@ namespace CoreFoundation {
[DllImport (Constants.libcLibrary)]
extern static IntPtr dispatch_queue_create (string label, IntPtr attr);
#if !NET
[Mac (10,12)]
[iOS (10,0)]
[TV (10,0)]
[Watch (3,0)]
#endif
[DllImport (Constants.libcLibrary)]
extern static IntPtr dispatch_queue_create_with_target (string label, IntPtr attr, IntPtr target);
@ -549,8 +563,10 @@ namespace CoreFoundation {
[DllImport(Constants.libcLibrary)]
extern static IntPtr dispatch_queue_get_specific (IntPtr queue, /* const void* */ IntPtr key);
#if !NET
[Mac (10,10)]
[iOS (8,0)]
#endif
[DllImport (Constants.libcLibrary)]
unsafe extern static /* dispatch_qos_class_t */ DispatchQualityOfService dispatch_queue_get_qos_class (/* dispatch_queue_t */ IntPtr queue, /* int *_Nullable */ int* relative_priority);
@ -599,24 +615,32 @@ namespace CoreFoundation {
{
public bool Concurrent { get; set; }
#if !NET
[Mac (10,12)]
[iOS (10,0)]
[TV (10,0)]
[Watch (3,0)]
#endif
public bool IsInitiallyInactive { get; set; }
#if !NET
[Mac (10,12)]
[iOS (10,0)]
[TV (10,0)]
[Watch (3,0)]
#endif
public AutoreleaseFrequency? AutoreleaseFrequency { get; set; }
#if !NET
[Mac (10,10)]
[iOS (8,0)]
#endif
public int RelativePriority { get; set; }
#if !NET
[Mac (10,10)]
[iOS (8,0)]
#endif
public DispatchQualityOfService? QualityOfService { get; set; }
internal IntPtr Create ()
@ -638,30 +662,38 @@ namespace CoreFoundation {
return rv;
}
#if !NET
[Mac (10,12)]
[iOS (10,0)]
[TV (10,0)]
[Watch (3,0)]
#endif
[DllImport (Constants.libcLibrary)]
static extern /* dispatch_queue_attr_t */ IntPtr dispatch_queue_attr_make_initially_inactive (/* dispatch_queue_attr_t _Nullable */ IntPtr attr);
#if !NET
[Mac (10,12)]
[iOS (10,0)]
[TV (10,0)]
[Watch (3,0)]
#endif
[DllImport (Constants.libcLibrary)]
static extern /* dispatch_queue_attr_t */ IntPtr dispatch_queue_attr_make_with_autorelease_frequency (/* dispatch_queue_attr_t _Nullable */ IntPtr attr, /* dispatch_autorelease_frequency_t */ nuint frequency);
#if !NET
[Mac (10,10)]
[iOS (8,0)]
#endif
[DllImport (Constants.libcLibrary)]
static extern /* dispatch_queue_attr_t */ IntPtr dispatch_queue_attr_make_with_qos_class (/* dispatch_queue_attr_t _Nullable */ IntPtr attr, /* dispatch_qos_class_t */ DispatchQualityOfService qos_class, int relative_priority);
}
#if !NET
[Mac (10,12)]
[iOS (10,0)]
[TV (10,0)]
[Watch (3,0)]
#endif
[Native]
public enum AutoreleaseFrequency : ulong /* unsigned long */
{

Просмотреть файл

@ -26,8 +26,11 @@ using System.Runtime.InteropServices;
using System.Collections.Generic;
namespace CoreFoundation {
#if !NET
[Mac (10,12), iOS (10,0), Watch (3,0), TV (10,0)]
[Introduced (PlatformName.MacCatalyst, 13, 0)]
#endif
public sealed class OSLog : NativeObject {
static OSLog _default;

Просмотреть файл

@ -16,7 +16,9 @@ using Foundation;
namespace CoreGraphics {
#if !NET
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct GColorConversionInfoTriple {
public CGColorSpace Space;
@ -25,7 +27,9 @@ namespace CoreGraphics {
}
// CGColorConverter.h
#if !NET
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
#endif
public partial class CGColorConversionInfo : INativeObject, IDisposable {
/* invoked by marshallers */

Просмотреть файл

@ -20,8 +20,12 @@ using Foundation;
namespace CoreGraphics {
[TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by 'GColorConversionInfoTriple'.")]
[iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by 'GColorConversionInfoTriple'.")]
#if !NET
[TV (9,2)]
[iOS (9,3)]
#endif
[Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by 'GColorConversionInfoTriple'.")]
[Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by 'GColorConversionInfoTriple'.")]
[StructLayout (LayoutKind.Sequential)]
public struct CGColorConverterTriple {
public CGColorSpace Space;
@ -30,8 +34,12 @@ namespace CoreGraphics {
}
// CGColorConverter.h
[TV (9,2)][Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by 'CGColorConversionInfo'.")]
[iOS (9,3)][Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by 'CGColorConversionInfo'.")]
#if !NET
[TV (9,2)]
[iOS (9,3)]
#endif
[Obsoleted (PlatformName.TvOS, 10,0, message: "Replaced by 'CGColorConversionInfo'.")]
[Obsoleted (PlatformName.iOS, 10,0, message: "Replaced by 'CGColorConversionInfo'.")]
public class CGColorConverter : INativeObject, IDisposable
{
/* invoked by marshallers */

Просмотреть файл

@ -253,73 +253,97 @@ namespace CoreGraphics {
return r == IntPtr.Zero ? null : new CGColorSpace (r, true);
}
#if !NET
[iOS (9,0)]
#endif
public static CGColorSpace CreateGenericGray ()
{
return Create (CGColorSpaceNames.GenericGray.Handle);
}
#if !NET
[iOS (9,0)]
#endif
public static CGColorSpace CreateGenericRgb ()
{
return Create (CGColorSpaceNames.GenericRgb.Handle);
}
#if !NET
[iOS (8,0)]
#endif
public static CGColorSpace CreateGenericCmyk ()
{
return Create (CGColorSpaceNames.GenericCmyk.Handle);
}
#if !NET
[iOS (9,0)]
#endif
public static CGColorSpace CreateGenericRgbLinear ()
{
return Create (CGColorSpaceNames.GenericRgbLinear.Handle);
}
#if !NET
[iOS (8,0)]
#endif
public static CGColorSpace CreateAdobeRgb1988 ()
{
return Create (CGColorSpaceNames.AdobeRgb1998.Handle);
}
#if !NET
[iOS (8,0)]
#endif
public static CGColorSpace CreateSrgb ()
{
return Create (CGColorSpaceNames.Srgb.Handle);
}
#if !NET
[iOS (8,0)]
#endif
public static CGColorSpace CreateGenericGrayGamma2_2 ()
{
return Create (CGColorSpaceNames.GenericGrayGamma2_2.Handle);
}
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
public static CGColorSpace CreateGenericXyz ()
{
return Create (CGColorSpaceNames.GenericXyz.Handle);
}
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
public static CGColorSpace CreateAcesCGLinear ()
{
return Create (CGColorSpaceNames.AcesCGLinear.Handle);
}
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
public static CGColorSpace CreateItuR_709 ()
{
return Create (CGColorSpaceNames.ItuR_709.Handle);
}
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
public static CGColorSpace CreateItuR_2020 ()
{
return Create (CGColorSpaceNames.ItuR_2020.Handle);
}
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
public static CGColorSpace CreateRommRgb ()
{
return Create (CGColorSpaceNames.RommRgb.Handle);
@ -394,14 +418,18 @@ namespace CoreGraphics {
return ptr == IntPtr.Zero ? null : new CGColorSpace (ptr, true);
}
#if !NET
[iOS (10, 0)]
[Mac (10, 12)]
#endif
public static CGColorSpace CreateIccData (NSData data)
{
return CreateIccData (data.GetHandle ());
}
#if !NET
[iOS (10,0)][Mac (10,12)][Watch (3,0)][TV (10,0)]
#endif
public static CGColorSpace CreateIccData (CGDataProvider provider)
{
return CreateIccData (provider.GetHandle ());
@ -439,7 +467,9 @@ namespace CoreGraphics {
[Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'GetICCData' instead." )]
extern static /* CFDataRef */ IntPtr CGColorSpaceCopyICCProfile (/* CGColorSpaceRef */ IntPtr space);
#if !NET
[iOS (7,0)] // note: pre-release docs/headers says iOS6 and later, available on OSX since 10.5
#endif
[Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'GetICCData' instead." )]
[Deprecated (PlatformName.iOS, 11, 0, message: "Use 'GetICCData' instead." )]
[Deprecated (PlatformName.TvOS, 11, 0, message: "Use 'GetICCData' instead." )]
@ -454,74 +484,96 @@ namespace CoreGraphics {
return (ptr == IntPtr.Zero) ? null : new NSData (ptr, true);
}
#if !NET
[iOS (10,0)][Mac (10,12)]
[Watch (3,0)]
[TV (10,0)]
#endif
[DllImport (Constants.CoreGraphicsLibrary)]
static extern /* CFDataRef* */ IntPtr CGColorSpaceCopyICCData (/* CGColorSpaceRef */ IntPtr space);
#if !NET
[iOS (10,0)][Mac (10,12)]
[Watch (3,0)]
[TV (10,0)]
#endif
public NSData GetIccData ()
{
IntPtr ptr = CGColorSpaceCopyICCData (handle);
return (ptr == IntPtr.Zero) ? null : new NSData (ptr, true);
}
#if !NET
[iOS (10,0)]
[TV (10,0)]
#endif
[DllImport (Constants.CoreGraphicsLibrary)]
static extern unsafe /* CFStringRef* */ IntPtr CGColorSpaceCopyName (/* CGColorSpaceRef */ IntPtr space);
#if !NET
[iOS (10,0)]
[TV (10,0)]
#endif
public string Name {
get {
return CFString.FetchString (CGColorSpaceCopyName (handle), true);
}
}
#if !NET
[iOS (10,0)][Mac (10,12)]
[Watch (3,0)]
[TV (10,0)]
#endif
[DllImport (Constants.CoreGraphicsLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool CGColorSpaceIsWideGamutRGB (/* CGColorSpaceRef */ IntPtr space);
#if !NET
[iOS (10,0)][Mac (10,12)]
[Watch (3,0)]
[TV (10,0)]
#endif
public bool IsWideGamutRgb {
get {
return CGColorSpaceIsWideGamutRGB (handle);
}
}
#if !NET
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
#endif
[DllImport (Constants.CoreGraphicsLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool CGColorSpaceSupportsOutput (/* CGColorSpaceRef */ IntPtr space);
#if !NET
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
#endif
public bool SupportsOutput {
get {
return CGColorSpaceSupportsOutput (handle);
}
}
#if !NET
[iOS(10,0)][Mac(10,12)][TV(10,0)][Watch(5,0)]
#endif
[DllImport (Constants.CoreGraphicsLibrary)]
static extern IntPtr CGColorSpaceCopyPropertyList (IntPtr space);
#if !NET
[iOS(10,0)][Mac(10,12)][TV(10,0)][Watch(5,0)]
#endif
[DllImport (Constants.CoreGraphicsLibrary)]
static extern IntPtr CGColorSpaceCreateWithPropertyList (IntPtr plist);
#if !NET
[iOS(10,0)][Mac(10,12)]
[TV(10,0)][Watch(5,0)]
#endif
public CFPropertyList ToPropertyList ()
{
var x = CGColorSpaceCopyPropertyList (handle);

Просмотреть файл

@ -192,7 +192,9 @@ namespace CoreText {
set {Adapter.SetNativeValue (Dictionary, CTStringAttributeKey.ForegroundColor, value);}
}
#if !NET
[iOS (10,0)][Mac (10,12)]
#endif
public CGColor BackgroundColor {
get {
var h = IntPtr.Zero;
@ -302,7 +304,9 @@ namespace CoreText {
}
}
#if !NET
[iOS (10,0)][Mac (10,12)][Watch (3,0)][TV (10,0)]
#endif
public int? HorizontalInVerticalForms {
get {
var x = CTStringAttributeKey.HorizontalInVerticalForms;

Просмотреть файл

@ -10,7 +10,9 @@ using Foundation;
namespace GameController {
[iOS (10,0), TV (9,0), Mac (10,12)]
#if !NET
[iOS (10,0), Mac (10,12)]
#endif
// GCMicroGamepadSnapshot.h
// float_t are 4 bytes (at least for ARM64)
[StructLayout (LayoutKind.Sequential, Pack = 1)]

Просмотреть файл

@ -24,7 +24,9 @@ namespace GameplayKit {
}
}
#if !NET
[iOS (10,0), TV (10,0), Mac (10,12)]
#endif
[Register ("GKObstacleGraph", SkipRegistration = true)]
public partial class GKObstacleGraph<NodeType> : GKObstacleGraph where NodeType : GKGraphNode2D {

Просмотреть файл

@ -50,7 +50,9 @@ namespace GameplayKit {
}
}
#if !NET
[iOS (10,0), TV (10,0), Mac (10,12)]
#endif
public static GKPath FromPoints (Vector3 [] points, float radius, bool cyclical)
{
if (points == null)
@ -68,7 +70,9 @@ namespace GameplayKit {
}
}
#if !NET
[iOS (10,0), TV (10,0), Mac (10,12)]
#endif
public GKPath (Vector3 [] points, float radius, bool cyclical)
{
if (points == null)

Просмотреть файл

@ -16,21 +16,27 @@ using Vector3 = global::OpenTK.Vector3;
namespace GameplayKit {
#if !NET
[iOS (10,0), TV (10,0), Mac (10,12)]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct GKBox {
public Vector3 Min;
public Vector3 Max;
}
#if !NET
[iOS (10,0), TV (10,0), Mac (10,12)]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct GKQuad {
public Vector2 Min;
public Vector2 Max;
}
#if !NET
[iOS (10,0), TV (10,0), Mac (10,12)]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct GKTriangle {
[MarshalAs (UnmanagedType.ByValArray, SizeConst = 3)]

Просмотреть файл

@ -12,7 +12,10 @@ using Foundation;
using ObjCRuntime;
namespace GameplayKit {
#if !NET
[iOS (10,0), TV (10,0), Mac (10,12)]
#endif
public static class NSArray_GameplayKit {
[Export ("shuffledArrayWithRandomSource:")]

Просмотреть файл

@ -6,7 +6,6 @@ using ObjCRuntime;
namespace HealthKit {
[Obsolete ("Use the 'HKQuantityTypeIdentifier' enum instead.")]
[Introduced (PlatformName.WatchOS, 2,0, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All)]
public unsafe static partial class HKQuantityTypeIdentifierKey {
public static NSString ActiveEnergyBurned {
@ -545,7 +544,6 @@ namespace HealthKit {
} /* class HKQuantityTypeIdentifierKey */
[Obsolete ("Use the 'HKCategoryTypeIdentifier' enum instead.")]
[Introduced (PlatformName.WatchOS, 2,0, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All)]
public unsafe static partial class HKCategoryTypeIdentifierKey {
[Introduced (PlatformName.iOS, 9,0, PlatformArchitecture.All)]
@ -614,7 +612,6 @@ namespace HealthKit {
} /* class HKCategoryTypeIdentifierKey */
[Obsolete ("Use the 'HKCharacteristicTypeIdentifier' enum instead.")]
[Introduced (PlatformName.WatchOS, 2,0, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All)]
public unsafe static partial class HKCharacteristicTypeIdentifierKey {
public static NSString BiologicalSex {
@ -655,7 +652,6 @@ namespace HealthKit {
} /* class HKCharacteristicTypeIdentifierKey */
[Obsolete ("Use the 'HKCorrelationType' enum instead.")]
[Introduced (PlatformName.WatchOS, 2,0, PlatformArchitecture.All)]
[Introduced (PlatformName.iOS, 8,0, PlatformArchitecture.All)]
public unsafe static partial class HKCorrelationTypeKey {
public static NSString IdentifierBloodPressure {

Просмотреть файл

@ -4,8 +4,10 @@ using Foundation;
namespace HomeKit {
#if !NET
[TV (10,0)]
[iOS (8,0)]
#endif
public partial class HMCharacteristicMetadata
{
public HMCharacteristicMetadataUnits Units {

Просмотреть файл

@ -4,8 +4,10 @@ using Foundation;
namespace HomeKit {
#if !NET
[iOS (8,0)]
[TV (10,0)]
#endif
public class HMCharacteristicProperties {
public bool SupportsChangeNumber { get; set; }

Просмотреть файл

@ -6,8 +6,10 @@ using Foundation;
namespace HomeKit {
#if !NET
[iOS (8,0)]
[TV (10,0)]
#endif
public partial class HMHome
{
public HMService [] GetServices (HMServiceType serviceTypes)

Просмотреть файл

@ -5,8 +5,10 @@ using Foundation;
namespace HomeKit {
#if !NET
[TV (10,0)]
[iOS (8,0)]
#endif
public partial class HMService {
#if !WATCH && !TVOS

Просмотреть файл

@ -1374,21 +1374,21 @@ $(GENERATE_TYPE_FORWARDERS): $(wildcard generate-type-forwarders/*.cs*) Makefile
$(Q) $(SYSTEM_MSBUILD) /r generate-type-forwarders/generate-type-forwarders.csproj $(MSBUILD_VERBOSITY)
$(MACCATALYST_BUILD_DIR)/reference/Xamarin.iOS.cs: $(MACCATALYST_BUILD_DIR)/reference/Xamarin.MacCatalyst.dll $(IOS_BUILD_DIR)/reference/Xamarin.iOS.dll Makefile $(GENERATE_TYPE_FORWARDERS)
$(Q) mono $(GENERATE_TYPE_FORWARDERS) $(abspath $(IOS_BUILD_DIR)/reference/Xamarin.iOS.dll) $(abspath $(MACCATALYST_BUILD_DIR)/reference/Xamarin.MacCatalyst.dll) $(abspath $@.tmp)
$(Q) mono $(GENERATE_TYPE_FORWARDERS) $(abspath $(IOS_BUILD_DIR)/reference/Xamarin.iOS.dll) $(abspath $(MACCATALYST_BUILD_DIR)/reference/Xamarin.MacCatalyst.dll) $(abspath $@.tmp) $(MIN_MACCATALYST_SDK_VERSION)
$(Q) mv $@.tmp $@
$(MACCATALYST_BUILD_DIR)/reference/Xamarin.iOS.dll: $(MACCATALYST_BUILD_DIR)/reference/Xamarin.iOS.cs
$(Q) $(MACCATALYST_CSC) $< -out:$@ -r:$(MACCATALYST_BUILD_DIR)/reference/Xamarin.MacCatalyst.dll -target:library -deterministic -publicsign -keyfile:$(PRODUCT_KEY_PATH) -nologo -nowarn:108,114,618 -unsafe
$(MACCATALYST_DOTNET_BUILD_DIR)/ref/Xamarin.iOS.cs: $(MACCATALYST_DOTNET_BUILD_DIR)/ref/Xamarin.MacCatalyst.dll $(IOS_DOTNET_BUILD_DIR)/ref/Xamarin.iOS.dll Makefile $(GENERATE_TYPE_FORWARDERS)
$(Q) mono $(GENERATE_TYPE_FORWARDERS) $(IOS_DOTNET_BUILD_DIR)/ref/Xamarin.iOS.dll $(MACCATALYST_DOTNET_BUILD_DIR)/ref/Xamarin.MacCatalyst.dll $@.tmp
$(Q) mono $(GENERATE_TYPE_FORWARDERS) $(IOS_DOTNET_BUILD_DIR)/ref/Xamarin.iOS.dll $(MACCATALYST_DOTNET_BUILD_DIR)/ref/Xamarin.MacCatalyst.dll $@.tmp $(DOTNET_MIN_MACCATALYST_SDK_VERSION)
$(Q) mv $@.tmp $@
$(MACCATALYST_DOTNET_BUILD_DIR)/ref/Xamarin.iOS.dll: $(MACCATALYST_DOTNET_BUILD_DIR)/ref/Xamarin.iOS.cs
$(Q) $(DOTNET6_CSC) $(DOTNET_FLAGS) $< -out:$@ -r:$(MACCATALYST_DOTNET_BUILD_DIR)/ref/Xamarin.MacCatalyst.dll -target:library -deterministic -publicsign -keyfile:$(PRODUCT_KEY_PATH) -nologo -nowarn:108,114,618 -unsafe
$(MACCATALYST_BUILD_DIR)/reference/OpenTK-1.0.cs: $(MACCATALYST_BUILD_DIR)/reference/Xamarin.MacCatalyst.dll $(IOS_BUILD_DIR)/reference/OpenTK-1.0.dll Makefile $(GENERATE_TYPE_FORWARDERS)
$(Q) mono $(GENERATE_TYPE_FORWARDERS) $(IOS_BUILD_DIR)/reference/OpenTK-1.0.dll $(MACCATALYST_BUILD_DIR)/reference/Xamarin.MacCatalyst.dll $@.tmp
$(Q) mono $(GENERATE_TYPE_FORWARDERS) $(IOS_BUILD_DIR)/reference/OpenTK-1.0.dll $(MACCATALYST_BUILD_DIR)/reference/Xamarin.MacCatalyst.dll $@.tmp $(MIN_MACCATALYST_SDK_VERSION)
$(Q) mv $@.tmp $@
$(MACCATALYST_BUILD_DIR)/reference/OpenTK-1.0.dll: $(MACCATALYST_BUILD_DIR)/reference/OpenTK-1.0.cs $(MACCATALYST_BUILD_DIR)/reference/Xamarin.iOS.dll

Просмотреть файл

@ -15,8 +15,10 @@ using MapKit;
namespace MapKit {
public partial class MKOverlayView {
#if !NET
[TV (9,2)]
[Mac (10,9)]
#endif
[DllImport (Constants.MapKitLibrary)]
public static extern nfloat MKRoadWidthAtZoomScale (/* MKZoomScale */ nfloat zoomScale);
}

Просмотреть файл

@ -142,7 +142,9 @@ namespace MapKit {
Height = height;
}
#if !NET
[TV (9,2)]
#endif
public static MKMapSize World { get { return new MKMapSize (0x10000000, 0x10000000); }}
// MKMapSizeEqualToSize
@ -180,9 +182,13 @@ namespace MapKit {
// MKGeometry.h
[StructLayout (LayoutKind.Sequential)]
#if !NET
[Mac (10,9)]
#endif
public struct MKMapRect {
#if !NET
[TV (9,2)]
#endif
public static readonly MKMapRect Null = new MKMapRect (double.PositiveInfinity, double.PositiveInfinity, 0, 0);
public MKMapPoint Origin;
@ -273,7 +279,9 @@ namespace MapKit {
}
}
#if !NET
[TV (9,2)]
#endif
public MKMapRect World {
get {
return new MKMapRect (0, 0, 0x10000000, 0x10000000);

Просмотреть файл

@ -45,11 +45,15 @@ namespace Metal {
#if !COREBUILD
public static class MTLVertexFormatExtensions {
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
[DllImport (Constants.MetalKitLibrary)]
static extern /* MDLVertexFormat */ nuint MTKModelIOVertexFormatFromMetal (/* MTLVertexFormat */ nuint modelIODescriptor);
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
public static MDLVertexFormat ToModelVertexFormat (this MTLVertexFormat vertexFormat)
{
nuint mdlVertexFormat = MTKModelIOVertexFormatFromMetal ((nuint)(ulong)vertexFormat);
@ -254,7 +258,9 @@ namespace Metal {
public uint BaseInstance;
}
#if !NET
[iOS (10,0), TV (10,0), NoWatch, Mac (10,12)]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct MTLSizeAndAlign
{
@ -269,7 +275,9 @@ namespace Metal {
}
#if !NET
[iOS (10,0), TV (10,0), NoWatch, Mac (10,12)]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct MTLDrawPatchIndirectArguments
{
@ -288,7 +296,9 @@ namespace Metal {
}
#if !NET
[iOS (10,0), TV (10,0), NoWatch, Mac (10,12)]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct MTLQuadTessellationFactorsHalf
{
@ -305,7 +315,9 @@ namespace Metal {
}
#if !NET
[iOS (10,0), TV (10,0), NoWatch, Mac (10,12)]
#endif
[StructLayout (LayoutKind.Sequential)]
public struct MTLTriangleTessellationFactorsHalf
{

Просмотреть файл

@ -11,11 +11,15 @@ using Metal;
namespace Metal {
public partial class MTLVertexDescriptor {
#if !NET
[iOS (9,0)]
#endif
[DllImport (Constants.MetalKitLibrary)]
static extern /* MTLVertexDescriptor __nonnull */ IntPtr MTKMetalVertexDescriptorFromModelIO (/* MDLVertexDescriptor __nonnull */ IntPtr modelIODescriptor);
#if !NET
[iOS (9,0)]
#endif
public static MTLVertexDescriptor FromModelIO (MDLVertexDescriptor descriptor)
{
if (descriptor == null)
@ -23,13 +27,17 @@ namespace Metal {
return Runtime.GetNSObject<MTLVertexDescriptor> (MTKMetalVertexDescriptorFromModelIO (descriptor.Handle));
}
#if !NET
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
#endif
[DllImport (Constants.MetalKitLibrary)]
static extern /* MTLVertexDescriptor __nonnull */ IntPtr MTKMetalVertexDescriptorFromModelIOWithError (/* MDLVertexDescriptor __nonnull */ IntPtr modelIODescriptor, out IntPtr error);
#if !NET
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
#endif
public static MTLVertexDescriptor FromModelIO (MDLVertexDescriptor descriptor, out NSError error)
{
if (descriptor == null)

Просмотреть файл

@ -79,13 +79,17 @@ namespace ModelIO {
// Note: we turn these constructors into static constructors because we don't want to lose the shape name. Also, the signatures of these constructors differ so it would not be possible to use an enum to differentiate the shapes.
#if !NET
[iOS (10,0)][TV (10,0)][Mac (10,12)]
#endif
public static MDLMesh CreateBox (Vector3 dimensions, Vector3i segments, MDLGeometryType geometryType, bool inwardNormals, IMDLMeshBufferAllocator allocator)
{
return CreateBox (dimensions, segments, geometryType, inwardNormals, allocator, MDLMeshVectorType.Dimensions);
}
#if !NET
[iOS (10,0)][TV (10,0)][Mac (10,12)]
#endif
public static MDLMesh CreateBox (Vector3 vector, Vector3i segments, MDLGeometryType geometryType, bool inwardNormals, IMDLMeshBufferAllocator allocator, MDLMeshVectorType type = MDLMeshVectorType.Dimensions)
{
switch (type) {
@ -98,43 +102,57 @@ namespace ModelIO {
}
}
#if !NET
[iOS (10,0)][TV (10,0)][Mac (10,12)]
#endif
public static MDLMesh CreateSphere (Vector3 dimensions, Vector2i segments, MDLGeometryType geometryType, bool inwardNormals, IMDLMeshBufferAllocator allocator)
{
return new MDLMesh (dimensions, segments, inwardNormals, geometryType, allocator, null, null, null);
}
#if !NET
[iOS (10,0)][TV (10,0)][Mac (10,12)]
#endif
public static MDLMesh CreateHemisphere (Vector3 dimensions, Vector2i segments, MDLGeometryType geometryType, bool inwardNormals, bool cap, IMDLMeshBufferAllocator allocator)
{
return new MDLMesh (dimensions, segments, inwardNormals, geometryType, allocator, null, cap, false);
}
#if !NET
[iOS (10,0)][TV (10,0)][Mac (10,12)]
#endif
public static MDLMesh CreateCylinder (Vector3 extent, Vector2i segments, bool inwardNormals, bool topCap, bool bottomCap, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
{
return new MDLMesh (extent, segments, inwardNormals, topCap, bottomCap, geometryType, allocator);
}
#if !NET
[iOS (10,0)][TV (10,0)][Mac (10,12)]
#endif
public static MDLMesh CreateCapsule (Vector3 dimensions, Vector2i segments, MDLGeometryType geometryType, bool inwardNormals, int hemisphereSegments, IMDLMeshBufferAllocator allocator)
{
return new MDLMesh (dimensions, segments, inwardNormals, geometryType, allocator, hemisphereSegments, null, null);
}
#if !NET
[iOS (10,0)][TV (10,0)][Mac (10,12)]
#endif
public static MDLMesh CreateCone (Vector3 dimensions, Vector2i segments, MDLGeometryType geometryType, bool inwardNormals, bool cap, IMDLMeshBufferAllocator allocator)
{
return new MDLMesh (dimensions, segments, inwardNormals, geometryType, allocator, null, cap, true);
}
#if !NET
[iOS (10,0)][TV (10,0)][Mac (10,12)]
#endif
public static MDLMesh CreatePlane (Vector3 extent, Vector2i segments, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
{
return new MDLMesh (extent, segments, geometryType, allocator);
}
#if !NET
[iOS (10,0)][TV (10,0)][Mac (10,12)]
#endif
public static MDLMesh CreateIcosahedron (Vector3 extent, bool inwardNormals, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
{
return new MDLMesh (extent, inwardNormals, geometryType, allocator);

Просмотреть файл

@ -20,13 +20,17 @@ namespace ModelIO {
return Runtime.GetNSObject<MDLVertexDescriptor> (MTKModelIOVertexDescriptorFromMetal (descriptor.Handle));
}
#if !NET
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
#endif
[DllImport (Constants.MetalKitLibrary)]
static extern /* MDLVertexDescriptor __nonnull */ IntPtr MTKModelIOVertexDescriptorFromMetalWithError (/* MTLVertexDescriptor __nonnull */ IntPtr metalDescriptor, out /* NSError */ IntPtr error);
#if !NET
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
#endif
public static MDLVertexDescriptor FromMetal (MTLVertexDescriptor descriptor, out NSError error)
{
if (descriptor == null)

Просмотреть файл

@ -93,6 +93,79 @@ namespace ObjCRuntime
public override string ToString ()
{
var builder = new StringBuilder ();
#if NET && BGENERATOR
switch (AvailabilityKind) {
case AvailabilityKind.Introduced:
builder.Append ("[SupportedOSPlatform (\"");
break;
case AvailabilityKind.Obsoleted:
switch (Platform) {
case PlatformName.iOS:
builder.AppendLine ("#if __IOS__");
break;
case PlatformName.TvOS:
builder.AppendLine ("#if __TVOS__");
break;
case PlatformName.WatchOS:
builder.AppendLine ("#if __WATCHOS__");
break;
case PlatformName.MacOSX:
builder.AppendLine ("#if __MACOS__");
break;
case PlatformName.MacCatalyst:
builder.AppendLine ("#if __MACCATALYST__");
break;
default:
throw new NotSupportedException ($"Unknown platform: {Platform}");
}
builder.Append ("[Obsolete (\"Starting with ");
break;
case AvailabilityKind.Deprecated:
case AvailabilityKind.Unavailable:
builder.Append ("[UnsupportedOSPlatform (\"");
break;
}
switch (Platform) {
case PlatformName.iOS:
builder.Append ("ios");
break;
case PlatformName.TvOS:
builder.Append ("tvos");
break;
case PlatformName.WatchOS:
builder.Append ("watchos");
break;
case PlatformName.MacOSX:
builder.Append ("macos"); // no 'x'
break;
case PlatformName.MacCatalyst:
builder.Append ("maccatalyst");
break;
default:
throw new NotSupportedException ($"Unknown platform: {Platform}");
}
if (Version != null)
builder.Append (Version.ToString (Version.Build >= 0 ? 3 : 2));
switch (AvailabilityKind) {
case AvailabilityKind.Obsoleted:
if (!String.IsNullOrEmpty (Message))
builder.Append (' ').Append (Message);
else
builder.Append ('.'); // intro check messages to they end with a '.'
// TODO add a URL (wiki?) and DiagnosticId (one per platform?) for documentation
builder.AppendLine ("\", DiagnosticId = \"BI1234\", UrlFormat = \"https://github.com/xamarin/xamarin-macios/wiki/Obsolete\")]");
builder.Append ("#endif");
break;
case AvailabilityKind.Introduced:
case AvailabilityKind.Deprecated:
case AvailabilityKind.Unavailable:
builder.Append ("\")]");
break;
}
#else
builder.AppendFormat ("[{0} ({1}.{2}", AvailabilityKind, nameof (PlatformName), Platform);
if (Version != null) {
@ -108,6 +181,7 @@ namespace ObjCRuntime
builder.AppendFormat (", message: \"{0}\"", Message.Replace ("\"", "\"\""));
builder.Append (")]");
#endif
return builder.ToString ();
}
}

Просмотреть файл

@ -21,8 +21,10 @@ namespace OpenGLES
}
#endif
#if !NET
[iOS (10,0)]
[TV (10,0)]
#endif
public virtual bool PresentRenderBuffer (nuint target, double presentationTime)
{
return _PresentRenderbufferAtTime (target, presentationTime);

Просмотреть файл

@ -769,11 +769,15 @@ namespace Security {
return _Decrypt (padding, cipherText, ref plainText);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern IntPtr /* SecKeyRef _Nullable */ SecKeyCreateRandomKey (IntPtr /* CFDictionaryRef* */ parameters, out IntPtr /* CFErrorRef** */ error);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
static public SecKey CreateRandomKey (NSDictionary parameters, out NSError error)
{
if (parameters == null)
@ -785,7 +789,9 @@ namespace Security {
return key == IntPtr.Zero ? null : new SecKey (key, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
static public SecKey CreateRandomKey (SecKeyType keyType, int keySizeInBits, NSDictionary parameters, out NSError error)
{
using (var ks = new NSNumber (keySizeInBits))
@ -796,7 +802,9 @@ namespace Security {
}
}
#if !NET
[Watch (3, 0)][TV (10, 0)][Mac (10, 12)][iOS (10, 0)]
#endif
static public SecKey CreateRandomKey (SecKeyGenerationParameters parameters, out NSError error)
{
if (parameters == null)
@ -809,11 +817,15 @@ namespace Security {
}
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern IntPtr /* SecKeyRef _Nullable */ SecKeyCreateWithData (IntPtr /* CFDataRef* */ keyData, IntPtr /* CFDictionaryRef* */ attributes, out IntPtr /* CFErrorRef** */ error);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
static public SecKey Create (NSData keyData, NSDictionary parameters, out NSError error)
{
if (keyData == null)
@ -827,7 +839,9 @@ namespace Security {
return key == IntPtr.Zero ? null : new SecKey (key, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
static public SecKey Create (NSData keyData, SecKeyType keyType, SecKeyClass keyClass, int keySizeInBits, NSDictionary parameters, out NSError error)
{
using (var ks = new NSNumber (keySizeInBits))
@ -839,11 +853,15 @@ namespace Security {
}
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern IntPtr /* CFDataRef _Nullable */ SecKeyCopyExternalRepresentation (IntPtr /* SecKeyRef* */ key, out IntPtr /* CFErrorRef** */ error);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public NSData GetExternalRepresentation (out NSError error)
{
IntPtr err;
@ -852,7 +870,9 @@ namespace Security {
return Runtime.GetNSObject<NSData> (data, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public NSData GetExternalRepresentation ()
{
IntPtr err;
@ -860,44 +880,60 @@ namespace Security {
return Runtime.GetNSObject<NSData> (data, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern IntPtr /* CFDictionaryRef _Nullable */ SecKeyCopyAttributes (IntPtr /* SecKeyRef* */ key);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public NSDictionary GetAttributes ()
{
var dict = SecKeyCopyAttributes (handle);
return Runtime.GetNSObject<NSDictionary> (dict, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern IntPtr /* SecKeyRef* */ SecKeyCopyPublicKey (IntPtr /* SecKeyRef* */ key);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public SecKey GetPublicKey ()
{
var key = SecKeyCopyPublicKey (handle);
return key == IntPtr.Zero ? null : new SecKey (key, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
[return: MarshalAs (UnmanagedType.U1)]
static extern bool /* Boolean */ SecKeyIsAlgorithmSupported (IntPtr /* SecKeyRef* */ key, /* SecKeyOperationType */ nint operation, IntPtr /* SecKeyAlgorithm* */ algorithm);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public bool IsAlgorithmSupported (SecKeyOperationType operation, SecKeyAlgorithm algorithm)
{
return SecKeyIsAlgorithmSupported (handle, (int) operation, algorithm.GetConstant ().Handle);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* CFDataRef _Nullable */ IntPtr SecKeyCreateSignature (/* SecKeyRef */ IntPtr key, /* SecKeyAlgorithm */ IntPtr algorithm, /* CFDataRef */ IntPtr dataToSign, /* CFErrorRef* */ out IntPtr error);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public NSData CreateSignature (SecKeyAlgorithm algorithm, NSData dataToSign, out NSError error)
{
if (dataToSign == null)
@ -909,12 +945,16 @@ namespace Security {
return Runtime.GetNSObject<NSData> (data, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
[return: MarshalAs (UnmanagedType.U1)]
static extern /* Boolean */ bool SecKeyVerifySignature (/* SecKeyRef */ IntPtr key, /* SecKeyAlgorithm */ IntPtr algorithm, /* CFDataRef */ IntPtr signedData, /* CFDataRef */ IntPtr signature, /* CFErrorRef* */ out IntPtr error);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public bool VerifySignature (SecKeyAlgorithm algorithm, NSData signedData, NSData signature, out NSError error)
{
if (signedData == null)
@ -928,11 +968,15 @@ namespace Security {
return result;
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* CFDataRef _Nullable */ IntPtr SecKeyCreateEncryptedData (/* SecKeyRef */ IntPtr key, /* SecKeyAlgorithm */ IntPtr algorithm, /* CFDataRef */ IntPtr plaintext, /* CFErrorRef* */ out IntPtr error);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public NSData CreateEncryptedData (SecKeyAlgorithm algorithm, NSData plaintext, out NSError error)
{
if (plaintext == null)
@ -944,11 +988,15 @@ namespace Security {
return Runtime.GetNSObject<NSData> (data, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* CFDataRef _Nullable */ IntPtr SecKeyCreateDecryptedData (/* SecKeyRef */ IntPtr key, /* SecKeyAlgorithm */ IntPtr algorithm, /* CFDataRef */ IntPtr ciphertext, /* CFErrorRef* */ out IntPtr error);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public NSData CreateDecryptedData (SecKeyAlgorithm algorithm, NSData ciphertext, out NSError error)
{
if (ciphertext == null)
@ -960,11 +1008,15 @@ namespace Security {
return Runtime.GetNSObject<NSData> (data, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* CFDataRef _Nullable */ IntPtr SecKeyCopyKeyExchangeResult (/* SecKeyRef */ IntPtr privateKey, /* SecKeyAlgorithm */ IntPtr algorithm, /* SecKeyRef */ IntPtr publicKey, /* CFDictionaryRef */ IntPtr parameters, /* CFErrorRef* */ out IntPtr error);
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public NSData GetKeyExchangeResult (SecKeyAlgorithm algorithm, SecKey publicKey, NSDictionary parameters, out NSError error)
{
if (publicKey == null)
@ -978,7 +1030,9 @@ namespace Security {
return Runtime.GetNSObject<NSData> (data, true);
}
#if !NET
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
#endif
public NSData GetKeyExchangeResult (SecKeyAlgorithm algorithm, SecKey publicKey, SecKeyKeyExchangeParameter parameters, out NSError error)
{
return GetKeyExchangeResult (algorithm, publicKey, parameters?.Dictionary, out error);

Просмотреть файл

@ -545,15 +545,19 @@ namespace Security {
}
#endif
#if !NET
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
[Watch (3,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern int SSLSetSessionConfig (IntPtr /* SSLContextRef* */ context, IntPtr /* CFStringRef* */ config);
#if !NET
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
[Watch (3,0)]
#endif
[EditorBrowsable (EditorBrowsableState.Advanced)]
public int SetSessionConfig (NSString config)
{
@ -563,36 +567,48 @@ namespace Security {
return SSLSetSessionConfig (Handle, config.Handle);
}
#if !NET
[iOS (10,0)][Mac (10,12)]
[TV (10,0)]
#endif
public int SetSessionConfig (SslSessionConfig config)
{
return SetSessionConfig (config.GetConstant ());
}
#if !NET
[iOS (10,0)][Mac (10,12)]
[Watch (3,0)]
[TV (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern int SSLReHandshake (IntPtr /* SSLContextRef* */ context);
#if !NET
[iOS (10,0)][Mac (10,12)]
[Watch (3,0)]
[TV (10,0)]
#endif
public int ReHandshake ()
{
return SSLReHandshake (Handle);
}
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* OSStatus */ SslStatus SSLCopyRequestedPeerName (IntPtr /* SSLContextRef* */ context, byte[] /* char* */ peerName, ref nuint /* size_t */ peerNameLen);
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* OSStatus */ SslStatus SSLCopyRequestedPeerNameLength (IntPtr /* SSLContextRef* */ context, ref nuint /* size_t */ peerNameLen);
#if !NET
[iOS (9,0)][Mac (10,11)]
#endif
public string GetRequestedPeerName ()
{
var result = String.Empty;

Просмотреть файл

@ -9,13 +9,19 @@
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
#if TVOS && !XAMCORE_4_0
namespace StoreKit {
[Obsolete ("Not usable from tvOS and will be removed in the future.")]
#if NET
[UnsupportedOSPlatform ("tvos")]
#else
[Unavailable (PlatformName.TvOS)]
#endif
public class SKAdNetwork : NSObject {
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]

Просмотреть файл

@ -0,0 +1,37 @@
// Copyright 2015 Xamarin Inc.
#if !COREBUILD
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using CoreGraphics;
using Foundation;
using ObjCRuntime;
namespace TVServices {
static public class TVContentItemImageShapeExtensions {
#if NET
[UnsupportedOSPlatform ("tvos13.0")]
#else
[Deprecated (PlatformName.TvOS, 13,0)]
#endif
[DllImport (Constants.TVServicesLibrary)]
static extern CGSize TVTopShelfImageSizeForShape (/* TVContentItemImageShape */ nint shape,
/* TVTopShelfContentStyle */ nint style);
#if NET
[UnsupportedOSPlatform ("tvos13.0")]
#else
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'TVTopShelfSectionedContent.GetImageSize' or 'TVTopShelfInsetContent.ImageSize' instead.")]
#endif
static public CGSize GetSize (this TVContentItemImageShape self, TVTopShelfContentStyle style)
{
return TVTopShelfImageSizeForShape ((nint) (int) self, (nint) (int) style);
}
}
}
#endif

Просмотреть файл

@ -2,13 +2,21 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using CoreGraphics;
using Foundation;
using ObjCRuntime;
#nullable enable
namespace TVServices {
#if NET
[SupportedOSPlatform ("tvos9.0")]
#else
[TV (9,0)]
#endif
[Native]
public enum TVContentItemImageShape : long {
None = 0,
@ -20,14 +28,22 @@ namespace TVServices {
ExtraWide
}
#if NET
[SupportedOSPlatform ("tvos9.0")]
#else
[TV (9,0)]
#endif
[Native]
public enum TVTopShelfContentStyle : long {
Inset = 1,
Sectioned = 2
}
#if NET
[SupportedOSPlatform ("tvos11.0")]
#else
[TV (11,0)]
#endif
[Native]
[Flags]
public enum TVContentItemImageTrait : ulong {
@ -36,18 +52,4 @@ namespace TVServices {
ScreenScale1x = (1 << 12),
ScreenScale2x = (2 << 12),
}
static public class TVContentItemImageShapeExtensions {
[Deprecated (PlatformName.TvOS, 13,0)]
[DllImport (Constants.TVServicesLibrary)]
static extern CGSize TVTopShelfImageSizeForShape (/* TVContentItemImageShape */ nint shape,
/* TVTopShelfContentStyle */ nint style);
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'TVTopShelfSectionedContent.GetImageSize' or 'TVTopShelfInsetContent.ImageSize' instead.")]
static public CGSize GetSize (this TVContentItemImageShape self, TVTopShelfContentStyle style)
{
return TVTopShelfImageSizeForShape ((nint) (int) self, (nint) (int) style);
}
}
}

Просмотреть файл

@ -60,11 +60,15 @@ namespace UIKit {
// UIAccessibility.h
#if !NET
[iOS (9,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
extern static /* NSObject */ IntPtr UIAccessibilityFocusedElement (IntPtr assistiveTechnologyIdentifier);
#if !NET
[iOS (9,0)]
#endif
public static NSObject FocusedElement (string assistiveTechnologyIdentifier)
{
using (var s = new NSString (assistiveTechnologyIdentifier))
@ -72,12 +76,16 @@ namespace UIKit {
}
// UIAccessibility.h
#if !NET
[iOS (9,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
extern static /* BOOL */ bool UIAccessibilityIsShakeToUndoEnabled ();
#if !NET
[iOS (9,0)]
#endif
public static bool IsShakeToUndoEnabled {
get {
return UIAccessibilityIsShakeToUndoEnabled ();
@ -163,11 +171,15 @@ namespace UIKit {
extern public static void RegisterGestureConflictWithZoom ();
// UIAccessibility.h
#if !NET
[iOS (7,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
extern static /* UIBezierPath* */ IntPtr UIAccessibilityConvertPathToScreenCoordinates (/* UIBezierPath* */ IntPtr path, /* UIView* */ IntPtr view);
#if !NET
[iOS (7,0)]
#endif
public static UIBezierPath ConvertPathToScreenCoordinates (UIBezierPath path, UIView view)
{
if (path == null)
@ -179,11 +191,15 @@ namespace UIKit {
}
// UIAccessibility.h
#if !NET
[iOS (7,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
extern static CGRect UIAccessibilityConvertFrameToScreenCoordinates (CGRect rect, /* UIView* */ IntPtr view);
#if !NET
[iOS (7,0)]
#endif
public static CGRect ConvertFrameToScreenCoordinates (CGRect rect, UIView view)
{
if (view == null)
@ -193,11 +209,15 @@ namespace UIKit {
}
// UIAccessibility.h
#if !NET
[iOS (7,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
extern unsafe static void UIAccessibilityRequestGuidedAccessSession (/* BOOL */ [MarshalAs (UnmanagedType.I1)] bool enable, /* void(^completionHandler)(BOOL didSucceed) */ void * completionHandler);
#if !NET
[iOS (7,0)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public static void RequestGuidedAccessSession (bool enable, Action<bool> completionHandler)
{
@ -213,7 +233,9 @@ namespace UIKit {
}
}
#if !NET
[iOS (7,0)]
#endif
public static Task<bool> RequestGuidedAccessSessionAsync (bool enable)
{
var tcs = new TaskCompletionSource<bool> ();
@ -235,12 +257,16 @@ namespace UIKit {
del (enable);
}
#if !NET
[iOS (8,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool UIAccessibilityDarkerSystemColorsEnabled ();
#if !NET
[iOS (8,0)]
#endif
public static bool DarkerSystemColorsEnabled {
get {
return UIAccessibilityDarkerSystemColorsEnabled ();
@ -248,7 +274,9 @@ namespace UIKit {
}
#if !XAMCORE_4_0
#if !NET
[iOS (8,0)]
#endif
[Obsolete ("Use 'DarkerSystemColorsEnabled' instead.")]
public static bool DarkerSystemColosEnabled {
get {
@ -257,12 +285,16 @@ namespace UIKit {
}
#endif
#if !NET
[iOS (8,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool UIAccessibilityIsBoldTextEnabled ();
#if !NET
[iOS (8,0)]
#endif
public static bool IsBoldTextEnabled {
get {
return UIAccessibilityIsBoldTextEnabled ();
@ -277,24 +309,32 @@ namespace UIKit {
[TV (14,0), iOS (14,0)]
public static bool ButtonShapesEnabled => UIAccessibilityButtonShapesEnabled ();
#if !NET
[iOS (8,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool UIAccessibilityIsGrayscaleEnabled ();
#if !NET
[iOS (8,0)]
#endif
static public bool IsGrayscaleEnabled {
get {
return UIAccessibilityIsGrayscaleEnabled ();
}
}
#if !NET
[iOS (8,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool UIAccessibilityIsReduceMotionEnabled ();
#if !NET
[iOS (8,0)]
#endif
static public bool IsReduceMotionEnabled {
get {
return UIAccessibilityIsReduceMotionEnabled ();
@ -317,57 +357,80 @@ namespace UIKit {
[iOS (13,0), TV (13,0)]
static public bool IsVideoAutoplayEnabled => UIAccessibilityIsVideoAutoplayEnabled ();
#if !NET
[iOS (8,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool UIAccessibilityIsReduceTransparencyEnabled ();
#if !NET
[iOS (8,0)]
#endif
static public bool IsReduceTransparencyEnabled {
get {
return UIAccessibilityIsReduceTransparencyEnabled ();
}
}
#if !NET
[iOS (8,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool UIAccessibilityIsSwitchControlRunning ();
#if !NET
[iOS (8,0)]
#endif
static public bool IsSwitchControlRunning {
get {
return UIAccessibilityIsSwitchControlRunning ();
}
}
#if !NET
[iOS (8,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool UIAccessibilityIsSpeakSelectionEnabled ();
#if !NET
[iOS (8,0)]
#endif
static public bool IsSpeakSelectionEnabled {
get {
return UIAccessibilityIsSpeakSelectionEnabled ();
}
}
#if !NET
[iOS (8,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool UIAccessibilityIsSpeakScreenEnabled ();
#if !NET
[iOS (8,0)]
#endif
static public bool IsSpeakScreenEnabled {
get {
return UIAccessibilityIsSpeakScreenEnabled ();
}
}
#if !NET
[iOS (10,0), TV (10,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool UIAccessibilityIsAssistiveTouchRunning ();
#if !NET
[iOS (10,0), TV (10,0)]
#endif
public static bool IsAssistiveTouchRunning {
get {
return UIAccessibilityIsAssistiveTouchRunning ();
@ -391,11 +454,15 @@ namespace UIKit {
public static bool IsOnOffSwitchLabelsEnabled => UIAccessibilityIsOnOffSwitchLabelsEnabled ();
#if !TVOS
#if !NET
[iOS (10,0)]
#endif
[DllImport (Constants.UIKitLibrary)]
static extern nuint UIAccessibilityHearingDevicePairedEar ();
#if !NET
[iOS (10,0)]
#endif
public static UIAccessibilityHearingDeviceEar HearingDevicePairedEar {
get {
return (UIAccessibilityHearingDeviceEar)(ulong) UIAccessibilityHearingDevicePairedEar ();

Просмотреть файл

@ -9,6 +9,7 @@
//
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using CoreFoundation;
using ObjCRuntime;
@ -17,7 +18,12 @@ using CoreMedia;
using CoreVideo;
namespace VideoToolbox {
#if NET
[SupportedOSPlatform ("tvos10.2")]
#else
[iOS (8,0), TV (10,2)]
#endif
public class VTCompressionSession : VTSession {
GCHandle callbackHandle;

Просмотреть файл

@ -1,12 +1,17 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using ObjCRuntime;
namespace WatchKit {
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public static class WKAccessibility {

Просмотреть файл

@ -1,6 +1,7 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using CoreGraphics;
using Foundation;
@ -8,7 +9,11 @@ using ObjCRuntime;
namespace WatchKit {
[Register ("WKAccessibilityImageRegion", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKAccessibilityImageRegion : NSObject {

Просмотреть файл

@ -1,12 +1,17 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public enum WKErrorCode : long {
@ -19,6 +24,11 @@ namespace WatchKit {
RecordingFailedError = 6,
}
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
static public class WKErrorCodeExtensions {

Просмотреть файл

@ -1,22 +1,34 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
#if !NET
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public interface IWKImageAnimatable : INativeObject, IDisposable
{
#if NET
[UnsupportedOSPlatform ("ios")]
#endif
[Preserve (Conditional = true)]
void StartAnimating ();
#if NET
[UnsupportedOSPlatform ("ios")]
#endif
[Preserve (Conditional = true)]
void StartAnimating (NSRange imageRange, double duration, nint repeatCount);
#if NET
[UnsupportedOSPlatform ("ios")]
#endif
[Preserve (Conditional = true)]
void StopAnimating ();
}

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceButton", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceButton : WKInterfaceObject {

Просмотреть файл

@ -1,6 +1,7 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using CoreGraphics;
@ -10,7 +11,11 @@ using UIKit;
namespace WatchKit {
[Register ("WKInterfaceController", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public abstract class WKInterfaceController : NSObject {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceDate", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceDate : WKInterfaceObject {

Просмотреть файл

@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Versioning;
using CoreGraphics;
using Foundation;
@ -10,7 +11,11 @@ using UIKit;
namespace WatchKit {
[Register ("WKInterfaceDevice", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceDevice : NSObject {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceGroup", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceGroup : WKInterfaceObject, IWKImageAnimatable {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceImage", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceImage : WKInterfaceObject, IWKImageAnimatable {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceLabel", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceLabel : WKInterfaceObject {

Просмотреть файл

@ -1,6 +1,7 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using CoreGraphics;
using Foundation;
@ -8,7 +9,11 @@ using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceMap", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceMap : WKInterfaceObject {

Просмотреть файл

@ -1,11 +1,16 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using ObjCRuntime;
namespace WatchKit {
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public enum WKInterfaceMapPinColor : long {

Просмотреть файл

@ -1,6 +1,7 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using CoreGraphics;
using Foundation;
@ -9,7 +10,11 @@ using UIKit;
namespace WatchKit {
[Register ("WKInterfaceObject", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceObject : NSObject {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceSeparator", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceSeparator : WKInterfaceObject {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceSlider", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceSlider : WKInterfaceObject {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceSwitch", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceSwitch : WKInterfaceObject {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceTable", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceTable : WKInterfaceObject {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKInterfaceTimer", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKInterfaceTimer : WKInterfaceObject {

Просмотреть файл

@ -1,11 +1,16 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using ObjCRuntime;
namespace WatchKit {
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public enum WKMenuItemIcon : long {

Просмотреть файл

@ -1,11 +1,16 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using ObjCRuntime;
namespace WatchKit {
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public enum WKTextInputMode : long {

Просмотреть файл

@ -1,13 +1,18 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
namespace WatchKit {
[Register ("WKUserNotificationInterfaceController", SkipRegistration = true)]
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public class WKUserNotificationInterfaceController : WKInterfaceController {

Просмотреть файл

@ -1,12 +1,17 @@
#if __IOS__
using System;
using System.ComponentModel;
using System.Runtime.Versioning;
using ObjCRuntime;
namespace WatchKit {
#if NET
[UnsupportedOSPlatform ("ios")]
#else
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
#endif
[Obsolete (Constants.WatchKitRemoved)]
[EditorBrowsable (EditorBrowsableState.Never)]
public enum WKUserNotificationInterfaceType : long {

Просмотреть файл

@ -8343,6 +8343,7 @@ namespace AppKit {
}
[Mac (10, 0, 0, PlatformArchitecture.Arch32)] // kept for the arch limitation
[Deprecated (PlatformName.MacOSX, 10, 15, message: "API only available on 32bits platforms.")]
[BaseType (typeof (NSView))]
interface NSMenuView {
[Static]

Просмотреть файл

@ -196,6 +196,7 @@ namespace AVFoundation {
[NoTV][NoWatch]
[Field ("AVMediaTypeTimedMetadata")] // last header where I can find this: iOS 5.1 SDK, 10.7 only on Mac
[Availability (Obsoleted = Platform.iOS_6_0)]
[Deprecated (PlatformName.iOS, 12,0, message: "Always 'null'.")]
[Availability (Obsoleted = Platform.Mac_10_8)]
[NoMacCatalyst]
NSString TimedMetadata { get; }

Просмотреть файл

@ -332,6 +332,9 @@
<Compile Include="..\..\tools\common\Driver.execution.cs">
<Link>Driver.execution.cs</Link>
</Compile>
<Compile Include="..\..\tools\common\SdkVersions.cs">
<Link>SdkVersions.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\Resources.resx">

Просмотреть файл

@ -698,7 +698,6 @@ namespace CoreBluetooth {
[Export ("UUIDWithData:")]
CBUUID FromData (NSData theData);
[Availability (Deprecated = Platform.iOS_9_0)]
[Deprecated (PlatformName.MacOSX, 10, 13)]
[Deprecated (PlatformName.iOS, 9, 0)]
[NoWatch]

Просмотреть файл

@ -1575,9 +1575,12 @@ TVMLKIT_CORE_SOURCES = \
# TVServices
TVSERVICES_CORE_SOURCES = \
TVSERVICES_API_SOURCES = \
TVServices/TVEnums.cs \
TVSERVICES_CORE_SOURCES = \
TVServices/TVContentItemImageShape.cs \
# Twitter
TWITTER_CORE_SOURCES = \

Просмотреть файл

@ -24,7 +24,8 @@ namespace GenerateTypeForwarders {
var forwardFrom = args [0];
var forwardTo = args [1];
var output = args [2];
return Fix (forwardFrom, forwardTo, output);
var min_version = Version.Parse (args [3]);
return Fix (forwardFrom, forwardTo, output, min_version);
}
static bool IsVisible (this TypeDefinition type)
@ -535,9 +536,13 @@ namespace GenerateTypeForwarders {
if (!type.IsNested)
sb.Append ("namespace ").Append (type.Namespace).AppendLine (" {");
sb.Append ('\t', indent);
if (type.BaseType?.FullName == "System.MulticastDelegate") {
sb.Append ("public delegate ");
// [Uns|S]upportedOSPlatformAttribute is not supported on delegates
// we generate it in legacy so the behaviour remains consistant with older tooling
sb.AppendLine ("#if !NET");
sb.Append ('\t', indent).AppendLine ("[Unavailable (PlatformName.MacCatalyst)]");
sb.AppendLine ("#endif");
sb.Append ('\t', indent).Append ("public delegate ");
var invoke = type.Methods.First (v => v.Name == "Invoke");
EmitTypeName (sb, invoke.ReturnType);
sb.Append (' ');
@ -547,6 +552,12 @@ namespace GenerateTypeForwarders {
EmitParameters (sb, invoke);
sb.AppendLine (");");
} else {
sb.AppendLine ("#if NET");
sb.Append ('\t', indent).AppendLine ("[UnsupportedOSPlatform (\"maccatalyst\")]");
sb.AppendLine ("#else");
sb.Append ('\t', indent).AppendLine ("[Unavailable (PlatformName.MacCatalyst)]");
sb.AppendLine ("#endif");
sb.Append ('\t', indent);
// other are filtered not to generate stubs
if (type.IsNestedFamily)
sb.Append ("protected ");
@ -686,7 +697,7 @@ namespace GenerateTypeForwarders {
sb.Append ('>');
}
static int Fix (string forwardFrom, string forwardTo, string output)
static int Fix (string forwardFrom, string forwardTo, string output, Version minVersion)
{
var rp = new ReaderParameters (ReadingMode.Deferred);
var resolver = new DefaultAssemblyResolver ();
@ -697,6 +708,14 @@ namespace GenerateTypeForwarders {
var sb = new StringBuilder ();
sb.AppendLine ("using System.Runtime.CompilerServices;");
sb.AppendLine ("#if NET");
sb.AppendLine ("using System.Runtime.Versioning;");
sb.AppendLine ("[assembly: TargetPlatform (\"maccatalyst\")]");
sb.AppendLine ($"[assembly: SupportedOSPlatform (\"maccatalyst{minVersion.Major}.{minVersion.Minor}\")]");
sb.AppendLine ("#else");
sb.AppendLine ("using ObjCRuntime;");
sb.AppendLine ($"[assembly: Introduced (PlatformName.MacCatalyst, {minVersion.Major},{minVersion.Minor})]");
sb.AppendLine ("#endif");
foreach (var exportedType in from.MainModule.ExportedTypes) {
sb.Append ("[assembly: TypeForwardedToAttribute (typeof (");

Просмотреть файл

@ -728,6 +728,9 @@ public class NamespaceManager
ImplicitNamespaces.Add ("System.Diagnostics");
ImplicitNamespaces.Add ("System.Diagnostics.CodeAnalysis");
ImplicitNamespaces.Add ("System.ComponentModel");
#if NET
ImplicitNamespaces.Add ("System.Runtime.Versioning");
#endif
ImplicitNamespaces.Add ("System.Threading.Tasks");
ImplicitNamespaces.Add ("CoreFoundation");
ImplicitNamespaces.Add ("Foundation");
@ -3230,6 +3233,36 @@ public partial class Generator : IMemberGatherer {
return false;
}
// do not generate introduced/supported attributes for versions earlier than the minimum supported
// more important since dotnet and legacy have different minimums (so this can't be done in binding files)
bool FilterMinimumVersion (AvailabilityBaseAttribute aa)
{
if (aa.AvailabilityKind != AvailabilityKind.Introduced)
return true;
Version min;
switch (aa.Platform) {
case PlatformName.iOS:
min = Xamarin.SdkVersions.MiniOSVersion;
break;
case PlatformName.TvOS:
min = Xamarin.SdkVersions.MinTVOSVersion;
break;
case PlatformName.WatchOS:
min = Xamarin.SdkVersions.MinWatchOSVersion;
break;
case PlatformName.MacOSX:
min = Xamarin.SdkVersions.MinOSXVersion;
break;
case PlatformName.MacCatalyst:
min = Xamarin.SdkVersions.MinMacCatalystVersion;
break;
default:
throw new BindingException (1047, aa.Platform.ToString ());
}
return aa.Version > min;
}
public bool PrintPlatformAttributes (MemberInfo mi, Type type = null)
{
bool printed = false;
@ -3259,6 +3292,7 @@ public partial class Generator : IMemberGatherer {
// can't introduce or deprecate/obsolete a member on a type that is not available
if (IsUnavailable (type_ca, availability.Platform))
continue;
if (FilterMinimumVersion (availability))
print (availability.ToString ());
printed = true;
break;
@ -3320,6 +3354,8 @@ public partial class Generator : IMemberGatherer {
// the type, in which we are inlining the current method, might already have the same availability attribute
// which we would duplicate if generated
foreach (var availability in inlined_ca) {
if (!FilterMinimumVersion (availability))
continue;
var s = availability.ToString ();
if (!generated_type_ca.Contains (s))
print (s);

Просмотреть файл

@ -401,6 +401,9 @@
<Compile Include="..\tools\common\Driver.execution.cs">
<Link>Driver.execution.cs</Link>
</Compile>
<Compile Include="..\tools\common\SdkVersions.cs">
<Link>SdkVersions.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources.resx">

Просмотреть файл

@ -11,6 +11,7 @@ using System;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Runtime.Versioning;
using ObjCRuntime;
using Foundation;
@ -90,6 +91,54 @@ namespace Xamarin.Tests
public static class AvailabilityExtensions
{
#if NET
public static AvailabilityBaseAttribute Convert (this OSPlatformAttribute a)
{
if (a == null)
return null;
PlatformName p;
int n = 0;
switch (a.PlatformName) {
case string dummy when a.PlatformName.StartsWith ("ios"):
p = PlatformName.iOS;
n = "ios".Length;
break;
case string dummy when a.PlatformName.StartsWith ("tvos"):
p = PlatformName.TvOS;
n = "tvos".Length;
break;
case string dummy when a.PlatformName.StartsWith ("watchos"):
p = PlatformName.WatchOS;
n = "watchos".Length;
break;
case string dummy when a.PlatformName.StartsWith ("macos"):
p = PlatformName.MacOSX;
n = "macos".Length;
break;
case string dummy when a.PlatformName.StartsWith ("maccatalyst"):
p = PlatformName.MacCatalyst;
n = "maccatalyst".Length;
break;
default:
return null;
}
bool versioned = Version.TryParse (a.PlatformName [n..], out var v);
if (a is SupportedOSPlatformAttribute)
return new IntroducedAttribute (p, v.Major, v.Minor);
if (a is UnsupportedOSPlatformAttribute) {
// if a version is provided then it means it was deprecated
// if no version is provided then it means it's unavailable
if (versioned)
return new DeprecatedAttribute (p, v.Major, v.Minor);
else
return new UnavailableAttribute (p);
}
return null;
}
#endif
public static bool IsAvailableOnHostPlatform (this ICustomAttributeProvider attributeProvider)
{
return attributeProvider.IsAvailable (PlatformInfo.Host);
@ -97,10 +146,22 @@ namespace Xamarin.Tests
public static bool IsAvailable (this ICustomAttributeProvider attributeProvider, PlatformInfo targetPlatform)
{
#if NET
var list = new List<AvailabilityBaseAttribute> ();
foreach (var ca in attributeProvider.GetCustomAttributes (true)) {
if (ca is OSPlatformAttribute aa)
list.Add (aa.Convert ());
// FIXME - temporary, while older attributes co-exists (in manual bindings)
if (ca is AvailabilityBaseAttribute old)
list.Add (old);
}
return list.IsAvailable (targetPlatform);
#else
return attributeProvider
.GetCustomAttributes (true)
.OfType<AvailabilityBaseAttribute> ()
.IsAvailable (targetPlatform);
#endif
}
public static bool IsAvailableOnHostPlatform (this IEnumerable<AvailabilityBaseAttribute> attributes)

Просмотреть файл

@ -101,11 +101,14 @@ namespace GeneratorTests
BuildFile (Profile.iOS, "bug15307.cs");
}
#if !NET
// error BI1055: bgen: Internal error: failed to convert type 'System.Runtime.Versioning.SupportedOSPlatformAttribute, System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.
[Test]
public void Bug15799 ()
{
BuildFile (Profile.iOS, "bug15799.cs");
}
#endif
[Test]
public void Bug16036 ()
@ -119,11 +122,14 @@ namespace GeneratorTests
BuildFile (Profile.iOS, "bug17232.cs");
}
#if !NET
// error BI1055: bgen: Internal error: failed to convert type 'System.Runtime.Versioning.SupportedOSPlatformAttribute, System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.
[Test]
public void Bug23041 ()
{
BuildFile (Profile.iOS, "bug23041.cs");
}
#endif
[Test]
public void Bug24078 ()
@ -218,8 +224,12 @@ namespace GeneratorTests
.Union (allTypes.SelectMany ((type) => type.Methods))
.Union (allTypes.SelectMany ((type) => type.Fields))
.Union (allTypes.SelectMany ((type) => type.Properties));
var preserves = allMembers.Sum ((v) => v.CustomAttributes.Count ((ca) => ca.AttributeType.Name == "IntroducedAttribute"));
#if NET
const string attrib = "SupportedOSPlatformAttribute";
#else
const string attrib = "IntroducedAttribute";
#endif
var preserves = allMembers.Sum ((v) => v.CustomAttributes.Count ((ca) => ca.AttributeType.Name == attrib));
Assert.AreEqual (10, preserves, "Introduced attribute count"); // If you modified code that generates IntroducedAttributes please update the attribute count
}
@ -313,11 +323,14 @@ namespace GeneratorTests
Assert.AreEqual (10, methodCount, "Async method count");
}
#if !NET
// error BI1055: bgen: Internal error: failed to convert type 'System.Runtime.Versioning.SupportedOSPlatformAttribute, System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.
[Test]
public void StackOverflow20696157 ()
{
BuildFile (Profile.iOS, "sof20696157.cs");
}
#endif
[Test]
public void HyphenInName ()

Просмотреть файл

@ -5,8 +5,8 @@ using Foundation;
namespace Bug35176 {
[Introduced (PlatformName.iOS, 8,0)]
[Introduced (PlatformName.MacOSX, 10,10)]
[Introduced (PlatformName.iOS, 14,3)]
[Introduced (PlatformName.MacOSX, 11,2)]
[Protocol]
interface FooInterface {
@ -15,7 +15,7 @@ namespace Bug35176 {
UIView FooView { get; set; }
[Export ("BarView")]
UIView BarView { [Introduced (PlatformName.iOS, 9,0)] get; }
UIView BarView { [Introduced (PlatformName.iOS, 14,4)] get; }
[Export ("barMember:")]
UIView GetBarMember (int x);

Просмотреть файл

@ -22,8 +22,11 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Versioning;
using System.Text;
using NUnit.Framework;
using ObjCRuntime;
using Xamarin.Tests;
namespace Introspection {
@ -52,6 +55,7 @@ namespace Introspection {
#else
#error No Platform Defined
#endif
Filter = (AvailabilityBaseAttribute arg) => {
return (arg.AvailabilityKind != AvailabilityKind.Introduced) || (arg.Platform != Platform);
};
@ -198,18 +202,36 @@ namespace Introspection {
}
#endif
string ToString (ICustomAttributeProvider cap)
{
var s = cap.ToString ();
if (cap is MemberInfo mi) {
var i = s.IndexOf (' ');
if (i != -1) {
// a method/property without the declaring type is hard to track down
s = s.Insert (i + 1, mi.DeclaringType + "::");
}
}
return s;
}
protected AvailabilityBaseAttribute CheckAvailability (ICustomAttributeProvider cap)
{
var attrs = cap.GetCustomAttributes (false);
foreach (var a in attrs) {
foreach (var ca in attrs) {
var a = ca;
#if NET
a = (a as OSPlatformAttribute)?.Convert ();
#endif
if (a is AvailabilityBaseAttribute aa) {
if (Filter (aa))
continue;
if (aa.Version < Minimum) {
// FIXME should be `<=` but that another large change best done in a different PR
if ((aa.AvailabilityKind == AvailabilityKind.Introduced) && (aa.Version < Minimum)) {
switch (aa.Architecture) {
case PlatformArchitecture.All:
case PlatformArchitecture.None:
AddErrorLine ($"[FAIL] {aa.Version} < {Minimum} (Min) on '{cap}'.");
AddErrorLine ($"[FAIL] {aa.Version} <= {Minimum} (Min) on '{ToString (cap)}'.");
break;
default:
// An old API still needs the annotations when not available on all architectures
@ -218,7 +240,7 @@ namespace Introspection {
}
}
if (aa.Version > Maximum)
AddErrorLine ($"[FAIL] {aa.Version} > {Maximum} (Max) on '{cap}'.");
AddErrorLine ($"[FAIL] {aa.Version} > {Maximum} (Max) on '{ToString (cap)}'.");
return aa;
}
}
@ -227,7 +249,11 @@ namespace Introspection {
bool IsUnavailable (ICustomAttributeProvider cap)
{
foreach (var ca in cap.GetCustomAttributes (false)) {
foreach (var a in cap.GetCustomAttributes (false)) {
var ca = a;
#if NET
ca = (a as OSPlatformAttribute)?.Convert ();
#endif
if (ca is UnavailableAttribute ua) {
if (ua.Platform == Platform)
return true;
@ -238,7 +264,11 @@ namespace Introspection {
AvailabilityBaseAttribute GetAvailable (ICustomAttributeProvider cap)
{
foreach (var ca in cap.GetCustomAttributes (false)) {
foreach (var a in cap.GetCustomAttributes (false)) {
var ca = a;
#if NET
ca = (a as OSPlatformAttribute)?.Convert ();
#endif
if (ca is AvailabilityBaseAttribute aa) {
if ((aa.AvailabilityKind != AvailabilityKind.Unavailable) && (aa.Platform == Platform))
return aa;
@ -293,8 +323,13 @@ namespace Introspection {
member_level.Clear ();
foreach (var a in m.GetCustomAttributes (false)) {
var s = String.Empty;
#if NET
if (a is OSPlatformAttribute aa)
s = $"[{a.GetType().Name} (\"{aa.PlatformName}\")]";
#else
if (a is AvailabilityBaseAttribute aa)
s = aa.ToString ();
#endif
if (s.Length > 0) {
if (type_level.Contains (s))
AddErrorLine ($"[FAIL] Both '{t}' and '{m}' are marked with `{s}`.");
@ -318,8 +353,13 @@ namespace Introspection {
type_level.Clear ();
foreach (var a in t.GetCustomAttributes (false)) {
#if NET
if (a is OSPlatformAttribute aa)
type_level.Add ($"[{a.GetType().Name} (\"{aa.PlatformName}\")]");
#else
if (a is AvailabilityBaseAttribute aa)
type_level.Add (aa.ToString ());
#endif
}
foreach (var p in t.GetProperties (BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) {
@ -336,5 +376,54 @@ namespace Introspection {
}
AssertIfErrors ("{0} API with members duplicating type-level attributes", Errors);
}
#if NET
string CheckLegacyAttributes (ICustomAttributeProvider cap)
{
var sb = new StringBuilder ();
foreach (var a in cap.GetCustomAttributes (false)) {
if (a is AvailabilityBaseAttribute aa) {
sb.AppendLine (aa.ToString ());
}
}
return sb.ToString ();
}
[Test]
#if IOS || TVOS
[Ignore ("work in progress")]
#endif
public void LegacyAttributes ()
{
//LogProgress = true;
Errors = 0;
foreach (Type t in Assembly.GetTypes ()) {
if (LogProgress)
Console.WriteLine ($"T: {t}");
var type_level = CheckLegacyAttributes (t);
if (type_level.Length > 0)
AddErrorLine ($"[FAIL] '{t.FullName}' has legacy attribute(s): {type_level}");
foreach (var p in t.GetProperties (BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) {
if (LogProgress)
Console.WriteLine ($"P: {p}");
var member_level = CheckLegacyAttributes (p);
if (member_level.Length > 0)
AddErrorLine ($"[FAIL] '{t.FullName}::{p.Name}' has legacy attribute(s): {member_level}");
}
foreach (var m in t.GetMembers (BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) {
if (LogProgress)
Console.WriteLine ($"M: {m}");
var member_level = CheckLegacyAttributes (m);
if (member_level.Length > 0)
AddErrorLine ($"[FAIL] '{t.FullName}::{m.Name}' has legacy attribute(s): {member_level}");
}
}
AssertIfErrors ("{0} API with mixed legacy availability attributes", Errors);
}
#endif
}
}

Просмотреть файл

@ -857,6 +857,7 @@ namespace Introspection {
case "AdviceAttribute":
case "ObsoletedAttribute":
case "DeprecatedAttribute":
case "UnsupportedOSPlatformAttribute":
return true;
}
}

Просмотреть файл

@ -57,7 +57,7 @@ namespace Xharness.Jenkins {
Platform = TestPlatform.iOS,
TestName = "MSBuild tests",
Mode = "Integration",
Timeout = TimeSpan.FromMinutes (90),
Timeout = TimeSpan.FromMinutes (120),
Ignored = !jenkins.IncludeMSBuild,
SupportsParallelExecution = false,
};

Просмотреть файл

@ -71,13 +71,13 @@ namespace Xharness {
case MonoNativeFlavor.Compat:
switch (platform) {
case DevicePlatform.iOS:
return "8.0";
return Xamarin.SdkVersions.MiniOS;
case DevicePlatform.tvOS:
return "9.0";
return Xamarin.SdkVersions.MinTVOS;
case DevicePlatform.watchOS:
return "2.0";
return Xamarin.SdkVersions.MinWatchOS;
case DevicePlatform.macOS:
return "10.9";
return Xamarin.SdkVersions.MinOSX;
default:
throw new Exception ($"Unknown DevicePlatform: {platform}");
}

Просмотреть файл

@ -65,7 +65,7 @@ namespace Xharness.Targets {
protected override string GetMinimumOSVersion (string templateMinimumOSVersion)
{
if (MonoNativeInfo == null)
return "9.0";
return Xamarin.SdkVersions.MinTVOS;
return MonoNativeHelper.GetMinimumOSVersion (DevicePlatform.tvOS, MonoNativeInfo.Flavor);
}