From bfaf62623e0e71ea5b68f5983007e26c7251ad18 Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Sat, 10 Jun 2017 02:07:11 -0500 Subject: [PATCH] [Test][Intro] Fix introspection test on API changes for Xcode 9 Beta 1 (#2191) * [Test][Intro] Fix introspection test on API changes for Xcode 9 Beta 1 * [introspection] Fix feedback from PR and bot tests Removed XAMCORE_4_0 checks from our api definition, and added a file with stubs for all of them instead. Cleaner binding file and easier to remove in the future Fixed introspection also for mac by moving some check into base test definition * [CoreImage] Add CoreImage stubs so introspection test are happy These need to be manually reviewed by whoever takes CoreImage framework tracked in bugzilla so we do not forget * Do the same API cleanup as in NSUnit * [test][introspection] Enable MtouchNoSymbolStrip for device builds in order to avoid linking symbols meeded by test (#2196) Rolf Kvinge [8:59 AM] @dalexsoto the fix is to not strip the executable please PR that (it should probably go into master as well). This probably started happening when Jeff implemented support for stripping debug builds (previously the setting was ignored) * [foundation] Provide better messages * [CoreImage] Fix Availability of CIEdgePreserveUpsampleFilter --- src/Foundation/NSUnit.cs | 126 +++++++++++ src/UIKit/Compat.cs | 12 + src/avfoundation.cs | 3 +- src/cloudkit.cs | 2 +- src/coreanimation.cs | 12 +- src/coreimage.cs | 213 +++++++++++++++++- src/foundation.cs | 21 ++ src/frameworks.sources | 1 + src/homekit.cs | 2 +- src/metalperformanceshaders.cs | 4 +- src/uikit.cs | 4 +- tests/introspection/ApiCtorInitTest.cs | 22 ++ tests/introspection/ApiProtocolTest.cs | 3 + tests/introspection/ApiSelectorTest.cs | 20 ++ tests/introspection/iOS/iOSApiCtorInitTest.cs | 7 + tests/introspection/iOS/iOSApiProtocolTest.cs | 14 ++ tests/introspection/iOS/iOSApiSelectorTest.cs | 11 + .../iOS/introspection-ios.csproj | 6 + 18 files changed, 470 insertions(+), 13 deletions(-) create mode 100644 src/Foundation/NSUnit.cs diff --git a/src/Foundation/NSUnit.cs b/src/Foundation/NSUnit.cs new file mode 100644 index 000000000000..3a6708a82533 --- /dev/null +++ b/src/Foundation/NSUnit.cs @@ -0,0 +1,126 @@ +// +// NSUnit.cs +// +// Authors: +// Alex Soto (alexsoto@microsoft.com) +// +// Copyright 2017 Xamarin Inc. +// + +using System; +using XamCore.Foundation; +using XamCore.ObjCRuntime; + +namespace XamCore.Foundation { +#if !XAMCORE_4_0 + public partial class NSUnit { + [Obsolete ("Use .ctor(string)")] + public NSUnit () { } + } + + public partial class NSUnitAcceleration { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitAcceleration () { } + } + + public partial class NSUnitAngle { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitAngle () { } + } + + public partial class NSUnitArea { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitArea () { } + } + + public partial class NSUnitConcentrationMass { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitConcentrationMass () { } + } + + public partial class NSUnitDispersion { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitDispersion () { } + } + + public partial class NSUnitDuration { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitDuration () { } + } + + public partial class NSUnitElectricCharge { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitElectricCharge () { } + } + + public partial class NSUnitElectricCurrent { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitElectricCurrent () { } + } + + public partial class NSUnitElectricPotentialDifference { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitElectricPotentialDifference () { } + } + + public partial class NSUnitElectricResistance { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitElectricResistance () { } + } + + public partial class NSUnitEnergy { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitEnergy () { } + } + + public partial class NSUnitFrequency { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitFrequency () { } + } + + public partial class NSUnitFuelEfficiency { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitFuelEfficiency () { } + } + + public partial class NSUnitLength { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitLength () { } + } + + public partial class NSUnitIlluminance { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitIlluminance () { } + } + + public partial class NSUnitMass { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitMass () { } + } + + public partial class NSUnitPower { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitPower () { } + } + + public partial class NSUnitPressure { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitPressure () { } + } + + public partial class NSUnitSpeed { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitSpeed () { } + } + + public partial class NSUnitVolume { + [Obsolete ("Use .ctor(string, NSUnitConverter) or any of the static properties.")] + public NSUnitVolume () { } + } + + public partial class NSDimension { + [Obsolete ("Not intended to be directly instantiated, this is an abstract class.")] + public NSDimension () { } + } +#endif +} diff --git a/src/UIKit/Compat.cs b/src/UIKit/Compat.cs index 5d12fd35a81a..d052e55526fe 100644 --- a/src/UIKit/Compat.cs +++ b/src/UIKit/Compat.cs @@ -90,4 +90,16 @@ public virtual CGPoint GetLocationInCoordinateSpace (UICoordinateSpace coordinat #endif #endif + +#if !XAMCORE_4_0 && !WATCH + public partial class UICollectionViewFocusUpdateContext { + [Obsolete ("This cannot be directly created")] + public UICollectionViewFocusUpdateContext () { } + } + + public partial class UIFocusUpdateContext { + [Obsolete ("This cannot be directly created")] + public UIFocusUpdateContext () { } + } +#endif } diff --git a/src/avfoundation.cs b/src/avfoundation.cs index 04c9e7b5090d..ccde7e84973e 100644 --- a/src/avfoundation.cs +++ b/src/avfoundation.cs @@ -10370,9 +10370,10 @@ interface AVPlayerLooper [Export ("disableLooping")] void DisableLooping (); +#if !XAMCORE_4_0 // This API got introduced in Xcode 8.0 binding but is not currently present nor in Xcode 8.3 or Xcode 9.0 needs research [Export ("loopingEnabled")] bool LoopingEnabled { [Bind ("isLoopingEnabled")] get; } - +#endif [Export ("loopCount")] nint LoopCount { get; } diff --git a/src/cloudkit.cs b/src/cloudkit.cs index b89cf72d0958..0972ccab10c4 100644 --- a/src/cloudkit.cs +++ b/src/cloudkit.cs @@ -622,7 +622,7 @@ interface CKFetchRecordZoneChangesOperation [iOS (10,0), Watch (3,0), TV (10,0), Mac (10,12, onlyOn64 : true)] [BaseType (typeof(NSObject))] - interface CKFetchRecordZoneChangesOptions : NSSecureCoding + interface CKFetchRecordZoneChangesOptions : NSSecureCoding, NSCopying { [NullAllowed, Export ("previousServerChangeToken", ArgumentSemantic.Copy)] CKServerChangeToken PreviousServerChangeToken { get; set; } diff --git a/src/coreanimation.cs b/src/coreanimation.cs index ed234bc7ee9a..8ea9a6b49cb3 100644 --- a/src/coreanimation.cs +++ b/src/coreanimation.cs @@ -200,7 +200,7 @@ enum CAContentsFormat { [BaseType (typeof (NSObject))] [Dispose ("OnDispose ();")] - interface CALayer : CAMediaTiming, NSCoding { + interface CALayer : CAMediaTiming, NSSecureCoding { [Export ("layer")][Static] CALayer Create (); @@ -910,7 +910,7 @@ interface CAAction { } [BaseType (typeof (NSObject), Delegates=new string [] {"WeakDelegate"}, Events=new Type [] { typeof (CAAnimationDelegate)})] - interface CAAnimation : CAAction, CAMediaTiming, NSCoding, NSMutableCopying { + interface CAAnimation : CAAction, CAMediaTiming, NSSecureCoding, NSMutableCopying { [Export ("animation"), Static] CAAnimation CreateAnimation (); @@ -1307,7 +1307,7 @@ interface CAGradientLayer { [BaseType (typeof (NSObject))] [DisableDefaultCtor] - interface CAMediaTimingFunction : NSCoding { + interface CAMediaTimingFunction : NSSecureCoding { [Export ("functionWithName:")][Static] CAMediaTimingFunction FromName (NSString name); @@ -1338,7 +1338,7 @@ interface CAMediaTimingFunction : NSCoding { } [BaseType (typeof (NSObject))] - interface CAValueFunction : NSCoding { + interface CAValueFunction : NSSecureCoding { [Export ("functionWithName:"), Static] CAValueFunction FromName (string name); @@ -1412,7 +1412,7 @@ interface CAOpenGLLayer { [Since (5,0)] [BaseType (typeof (NSObject))] - interface CAEmitterCell : CAMediaTiming, NSCoding { + interface CAEmitterCell : CAMediaTiming, NSSecureCoding { [NullAllowed] // by default this property is null [Export ("name", ArgumentSemantic.Copy)] string Name { get; set; } @@ -1643,7 +1643,7 @@ interface CAEmitterLayer { [Since(7,0), Mavericks] [BaseType (typeof (NSObject))] - interface CAEmitterBehavior : NSCoding { + interface CAEmitterBehavior : NSSecureCoding { [Export ("initWithType:")] IntPtr Constructor (NSString type); diff --git a/src/coreimage.cs b/src/coreimage.cs index 8df5a23a47e9..c6359a2e64bf 100644 --- a/src/coreimage.cs +++ b/src/coreimage.cs @@ -2230,7 +2230,7 @@ interface CIRectangleFeature { [iOS (8,0)] [Mac (10,12)] [BaseType (typeof (CIFeature))] - partial interface CIQRCodeFeature { + partial interface CIQRCodeFeature : NSSecureCoding, NSCopying { [Export ("bounds", ArgumentSemantic.Assign)] CGRect Bounds { get; } @@ -4471,4 +4471,215 @@ interface CIThermal { [BaseType (typeof (CIFilter))] interface CIXRay { } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIAreaMinMaxRed { + // TODO: Needs review + //[CoreImageProperty ("inputExtent")] + //CIVector Extent { get; set; } + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIAttributedTextImageGenerator { + // TODO: Needs review + //[CoreImageProperty ("inputText")] + //NSAttributedString Text { get; set; } + + //[CoreImageProperty ("inputScaleFactor")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float ScaleFactor { get; set; } + } + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIBarcodeGenerator { + // TODO: Needs review + //[CoreImageProperty ("inputBarcodeDescriptor")] + //CIBarcodeDescriptor BarcodeDescriptor { get; set; } + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIBicubicScaleTransform { + // TODO: Needs review + //[CoreImageProperty ("inputB")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float B { get; set; } + //[CoreImageProperty ("inputScale")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float Scale { get; set; } + //[CoreImageProperty ("inputC")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float C { get; set; } + //[CoreImageProperty ("inputAspectRatio")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float AspectRatio { get; set; } + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIBokehBlur { + // TODO: Needs review + //[CoreImageProperty ("inputSoftness")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float Softness { get; set; } + //[CoreImageProperty ("inputRadius")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float Radius { get; set; } + //[CoreImageProperty ("inputRingSize")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float RingSize { get; set; } + //[CoreImageProperty ("inputRingAmount")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float RingAmount { get; set; } + } + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIColorCubesMixedWithMask { + // TODO: Needs review + //[CoreImageProperty ("inputCubeDimension")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float CubeDimension { get; set; } + //[CoreImageProperty ("inputMaskImage")] + //CIImage MaskImage { get; set; } + //[CoreImageProperty ("inputCube0Data")] + //NSData Cube0Data { get; set; } + //[CoreImageProperty ("inputCube1Data")] + //NSData Cube1Data { get; set; } + //[CoreImageProperty ("inputColorSpace")] + //NSObject ColorSpace { get; set; } + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIColorCurves { + // TODO: Needs review + //[CoreImageProperty ("inputColorSpace")] + //NSObject ColorSpace { get; set; } + //[CoreImageProperty ("inputCurvesDomain")] + //CIVector CurvesDomain { get; set; } + //[CoreImageProperty ("inputCurvesData")] + //NSData CurvesData { get; set; } + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIDepthBlurEffect { + // TODO: Needs review + //[CoreImageProperty ("inputAperture")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float Aperture { get; set; } + //[CoreImageProperty ("inputCalibrationData")] + //AVCameraCalibrationData CalibrationData { get; set; } + //[CoreImageProperty ("inputTuningParameters")] + //NSDictionary TuningParameters { get; set; } + //[CoreImageProperty ("inputNosePositions")] + //CIVector NosePositions { get; set; } + //[CoreImageProperty ("inputLumaNoiseScale")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float LumaNoiseScale { get; set; } + //[CoreImageProperty ("inputChinPositions")] + //CIVector ChinPositions { get; set; } + //[CoreImageProperty ("inputDisparityImage")] + //CIImage DisparityImage { get; set; } + //[CoreImageProperty ("inputScaleFactor")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float ScaleFactor { get; set; } + //[CoreImageProperty ("inputRightEyePositions")] + //CIVector RightEyePositions { get; set; } + //[CoreImageProperty ("inputLeftEyePositions")] + //CIVector LeftEyePositions { get; set; } + //[CoreImageProperty ("inputFocusRect")] + //CIVector FocusRect { get; set; } + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIDepthToDisparity { + // TODO: Needs review + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIDisparityToDepth { + // TODO: Needs review + } + + [CoreImageFilter] + [iOS (11,0)] + [NoMac] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CIEdgePreserveUpsampleFilter { + // TODO: Needs review + //[CoreImageProperty ("inputLumaSigma")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float LumaSigma { get; set; } + //[CoreImageProperty ("inputSmallImage")] + //CIImage SmallImage { get; set; } + //[CoreImageProperty ("inputSpatialSigma")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float SpatialSigma { get; set; } + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CILabDeltaE { + // TODO: Needs review + //[CoreImageProperty ("inputImage2")] + //CIImage Image2 { get; set; } + } + + [CoreImageFilter] + [iOS (11,0)] + [Mac (10,13)] + [TV (11,0)] + [BaseType (typeof (CIFilter))] + interface CITextImageGenerator { + // TODO: Needs review + //[CoreImageProperty ("inputText")] + //NSString Text { get; set; } + //[CoreImageProperty ("inputFontName")] + //NSString FontName { get; set; } + //[CoreImageProperty ("inputScaleFactor")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float ScaleFactor { get; set; } + //[CoreImageProperty ("inputFontSize")] + //// TODO: this was an NSNumber transformed to float, but maybe an int or bool is more appropriate + //float FontSize { get; set; } + } } diff --git a/src/foundation.cs b/src/foundation.cs index 7930656f1aea..d9776e2f896a 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -12140,6 +12140,7 @@ interface NSDateInterval : NSCopying, NSSecureCoding { bool ContainsDate (NSDate date); } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSObject))] interface NSUnit : NSCopying, NSSecureCoding { @@ -13223,6 +13224,7 @@ interface NSUrlSessionTaskMetrics { nuint RedirectCount { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitAcceleration : NSSecureCoding { @@ -13245,6 +13247,7 @@ interface NSUnitAcceleration : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitAngle : NSSecureCoding { @@ -13283,6 +13286,7 @@ interface NSUnitAngle : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitArea : NSSecureCoding { @@ -13353,6 +13357,7 @@ interface NSUnitArea : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitConcentrationMass : NSSecureCoding { @@ -13379,6 +13384,7 @@ interface NSUnitConcentrationMass : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitDispersion : NSSecureCoding { @@ -13397,6 +13403,7 @@ interface NSUnitDispersion : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitDuration : NSSecureCoding { @@ -13423,6 +13430,7 @@ interface NSUnitDuration : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitElectricCharge : NSSecureCoding { @@ -13461,6 +13469,7 @@ interface NSUnitElectricCharge : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitElectricCurrent : NSSecureCoding { @@ -13495,6 +13504,7 @@ interface NSUnitElectricCurrent : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitElectricPotentialDifference : NSSecureCoding { @@ -13529,6 +13539,7 @@ interface NSUnitElectricPotentialDifference : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitElectricResistance : NSSecureCoding { @@ -13563,6 +13574,7 @@ interface NSUnitElectricResistance : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitEnergy : NSSecureCoding { @@ -13597,6 +13609,7 @@ interface NSUnitEnergy : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitFrequency : NSSecureCoding { @@ -13643,6 +13656,7 @@ interface NSUnitFrequency : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitFuelEfficiency : NSSecureCoding { @@ -13669,6 +13683,7 @@ interface NSUnitFuelEfficiency : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitLength : NSSecureCoding { @@ -13771,6 +13786,7 @@ interface NSUnitLength : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitIlluminance : NSSecureCoding { @@ -13789,6 +13805,7 @@ interface NSUnitIlluminance : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitMass : NSSecureCoding { @@ -13867,6 +13884,7 @@ interface NSUnitMass : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitPower : NSSecureCoding { @@ -13925,6 +13943,7 @@ interface NSUnitPower : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitPressure : NSSecureCoding { @@ -13979,6 +13998,7 @@ interface NSUnitPressure : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitSpeed : NSSecureCoding { @@ -14009,6 +14029,7 @@ interface NSUnitSpeed : NSSecureCoding { NSDimension BaseUnit { get; } } + [DisableDefaultCtor] // -init should never be called on NSUnit! [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [BaseType (typeof (NSDimension))] interface NSUnitVolume : NSSecureCoding { diff --git a/src/frameworks.sources b/src/frameworks.sources index 57e24c10f996..c2955be6da18 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -710,6 +710,7 @@ FOUNDATION_SOURCES = \ Foundation/NSTimeZone.cs \ Foundation/NSUbiquitousKeyValueStore.cs \ Foundation/NSUndoManager.cs \ + Foundation/NSUnit.cs \ Foundation/NSUrl.cs \ Foundation/NSUrlComponents.cs \ Foundation/NSUrlConnection.cs \ diff --git a/src/homekit.cs b/src/homekit.cs index 2e4c8c508fa8..57980e95a087 100644 --- a/src/homekit.cs +++ b/src/homekit.cs @@ -1227,7 +1227,7 @@ interface HMHomeAccessControl { [TV (10,0)] [BaseType (typeof (HMEvent))] [DisableDefaultCtor] - interface HMLocationEvent { + interface HMLocationEvent : NSMutableCopying { [NoTV] [NoWatch] [Export ("initWithRegion:")] diff --git a/src/metalperformanceshaders.cs b/src/metalperformanceshaders.cs index eda684e25943..e6e28faf2f73 100644 --- a/src/metalperformanceshaders.cs +++ b/src/metalperformanceshaders.cs @@ -510,7 +510,7 @@ interface MPSImageThresholdToZeroInverse { [iOS (9,0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] - interface MPSKernel : NSCopying { + interface MPSKernel : NSCopying, NSSecureCoding { [Export ("options", ArgumentSemantic.Assign)] MPSKernelOptions Options { get; set; } @@ -657,7 +657,7 @@ interface MPSCnnNeuronAbsolute { [iOS (10,0)][TV (10,0)] [BaseType (typeof (NSObject), Name = "MPSCNNConvolutionDescriptor")] [DisableDefaultCtor] - interface MPSCnnConvolutionDescriptor : NSCopying { + interface MPSCnnConvolutionDescriptor : NSCopying, NSSecureCoding { [Export ("kernelWidth")] nuint KernelWidth { get; set; } diff --git a/src/uikit.cs b/src/uikit.cs index 565b167d3791..f9ec8f02c8dc 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -7179,7 +7179,7 @@ interface UIBarPositioningDelegate { [Since (3,2)] [BaseType (typeof (NSObject))] [ThreadSafe] - interface UIBezierPath : NSCoding, NSCopying { + interface UIBezierPath : NSSecureCoding, NSCopying { // initWithFrame: --> unrecognized selector [Export ("bezierPath"), Static] @@ -15839,6 +15839,7 @@ interface UIGuidedAccessRestrictionDelegate { string GetDetailTextForGuidedAccessRestriction (string restrictionIdentifier); } + [DisableDefaultCtor] // [Assert] -init is not a useful initializer for this class. Use one of the designated initializers instead [NoWatch] [iOS (9,0)] // added in Xcode 7.1 / iOS 9.1 SDK [BaseType (typeof (UIFocusUpdateContext))] @@ -15908,6 +15909,7 @@ interface UIFocusItem : UIFocusEnvironment bool CanBecomeFocused { get; } } + [DisableDefaultCtor] // [Assert] -init is not a useful initializer for this class. Use one of the designated initializers instead [NoWatch] [iOS (9,0)] [BaseType (typeof(NSObject))] diff --git a/tests/introspection/ApiCtorInitTest.cs b/tests/introspection/ApiCtorInitTest.cs index d0111c6823e9..f317f14f15f7 100644 --- a/tests/introspection/ApiCtorInitTest.cs +++ b/tests/introspection/ApiCtorInitTest.cs @@ -77,6 +77,28 @@ protected virtual bool Skip (Type type) return true; case "NEPacketTunnelProvider": return true; + case "NSUnitDispersion": // -init should never be called on NSUnit! + case "NSUnitVolume": // -init should never be called on NSUnit! + case "NSUnitDuration": // -init should never be called on NSUnit! + case "NSUnitElectricCharge": // -init should never be called on NSUnit! + case "NSUnitElectricCurrent": // -init should never be called on NSUnit! + case "NSUnitElectricPotentialDifference": // -init should never be called on NSUnit! + case "NSUnitElectricResistance": // -init should never be called on NSUnit! + case "NSUnit": // -init should never be called on NSUnit! + case "NSUnitEnergy": // -init should never be called on NSUnit! + case "NSUnitAcceleration": // -init should never be called on NSUnit! + case "NSUnitFrequency": // -init should never be called on NSUnit! + case "NSUnitAngle": // -init should never be called on NSUnit! + case "NSUnitFuelEfficiency": // -init should never be called on NSUnit! + case "NSUnitArea": // -init should never be called on NSUnit! + case "NSUnitIlluminance": // -init should never be called on NSUnit! + case "NSUnitConcentrationMass": // -init should never be called on NSUnit! + case "NSUnitLength": // -init should never be called on NSUnit! + case "NSUnitMass": // -init should never be called on NSUnit! + case "NSUnitPower": // -init should never be called on NSUnit! + case "NSUnitPressure": // -init should never be called on NSUnit! + case "NSUnitSpeed": // -init should never be called on NSUnit! + return true; } return SkipDueToAttribute (type); diff --git a/tests/introspection/ApiProtocolTest.cs b/tests/introspection/ApiProtocolTest.cs index 9c9c55dfdcb8..5f8ae17a00cb 100644 --- a/tests/introspection/ApiProtocolTest.cs +++ b/tests/introspection/ApiProtocolTest.cs @@ -140,6 +140,9 @@ protected virtual bool Skip (Type type, string protocolName) // iOS 10 : test throw because of generic usage case "NSMeasurement`1": return true; // skip + // xcode 9 + case "NSConstraintConflict": // Conformance not in headers + return true; } break; // conformance added in Xcode 8 (iOS 10 / macOS 10.12) diff --git a/tests/introspection/ApiSelectorTest.cs b/tests/introspection/ApiSelectorTest.cs index 8711feda9ef5..f81da6e86695 100644 --- a/tests/introspection/ApiSelectorTest.cs +++ b/tests/introspection/ApiSelectorTest.cs @@ -149,6 +149,20 @@ protected virtual bool Skip (Type type, string selectorName) return true; } break; + // Xcode 9 + case "CIQRCodeFeature": + switch (selectorName) { + case "copyWithZone:": + case "encodeWithCoder:": + return !TestRuntime.CheckXcodeVersion (9, 0); + } + break; + case "CKFetchRecordZoneChangesOptions": + switch (selectorName) { + case "copyWithZone:": + return !TestRuntime.CheckXcodeVersion (9, 0); + } + break; } #endif // This ctors needs to be manually bound @@ -329,6 +343,12 @@ protected virtual bool Skip (Type type, string selectorName) return true; } break; + case "AVPlayerLooper": // This API got introduced in Xcode 8.0 binding but is not currently present nor in Xcode 8.3 or Xcode 9.0 needs research + switch (selectorName) { + case "isLoopingEnabled": + return true; + } + break; } // old binding mistake diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index 24baa1cb4034..10ee552c0067 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -196,6 +196,13 @@ protected override bool Skip (Type type) case "INStartWorkoutIntent": return true; #endif + // iOS 11 Beta 1 + case "UICollectionViewFocusUpdateContext": // [Assert] -init is not a useful initializer for this class. Use one of the designated initializers instead + case "UIFocusUpdateContext": // [Assert] -init is not a useful initializer for this class. Use one of the designated initializers instead + case "EKCalendarItem": // Fails with NSInvalidArgumentException +[EKCalendarItem frozenClass]: unrecognized selector sent to class, will fill a radar + case "EKParticipant": // ctor disabled in XAMCORE_3_0 + case "UITableViewFocusUpdateContext": // Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Invalid parameter not satisfying: focusSystem, will fill a radar + return true; default: return base.Skip (type); } diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOS/iOSApiProtocolTest.cs index 614c40e0a773..d10b84397bf6 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOS/iOSApiProtocolTest.cs @@ -183,6 +183,12 @@ protected override bool Skip (Type type, string protocolName) case "MPMusicPlayerControllerMutableQueue": case "MPMusicPlayerControllerQueue": return true; + // iOS 11.0 + case "UICollectionViewUpdateItem": // Conformance not in headers + case "MKMapItem": // Conformance not in headers + case "NSConstraintConflict": // Conformance not in headers + case "NSQueryGenerationToken": // Conformance not in headers + return true; #if __WATCHOS__ case "CLKComplicationTemplate": case "CLKComplicationTemplateCircularSmallRingImage": @@ -285,6 +291,10 @@ protected override bool Skip (Type type, string protocolName) case "MPMusicPlayerControllerMutableQueue": case "MPMusicPlayerControllerQueue": return true; + // iOS 11.0 + case "MKMapItem": // Conformance not in headers + case "NSQueryGenerationToken": // Conformance not in headers + return true; #if __WATCHOS__ case "CLKComplicationTemplate": case "CLKComplicationTemplateCircularSmallRingImage": @@ -363,6 +373,10 @@ protected override bool Skip (Type type, string protocolName) // iOS 10.2 case "VSAccountProviderResponse": return true; + // iOS 11.0 + case "UICollectionViewUpdateItem": // Conformance not in headers + return true; + #if __WATCHOS__ case "CLKComplicationTimelineEntry": return true; diff --git a/tests/introspection/iOS/iOSApiSelectorTest.cs b/tests/introspection/iOS/iOSApiSelectorTest.cs index 28113dadbdb5..443bd8ed3a4e 100644 --- a/tests/introspection/iOS/iOSApiSelectorTest.cs +++ b/tests/introspection/iOS/iOSApiSelectorTest.cs @@ -578,6 +578,8 @@ protected override bool CheckResponse (bool value, Type actualType, MethodBase m return !TestRuntime.CheckXcodeVersion (7, 0); case "HKWorkoutEvent": return !TestRuntime.CheckXcodeVersion (8, 0); + case "HMLocationEvent": + return !TestRuntime.CheckXcodeVersion (9, 0); } break; @@ -633,6 +635,9 @@ protected override bool CheckResponse (bool value, Type actualType, MethodBase m case "HKBiologicalSexObject": case "HKBloodTypeObject": return !TestRuntime.CheckXcodeVersion (7, 0); + case "MPSKernel": + case "MPSCnnConvolutionDescriptor": + return !TestRuntime.CheckXcodeVersion (9, 0); #if __TVOS__ case "SKAttribute": case "SKAttributeValue": @@ -649,6 +654,12 @@ protected override bool CheckResponse (bool value, Type actualType, MethodBase m return true; break; #endif + case "mutableCopyWithZone:": + switch (declaredType.Name) { + case "HMLocationEvent": + return !TestRuntime.CheckXcodeVersion (9, 0); + } + break; } return base.CheckResponse (value, actualType, method, ref name); diff --git a/tests/introspection/iOS/introspection-ios.csproj b/tests/introspection/iOS/introspection-ios.csproj index 4f2c3006d828..0a653686fe49 100644 --- a/tests/introspection/iOS/introspection-ios.csproj +++ b/tests/introspection/iOS/introspection-ios.csproj @@ -52,6 +52,7 @@ None ARMv7, ARM64 + true True @@ -66,6 +67,7 @@ None ARMv7 + true True @@ -80,6 +82,7 @@ None ARM64 + true none @@ -93,6 +96,7 @@ None ARMv7, ARM64 MONOTOUCH;$(DefineConstants) + true none @@ -106,6 +110,7 @@ None ARMv7 MONOTOUCH;$(DefineConstants) + true none @@ -119,6 +124,7 @@ None ARM64 MONOTOUCH;$(DefineConstants) + true none