Граф коммитов

258 Коммитов

Автор SHA1 Сообщение Дата
Vincent Dondain 2a84c116db Merge branch 'xcode9.3' 2018-04-03 14:14:07 -04:00
Sebastien Pouliot f62de4722b
Bump Xcode 9.3 to the final/released version (#3833)
* [tests] Tweak tests as NKIssue/NKAssetDownload now respond to NS[Secure]Coding without any mention in header files
2018-03-29 17:58:55 -04:00
Sebastien Pouliot a74184175b
[tests] macOS NSSpellChecker randomly [dis]approve of 'Ident' (#3728)
Fix https://github.com/xamarin/maccore/issues/661
2018-03-13 08:10:16 -05:00
Alex Soto 8ba51035d1
[MetalPerformanceShaders] Make macOS intro happy (#3692)
Xcode 9.3 removed both selectors from MPSCnnBinaryKernel, reported radar https://trello.com/c/7EAM0qk1
but apple says this was intentional.

Since this API is not final we need to review it as part of
https://github.com/xamarin/xamarin-macios/issues/3553
2018-03-07 17:49:11 -06:00
Alex Soto 17a81e9d4e
[ARkit] Update to Xcode 9.3 Beta 4 (#3680) 2018-03-07 08:41:25 -06:00
Sebastien Pouliot 189075bb3e
[tests] Skip High Sierra image filters in Classic tests. Fixes #622. (#3308) (#3671)
Skip High Sierra image filters in Classic introspection tests, since the
Classic bindings won't be updated.

https://github.com/xamarin/maccore/issues/622
2018-03-06 15:16:19 -05:00
Sebastien Pouliot 29676a3662 Merge 15.6 into xcode9.3 2018-03-05 17:16:28 -05:00
Rolf Bjarne Kvinge aa9243f528
[introspection] Put type-based exception in the type-based switch. (#3636) 2018-03-02 09:38:53 +01:00
Chris Hamons 31f20cfe6d [macos] WKPreferences does not declare NSCopying (#3611) 2018-02-28 08:14:48 -05:00
Rolf Bjarne Kvinge a2676ba064
[introspection] Don't process IKPictureTaker, it may crash at any time. (#3599)
See also https://bugzilla.xamarin.com/show_bug.cgi?id=46624, where the same
logic was applied to apitest.

Ref: https://trello.com/c/T6vkA2QF/62-29311598-ikpicturetaker-crashes-randomly-upon-deallocation?menu=filter&filter=corenfc
2018-02-26 17:31:41 +01:00
Vincent Dondain 51b3c0aaec
[healthkit] Fix typos in 'HKInsulinDeliveryReason' and 'HKBloodGlucoseMealTime' (#3503)
- Fixes https://github.com/xamarin/xamarin-macios/issues/3499
(HKBloodGlucoseMealTime misspellings in bindings)
- 'HKInsulinDeliveryReason' [doc](https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason?language=objc)
- 'HKBloodGlucoseMealTime' [doc](https://developer.apple.com/documentation/healthkit/hkbloodglucosemealtime?language=objc)
- Commented ApiTypoTest.
2018-02-20 11:57:59 -05:00
Alex Soto 78650fb550
[CoreAudioKit] Fix macOS xtro output (#3508)
* [CoreAudioKit] Fix macOS xtro output

* Fix Midi typo

* Add trailing comma to enum value
2018-02-16 05:49:05 -06:00
Alex Soto 2608528866
[QuickLookUI] Fixes macOS xtro output (#3475) 2018-02-15 09:08:39 -06:00
Vincent Dondain 9408eb081d
[security] Add new 'SecKey.GenerateKeyPair' overloads (#3438)
The new overloads allow to set `kSecPrivateKeyAttrs` and `kSecPublicKeyAttrs`.

Fixes bug #34135: Need some constants exposed in Xamarin.iOS binding
(https://bugzilla.xamarin.com/show_bug.cgi?id=34135)

The new APIs were created according to https://developer.apple.com/documentation/security/1395339-seckeygeneratepair?language=objc

Also add `GenerateKeyPairTest`.
2018-02-14 23:34:52 -05:00
Alex Soto 060eabc51f
[Appkit] Fix xtro DesignatedInitializer output (#3474)
* [Appkit] Fix xtro Initializer output

* More API fixes after Designated was introduced into existing APIs
2018-02-14 08:09:43 -06:00
Sebastien Pouliot 7c45477e40
[foundation][uikit] Add missing [DesignatedInitializer] on default constructor (#3454)
Like reported by xtro (data files updated)
using the new, simpler `[DesignatedDefaultCtor]` attribute
2018-02-12 22:52:33 -05:00
Chris Hamons 46382d86b8
[ImageIO] Update to Xcode 9.3 Beta 1 (#3339) 2018-02-06 11:51:06 -06:00
Vincent Dondain 4c25aa94bd
[arkit] Update for Xcode 9.3 beta 1 (#3343)
- Obsolete `ARFaceAnchor`'s default constructor because it's marked as unavailable.
- Obsolete `CreateFaceGeometry` in `ARSCNFaceGeometry` in favor of `Create` (same as `ARSCNPlaneGeometry`).
2018-01-30 17:09:16 -05:00
Alex Soto a6204f2aa5
[Security] Update to Xcode 9.3 Beta 1 (#3344)
* [Security] Update to Xcode 9.3 Beta 1

Api diff:
- https://github.com/xamarin/xamarin-macios/wiki/Security-iOS-xcode9.3-beta1
- https://github.com/xamarin/xamarin-macios/wiki/Security-tvOS-xcode9.3-beta1
- https://github.com/xamarin/xamarin-macios/wiki/Security-watchOS-xcode9.3-beta1
- https://github.com/xamarin/xamarin-macios/wiki/Security-macOS-xcode9.3-beta1

* Update the xtro files

* Add SecCopyErrorMessageString binding
2018-01-27 16:26:43 -06:00
Alex Soto d07afb5fbc
[PassKit] Update bindings to Xcode 9.3 Beta 1 (#3340)
* [PassKit] Update bindings to Xcode 9.3 Beta 1

Diff files:
- https://github.com/xamarin/xamarin-macios/wiki/PassKit-iOS-xcode9.3-beta1
- https://github.com/xamarin/xamarin-macios/wiki/PassKit-watchOS-xcode9.3-beta1

* Adds DisableDefaultCtor to PKTransitPassProperties and PKSuicaPassProperties

Both `PKTransitPassProperties` and `PKSuicaPassProperties` have getter only props and a factory method.

* Fix intro tests
2018-01-27 10:46:16 -06:00
Rolf Bjarne Kvinge b2bcad7a94
Add a BindingImpl attribute and use to to teach the linker look for it to search for optimizable code. (#3299)
* [ObjCRuntime] Add a BindingImplAttribute.

* [linker] Make ProviderToString an extension method on ICustomAttributeProvider to make it more discoverable.

* [generator] Use [BindingImpl] instead of [CompilerGenerated].

The entire diff is big (89MB), so it can't be gisted. However, most of it is
either removal of `using System.Runtime.CompilerServices;` or the change from
`[CompilerGenerated]` to `[BindingImpl (...)]` like this:
https://gist.github.com/rolfbjarne/8bfda3ed37b956d0342a1c1e9b079244

If I remove those parts of the diff, there's nothing significant left:
https://gist.github.com/rolfbjarne/4156164d6bdb1376366200394eb8a091

* [linker] Teach the linker about the new [BindingImpl] attribute.

In addition to the existing logic where the linker would optimize some
[CompilerGenerated] code (sometimes with additional requirements), it will now
also optimize all [BindingImpl (Optimizable)] code (without any additional
requirements).

* [tests] Add tests to make sure [BindingImpl (Optimizable)] works as expected.

* [linker] Check for [BindingImpl] before [CompilerGenerated] and stop checking for [CompilerGenerated] in XAMCORE_4_0.

Check for [BindingImpl] before checking for [CompilerGenerated], since the
former is more common.

Also stop checking for [CompilerGenerated] (at least to mean that code is
optimizable) in our next non-compatible evolutionary leap (XAMCORE_4_0):

* [introspection] Impl a better typo check.
2018-01-26 18:38:23 +01:00
Rolf Bjarne Kvinge 7d0c4d5b09
[tests] Skip High Sierra image filters in Classic tests. Fixes #622. (#3308)
Skip High Sierra image filters in Classic introspection tests, since the
Classic bindings won't be updated.

https://github.com/xamarin/maccore/issues/622
2018-01-26 07:46:54 +01:00
Vincent Dondain 04f4a4bbea Bump Xcode and versions for 9.3 beta 1 (#3296)
- Bump maccore for mlaunch fix.
- Add new Xcode 9.3 protocol conformances.
2018-01-25 00:20:11 -05:00
Sebastien Pouliot ca06526793
[tests][monotouch] Remove the ignore on MPVolumeView added in xcode9 beta 3 - it seems to work fine now (#3284) 2018-01-23 08:27:18 -05:00
Vincent Dondain 4da8016db4
[xtro] Report missing-protocol-conformance when protocols are defined… (#3187)
- Fixes bug #59272: [xtro] Report !missing-protocol-conformance! when protocols are defined in categories
(https://bugzilla.xamarin.com/show_bug.cgi?id=59272)
- Implemented missing protocol conformances based on tool's new data.
- Remove Internal check from VisitObjCCategoryDecl and VisitObjCInterfaceDecl
- Ignore previewItemTitle failure (normal since it's optional)
- Only skip UIStateRestoring for subclasses of UIViewController
- Ignore UIStateRestoring test on watchOS (UIViewController not available)
- Remove protocol conformances that generated wrong availability attributes (https://github.com/xamarin/xamarin-macios/issues/3213)
- Avoid new virtual or virtual when adding protocol conformance (https://github.com/xamarin/xamarin-macios/issues/3217)
2018-01-18 13:41:09 -05:00
Sebastien Pouliot 07c81479e2
[tests][intro] Clean up old and some non-required availability attributes (#3141)
We normally frown on large scale _cosmetic_ changes, mostly because it breaks git's history (very useful) and makes merging branches harder and more error prone (very annoying).

However we require, right now, such changes to remove our old, mcs-based, pre-processor (pmcs) so it's a _good_ time to address the old, unneeded availability attributes - since most of them are re-written for our next milestone.

This won't change the final application size in most cases, as the linker removes them, but it will make the (unlinked) platform assemblies smaller. This means they will load faster (e.g. by mtouch, mmp, IDE, workbooks...) and will reduce the time/memory needed to reflect them.
2018-01-02 11:28:55 -05:00
Sebastien Pouliot a69e161d59
[src] Properly annotate designated initializers in many frameworks (#3142)
Correspond to xtro `!missing-designated-initializer!` errors
2017-12-28 16:37:13 -05:00
Chris Hamons 734850d416
Remove PMCS processing of availability attributes (#3096)
- XamarinPreprocessorVisitor handled processing/generating availability
  attributes but needs to be removed as it depends on PMCS
- Because processing was handled at a preprocessor/token level before and
  now inside generator.cs a number of changes were needed avoid checking
  in a million line diff (literally)
- This commit creates a "shadow" set of availability attributes, with
  the desired names [Mac] [Watch] [NoTV], etc when not in existence before
- Instead of adding hundreds of using statements to force resolution of these
  shadow types, I abuse C# type resolution by storing them in the root
  (not namespaced) so they are resolved first.
- generator-attributes-manager was taught how to process the multitude of
  old-style attributes and how to generate the new-style attributes
- Generator's bug57070 is no longer valid, since we _can_ and do convert [iOS]
2017-12-22 13:03:21 -06:00
Vincent Dondain d7b7a6ea02 Merge branch 'xcode9.2' 2017-12-06 14:41:13 -05:00
Rolf Bjarne Kvinge dd95d17b5f
[generator] Properly set the IsDirectBinding value. (#3063)
* [generator] Properly set the IsDirectBinding value.

Properly set the IsDirectBinding value to false for models and synthetic types.

This also means we can now stop excluding models when testing if the
IsDirectBinding value is correct.

Also set IsDirectBinding value to true for sealed wrapper types, since those
will always be direct bindings since they can't be subclassed.

https://gist.github.com/rolfbjarne/24028bf944db848fed4083c460d0ec71

* [tests] Add introspection exclusion for XM.

* [introspection] Add back exclusions for Classic, since we can't modify/fix Classic assemblies anymore.

* [generator] Print the correct protocol name with the protocol attribute.

Fixes this test failure:

    [FAIL] Foundation.NSUrlDownloadDelegate : ConformsToProtocol(null) failed

because our binding code claimed that our `NSUrlDownloadDelegate` class
implemented the `NSUrlDownloadDelegate` protocol, but since the
`NSUrlDownloadDelegate` protocol doesn't exist (it's `NSURLDownloadDelegate` -
different case), we'd verify against a null protocol (and return true from
`ConformsToProtocol(null)`, which would fail the test).

* [xtro] Only treat interfaces as protocols.

Unfortunately we add [Protocol] to [Model]s as well as on interfaces, but we
must not process those in xtro, since they don't correspond with the actual protocol.
2017-12-01 15:18:20 +01:00
Chris Hamons b87b3ba878
Fix test failures on 10.13 (#3065) (#3072) 2017-12-01 06:40:56 -06:00
Chris Hamons 31742eb3fb
Fix test failures on 10.13 (#3065) 2017-11-30 12:55:58 -06:00
Alex Soto 74d2dcadfb
[tests] Fix introspection tests for macOS (#3054)
* [tests] Fix introspection tests for macOS

It seems that apple forgot to ship SSLSetALPNProtocols and SSLCopyALPNProtocols in macOS
there are already radars filled about this https://bugs.swift.org/browse/SR-6131
So this test will fail once Apple fixes this issue. when this happens we need to do two things, reenable
the API and reenable the [Get|Set]AlpnProtocols tests, the one insides 'StreamDefaults' for the mac.

* Implement feedback
2017-11-28 17:27:20 -06:00
Timothy Risi 87f9e23989 [MetalPerformanceShaders] Xcode 9 bindings (#3005)
* [MetalPerformanceShaders] Activate bindings for Xamarin.Mac and add n… (#2816)

* [MetalPerformaceShaders] Several MPSCnnKernel properties should be readonly (#2938)

The subclasses versions of the properties need Override, cannot be removed since it would break visibility for iOS 10

* Remove some [Model] attributes that sholdn't be needed

* Fix introspection test crashes

* More introspection fixes

* NN does not need to be PascalCased

Remove unneeded Models and BaseTypes

* PR Whitespace fixes and renamings

* Paste fail

* More fixes from PR comments

* [MPS] Adds new intro test, fixes ctors and xtro output

* Removes duplicated availability attributes.
* Removes obsoleted API from macOS since mps is new to it.
* Fixes xtro output.
* Adds missing API.
* Fixes parameterless ctors, some of them do not really work, found
  by our new intro test and disabled the one that seem to not make
  sense due to the presence of DesignatedInitializers.
* Fixes a selector typo.
* Adds new `ShouldNotExposeDefaultCtorTest` to intro.

ShouldNotExposeDefaultCtorTest
==============================

This test checks for types with a parameterless ctor that are subclasses
of `NSObject` and then cheks if the BaseType of said objects also expose
a parameterless ctor (all in .NET land), if this is not the case it reports
them and so they can manually audited. Also this test has the ability to
print alloc/init ObjC code by setting `genObjCTestCode` to `true` so you can
take this code into an Xcode project and easily tests the ctors.

It seems that xtro (sharpie) does not have a complete picture of when a ctor
must be exposed hence the hability to generate this code and manually test.

Right now this test is just enabled for MPS since it is the scope of this PR.
In the future it should be enabled for all other frameworks and the output be
manually audited.

* [MPS] Fixes premature collection possible in bindings (bug 59547) and implements feedback.

https://bugzilla.xamarin.com/show_bug.cgi?id=59547

* Fixes premature collection possible in bindings im MPSKernel.cs
* Fixes MPSImageHistogramTest from using deprecated API.
* Removes renamed selectors and typos from ApiSelectorTest and ApiTypoTest.

* [MPS] Reenable Copy API and DesignatedInitializer xtro feedback

* Implement more feedback

* More feedback
2017-11-28 14:29:05 -06:00
Sebastien Pouliot 4ad96b03fa
[security] Add bindings for Xcode 9 (#3043)
Also covers the missing enum value (added in xcode9) from
https://bugzilla.xamarin.com/show_bug.cgi?id=59278
2017-11-26 09:53:04 -05:00
Timothy Risi da591eae51 [mac-introspection] Use en-US for ApiTypoTest, fix typo failures (#3018)
Also disables typo check for XM classic because:

`We have 823 typos!`

I'm not sure why but switching to the new API, which specify `en_US`,
seems to report more errors.

Unified API are already fixed and I don't see value in adding _ignore_
entries for classic (we don't add classic-only API anyway) so this
just makes then test built/executed for XAMCORE_2_0
2017-11-22 20:52:10 -05:00
Sebastien Pouliot a2d9c80cb5
[homekit] Expose weakly-typed API since the constants are extensible. Fixed #60303 (#3025)
This is a case of NSString enum extensibility - even if this framework does not use the usual `NS_EXTENSIBLE_STRING_ENUM` macro (which is recent and have not been applied for all framework / headers).

Minimally we need to provide alternative, weakly typed, `NSString`-based API wherever the (extensible) enums types are used. Not the best API (even if we can minimize it's use with `[EditorBrowsable (EditorBrowsableState.Advanced)]`) but C# enums can't be extended this way.

Also, even if less urgent, we need to make the enum-generated helper aware of the extensibility so they do not throw, making it easier to mix strongly and weakly typed code (instead of choosing one over the other).

Taking the first step for `xcode92` with the enum-backed constants in HomeKit, i.e.
* HMAccessoryCategoryType
* HMCharacteristicType
* HMServiceType
* HMSignificantEvent

Reference
https://bugzilla.xamarin.com/show_bug.cgi?id=60303

* [tests] WeakSignificantEvent is a weakly typed alternative (not a weak argument semantic)
2017-11-21 20:50:33 -05:00
Vincent Dondain 30a057ddc0
[CoreImage] Update filters for Xcode 9 (#2974)
- Fixes bug #57350: Review new CoreImage filters added in Xcode 9
(https://bugzilla.xamarin.com/show_bug.cgi?id=57350).
- Adds `AVCameraCalibrationData` and `CIBarcodeDescriptor` to `generator-filters`.
- Fixes `ApiCoreImageFiltersTest`'s `GenerateBinding` to use valid `[CoreImageFilterProperty]`.
- In `CheckManagedFilters` generate code of SuperClass when detected so it's easier to bind.
2017-11-16 16:38:14 -05:00
Sebastien Pouliot e05048f182
Merge latest d15-5 (#3002)
* Updated reference to mono/mono@950ea65 (#2975)

* [macos] Fix AVCaptureDepthDataOutput on HS and 10.13 typo (#2977)

* [tests] Remove merge dupe for 'Hlg' typo
2017-11-14 08:51:41 -05:00
Alex Soto 4ab10b0c3a
[AVFoundation] Update up to Xcode 9.2 Beta 2 (#2978)
* [AVFoundation] Update up to Xcode 9.2 Beta 2

* implement feedback
2017-11-10 14:19:38 -06:00
Alex Soto 4c00387fdc
[HomeKit] Update up to Xcode 9.2 Beta 2 (#2981)
* [HomeKit] Update up to Xcode 9.2 Beta 2

* Fix feedback
2017-11-10 11:18:24 -06:00
Chris Hamons 5993a816a8
[macos] Fix AVCaptureDepthDataOutput on HS and 10.13 typo (#2976) 2017-11-08 14:07:39 -06:00
Sebastien Pouliot 548d0d2192
[passkit] Update up to Xcode 9.2 beta 2 (#2972)
Update (again) a typo in a constant
2017-11-08 14:42:38 -05:00
Sebastien Pouliot 54d9faf0b0 [tests] HMHomeAccessControl conformance to NS[Secure]Coding is not documented 2017-11-07 12:04:19 -05:00
Timothy Risi 492121ec3b [macOS] Fix Introspection and API tests (#2891) 2017-11-03 20:36:34 -08:00
Sebastien Pouliot 395feca0d9 Merge branch 'xcode9.1' into master-merge-xcode91-take2 2017-11-03 10:30:07 -04:00
Sebastien Pouliot 5239f2528a Merge branch 'xcode9.1' into d15-5-xcode9.1 2017-10-31 23:31:00 -04:00
Sebastien Pouliot 16214f305b Revert "[MetalPerformanceShaders] Activate bindings for Xamarin.Mac and add n… (#2816)"
This reverts commit 531bafcfaa.
2017-10-31 17:17:54 -04:00
Alex Soto 79d325d5ae [SceneKit] Adds Xcode 9 Beta 1 to stable bindings (#2925)
* [SceneKit] Add Xcode 9 Beta 1 to stable bindings

* Implement feedback

* Use https instead of htt(t)p in links, and link to iOS directly
2017-10-27 09:47:19 -05:00
Timothy Risi 27741b636c [macOS] Fix Introspection and API tests (#2891) 2017-10-23 11:22:17 -08:00