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

822 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 02f10a6583
[AppKit] Remove NSMenuView from .NET (it's a 32-bit only type). (#13291) 2021-11-08 16:15:41 +01:00
Rolf Bjarne Kvinge 696e7a5679
[ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere. (#13231)
* [ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere.

The PlatformHelper class is deprecated, so implement a new version that isn't
deprecated, and which shares a similar API between all platforms - the Check*
methods includes the name of the platform, because that makes it clearer which
version we're talking about from the call site. There's a quirk though:
there's no separate ChecktvOS or CheckMacCatalyst, because the system version
is the same as for iOS, so we can just use 'iOS'.

For macOS we can now use NSProcessInfo.ProcessInfo.OperatingSystemVersion to
determine the OS version, because it's supported in all versions of macOS we
support for .NET.

Fixes issues such as this when building with XAMCORE_4_0:

> CoreMedia/CMSync.cs(590,11): error CS0103: The name 'PlatformHelper' does not exist in the current context

* Bring back PlatformHelper.CheckSystemVersion, but only for !NET.

* [tests] Remove 32-bit macOS logic, it's long dead.

* [introspection] Implement OS version check using 'NSProcessInfo.ProcessInfo.IsOperatingSystemAtLeastVersion' for macOS.

* [monotouch-test] Use TestRuntime.[Check|Assert]XcodeVersion instead of PlatformHelper.CheckSystemVersion.
2021-11-04 11:13:23 +01:00
Manuel de la Pena 8e0a7c8b52
[QuickLook] Add missing selectors for Xcode 13.1 (#13200) 2021-11-02 10:42:20 -04:00
Rolf Bjarne Kvinge 545a4874f8
[SecIdentity] Subclass NativeObject + numerous other code updates (#13149)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Use the 'Runtime.GetNSObject<T> (IntPtr, bool)' overload to specify handle
  ownership, to avoid having to call CFObject.CFRelease manually later.
* Use Array.Empty<T> instead of creating an empty array manually.
* Remove the (IntPtr) constructor for .NET.
2021-11-02 07:48:55 +01:00
Manuel de la Pena 7b786db642
[AVFoundation] Fix intro issues in monterey. (#13182) 2021-10-29 17:32:22 -04:00
Manuel de la Pena 2cc31dcb9c
[MailKit] Fix intro in monterey. (#13169) 2021-10-29 11:06:14 -04:00
Manuel de la Pena 03960831d5
[Chip] Removing intro failins in monterey. (#13143) 2021-10-28 11:19:52 -04:00
Rolf Bjarne Kvinge 02431b9fc8
[.NET] Move the nfloat type to the ObjCRuntime namespace for .NET. (#13092)
Also move the NMath type from the System namespace to the ObjCRuntime namespace.

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2021-10-28 11:06:31 +02:00
Rolf Bjarne Kvinge b70e6f4674
Submodule MonoTouch.Dialog. (#13058)
* Submodule MonoTouch.Dialog.

Submodule MonoTouch.Dialog, so that we can easily build it using .NET. This
submodule will become redundant when/if we publish a .NET version of
MonoTouch.Dialog, but until that happens we need it at least for our own test
suites.

This also means we have to copy our NuGet.config and global.json files to the
MonoTouch.Dialog project directory so that we point msbuild to use our local
build.

New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@cbda703 [Touch.Client] Use MonoTouch.Dialog from a submodule. (#109)

Diff: 3345db2f4e..cbda703583

* Use relative path for submodule.

And fix indentation and set the branch name.

* Don't use 'RootTestsDirectory' when it might not be defined yet.

* [tests] Our test projects don't need to reference MonoTouch.Dialog directly.

The projects get the MonoTouch.Dialog reference indirectly through the
Touch.Client project reference.

* [tests] Only validate unique errors in the .NET unit tests.

* [tests] No need to reference System.Json anymore, that's handled directly in the MonoTouch.Dialog project.

* [tests] Reference nunit.framework.targets so we get a workaround for an NUnit issue everywhere.

* [msbuild] Only try to create a package if we're able to create an app bundle.

This fixes an issue where a library project would try (and fail) to create a
package when 'CreatePackage=true' (which could be set for the executable
project, but inherited by the library project since the executable project
depends on it).

* [tests] Adjust PackTest.BindingXcFrameworksProject to not set the AssemblyName property.

MSBuild ends up being very confused when the project we're trying to build
depends on other projects, because AssemblyName is set for all the projects
being build, and MSBuild complains about ambiguous projects:

> error: Ambiguous project name 'bindings-xcframework-test'
2021-10-26 08:18:34 +02:00
Rolf Bjarne Kvinge dbe31e91df
[CFType] Subclass NativeObject + a few other code updates (#13086)
* Subclass NativeObject to reuse object lifetime code. This isn't for CFType
  itself, but all its subclasses.
* Add a public default constructor to maintain compat, but remove it for XAMCORE_4_0.
* Add an internal (IntPtr, bool) constructor to follow the NativeObject pattern.
* Enable nullability and fix code accordingly.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use 'nameof (parameter)' instead of string constants.
2021-10-25 15:19:00 +02:00
Rolf Bjarne Kvinge b9de02c457
[introspection] Skip verifying the objc_msgSend[Super]_stret on all platforms. (#12939)
Now that macOS runs on ARM64 (and also the simulators soon), we need to have to same logic for all platforms.

Fixes:

    Introspection.iOSApiPInvokeTest
        [FAIL] Could not find the field 'objc_msgSend_stret' in /usr/lib/libobjc.dylib
        [FAIL] Could not find the field 'objc_msgSendSuper_stret' in /usr/lib/libobjc.dylib
        [FAIL] SymbolExists :   2 errors found in 5300 functions validated: objc_msgSend_stret, objc_msgSendSuper_stret
            Expected: 0
            But was:  2
                at Introspection.ApiPInvokeTest.SymbolExists() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/introspection/ApiPInvokeTest.cs:line 182
2021-10-07 20:15:54 +02:00
Rolf Bjarne Kvinge 63de01c21c
[tests] Fix packaging of Xamarin.Mac tests. (#12776)
I recently deleted the generated makefile support for building and running our
test suites. It turned out that it was used for building the packaged
Xamarin.Mac tests, so it wasn't as unused as I thought.

So fix the building and packaging of Xamarin.Mac tests to not use the
(non-existent) makefile targets, but instead replicate it with manual make
code.

Also take the opportunity to add packaging and execution of the .NET versions
of these test suites we execute on other macOS versions (both for macOS and
the Mac Catalyst).

* [devops] Use stricter matching when finding the Xamarin.Mac pkg link.

Otherwise the branch name in any package could end up matching the pattern we
were looking for:

	XM_PACKAGE=https://bosstoragemirror.blob.core.windows.net/wrench/tests-package-xamarin-mac-tests/15759261d425ae08494b0a26862a0b1356c5f8ec/5268864/package/Microsoft.iOS.Bundle.15.0.101-ci.tests-package-xamarin-mac-tests.68.pkg

is just clearly wrong.
2021-10-06 08:10:07 +02:00
Chris Hamons dade24c63a
Catalyst changes for CoreAnimation, CoreFoundation, and AVKit (#12926) 2021-10-05 16:42:37 -05:00
Manuel de la Pena 67e1ca5459
[Metal] Add support for xcode 13 beta5 . (#12875)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-05 13:32:48 -04:00
Rachel Kang 70dd0d31fa
[Intents] Update bindings for Xcode 13.0 betas 1 through 5 (#12771)
* "[Intents] Update bindings for Xcode 13.0 betas 1 through 5"

* Update based on feedback

* Update based on feedback

* Update based on feedback
2021-09-21 20:30:56 -04:00
TJ Lambert e16d8fe1fe
[Dotnet] Enable the Test to check for Dotnet Attributes (#12745)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-09-20 15:13:53 -04:00
Rolf Bjarne Kvinge c2a531259f
[introspection] Skip VideoToolbox classes in the ApiCMAttachmentTest on tvOS devices. (#12695)
They crash on device.
2021-09-16 08:25:29 +02:00
Rachel Kang b9cde5eeea
Merge pull request #12601 from rachelkang/xcode13.0-coreimage-b1-b3
[CoreImage] Update Xcode 13.0 bindings betas 1 and 3
2021-09-15 13:56:26 -04:00
Manuel de la Pena 124dc24bea
[AVFoundation] Add support for xcode 13 beta 5. (#12550)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-09-15 11:37:21 -04:00
Rolf Bjarne Kvinge 2a3bb286f0
[src] Fix the library for a few P/Invokes. (#12715)
This matters because we use the library defined by the P/Invoke to determine
which frameworks to link with, and if we get it wrong, things like this may
happen:

    Undefined symbols for architecture arm64:
      "_AudioObjectGetPropertyData", referenced from:
          wrapper_managed_to_native_AudioUnit_AudioUnit_AudioObjectGetPropertyData_uint_AudioUnit_AudioObjectPropertyAddress__uint__intptr__uint__uint_ in Xamarin.MacCatalyst.dll.o

because we though that the AudioObjectGetPropertyData function was in the
AudioUnit framework, and not in CoreAudio where it really is, and thus we
didn't link with the CoreAudio framework.

Also add an introspection test to verify that the library our P/Invokes point
to is correct.
2021-09-15 11:05:59 +02:00
Alex Soto 8bc4fc645c
[UIKit] Update bindings to Xcode 13 Beta 5 (#12706)
* [UIKit] Update bindings to Xcode 13 Beta 5

* Fix tvOS availability

* Apply feedback

* Add UIPointerAccessory and feedback

* Fix typo

* Fix availability

* Apply feedback and fix library field lookup
2021-09-14 16:31:45 -04:00
Rachel Kang fba8fe61dc
Merge branch 'main' into xcode13.0-coreimage-b1-b3 2021-09-10 18:00:51 -04:00
Rolf Bjarne Kvinge 033ebd7f84
[tests] Import nunit.framework.targets in more .NET test projects. (#12691)
This is to set the -dlsym:-nunit.framework.dll option, because nunit.framework.dll
contains a P/Invoke to a function that doesn't exist.

For some reason this is more of a problem in tvOS projects than iOS projects
(although it happens for iOS projects as well).
2021-09-10 21:07:09 +02:00
Rachel Kang e75c4e36a3
Fix CIRawFilter intro issues
from Sebastien: "most filters are key-based natively (not-NSObject subclasses)) and we expose them as C# _user-type_ CIFilter-subclasses in recent years _most_ filters have also been exposed natively as protocols (not classes), we expose them as `*Protocol` interface types `CIRAWFilter` is a special case, it's a native `CIFilter` subclass so we're not using [CoreImageFilter] and [CoreImageFilterProperty] attributes to define it which also means we cannot use the "extra" tests to validate the filter properties. So we skip it here. Do not fear it's still tested, like any _normal_, NSObject subclass we have bound :-)"
2021-09-10 14:31:02 -04:00
Manuel de la Pena 42dd6cea65
[XKit] Update for xcode13 beta 5. (#12610)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-09-10 12:16:55 -04:00
Rolf Bjarne Kvinge 770b9c5d27
[tests] Adjust a few introspection checks to work on iOS 11.4.1 (#12668)
I ran into these failures when running on an iOS 11.4.1 device (iPhone 7 / A1778).
2021-09-09 09:00:20 +02:00
Rolf Bjarne Kvinge 24ea02759f
[dotnet] Support SupportedOSPlatformVersion. Fixes #12336. (#12638)
* Add support for the SupportedOSPlatformVersion MSBuild property, and write
  it to the Info.plist for the corresponding minimum OS version.
* If there are any minimum OS version in the Info.plist, we'll now show an
  error if it doesn't match SupportedOSPlatformVersion.

This unfortunately means that if there's any minimum OS version in any
Info.plist, then that will most likely have to be moved to the
SupportedOSPlatformVersion property (or removed entirely if that's the right
choice), since it's unlikely to match the default value for
SupportedOSPlatformVersion. However, this was deemed to be the best option for
the future (it's a one-time pain during migration).

Also add new tests, update existing tests, and update the templates.

Fixes https://github.com/xamarin/xamarin-macios/issues/12336.
2021-09-08 09:20:05 +02:00
Sebastien Pouliot 4274f1d6c0
[tests][intro] Move protocol check for QLPreviewReply* to base class (#12596)
so they can be ignored on macOS (12+) too
2021-08-31 17:27:08 -04:00
Manuel de la Pena 143a2216a6
[ThreadNetwork] Add new framework Xcode 13 beta 5. (#12533)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-08-26 18:15:31 -04:00
Rolf Bjarne Kvinge 55146dc3db
[tests] Remove some ignores for issues that have been fixed. (#12527) 2021-08-25 09:23:30 +02:00
TJ Lambert 264eabac12
[ShazamKit] Updates Xcode13 beta1 (#12189) 2021-08-17 11:02:55 -05:00
Manuel de la Pena bd7e5c20c1
[Xcode13] Bump to beta 5. (#12413) 2021-08-13 13:07:19 -04:00
Rolf Bjarne Kvinge 617b88e270
[introspection] Share the logic for .NET between all platforms. (#12409)
* Share the logic for .NET between all platforms.
* This means adding a macOS variation of introspection for .NET.
* A few fixes to make sure the macOS variation passes:
    * Make NSTabViewController.SegmentedControl fully unavailable (it's never
      been in any stable version of Xcode).
    * Treat API with an Obsolete attribute as API with an Obsoleted attribute
      with regards to availability.
    * Ignore OSPlatform attributes we don't understand.
    * Ignore the ApiAvailabilityTest.LegacyAttributes test on macOS as well.
2021-08-13 09:32:56 +02:00
Sebastien Pouliot 0a88e5964c
[tests][intro] Fix introspection when running on MacCatalyst 15 (macOS12) (#12403) 2021-08-11 20:05:13 -04:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Manuel de la Pena 0d5d94da41
[OSLog] Add support for xcode13 beta4. (#12392) 2021-08-10 23:12:16 -04:00
Sebastien Pouliot ecad9d9667
[tests][intro] Fix Phase tests on macOS 12 and iOS devices (#12376)
It's a `Phase` vs `PHASE` lookup that make the tests checking for
fields fail.

```
FieldExists: 3 errors found in 6603 fields validated: PHASESpatialCategoryDirectPathTransmission, PHASESpatialCategoryEarlyReflections, PHASESpatialCategoryLateReverb
```
2021-08-06 16:28:04 -04:00
Rachel Kang e45969fb08
Merge pull request #12337 from rachelkang/xcode13.0-quicklook-b1-b2-b3-b4
[QuickLook] Update bindings for Xcode 13.0 beta 1,2,3,4
2021-08-06 12:27:08 -04:00
Rolf Bjarne Kvinge 6d078c2ac8
[tests] Add debug spew to track down #xamarin/maccore@2414. (#12354) 2021-08-06 09:45:55 +02:00
Rolf Bjarne Kvinge b06baea3c8
[tests] Merge the Main function into the AppDelegate class in numerous tests. (#12356)
Also use a non-obsolete overload of UIApplication.Main.

This shrinks our code and file count a bit.
2021-08-06 09:44:58 +02:00
Sebastien Pouliot 77defde89e
[corefoundation] Fix minimum version on MacCatalyst (#12361)
There's no need in having availability attributes for versions earlier
than the current minimum.

Re-enable the `Introduced` test for _legacy_ Catalyst as it's fine since
it use the older attributes. It's still not possible to enable it for
`NET` until all manual bindings are updated.
2021-08-05 19:19:26 -04:00
Rachel Kang 5b72769db2
Merge branch 'main' into xcode13.0-quicklook-b1-b2-b3-b4 2021-08-05 10:03:43 -04:00
Manuel de la Pena 9aef167b19
[PHASE] Add suppport for Xcode13 beta 2. (#12098) 2021-08-04 22:38:03 -04:00
Sebastien Pouliot fa5f323c88
[tests][intro] Fix protocol results for macOS 12 beta (#12347)
IOW move some custom checks from iOS to the base class that also
covers macOS.
2021-08-04 16:40:14 -04:00
TJ Lambert 9a6c0753ac
[SoundAnalysis] Updates for Xcode13 Beta1 (#12181)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-08-04 10:09:46 -04:00
Sebastien Pouliot b39f3ac92d
[xcode13] Fix catalyst intro tests on macOS 12 (#12339)
Move a few macOS special cases into base class so they will apply to
Catalyst too.
2021-08-04 08:48:47 -04:00
Rachel Kang 75b150ef5f
[QuickLook] Update bindings for Xcode 13.0 beta 1,2,3,4 2021-08-03 16:37:56 -04:00
Rachel Kang 3d0ac38b2f
[PassKit] Update bindings for Xcode 13.0 beta 1, 2 (#12299) 2021-08-03 13:17:27 -04:00
Rolf Bjarne Kvinge b9c12e5fb0
[introspection] Make green on .NET/Mac Catalyst. Fixes #10215. (#12329)
* [introspection] Ignore the ApiAvailabilityTest.LegacyAttribute test on Mac Catalyst as well.

* [introspection] #10883 only applies to Mac Catalyst for legacy Xamarin.

* [xharness] introspection is now green on .NET/Mac Catalyst
2021-08-03 17:58:10 +02:00
Rachel Kang af2fea2f82
[Photos] Update bindings for Xcode 13.0 beta 1 and beta 2 (#12163)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-07-30 12:33:59 -04:00
Manuel de la Pena dab0f2ed9a
[HealthKit] Add support for xcode13 beta4. (#12184) 2021-07-29 11:11:39 -04:00
Rolf Bjarne Kvinge a6c7c12474
[src] Add AppKit to Mac Catalyst. (#12268)
* A lot of availability attribute updates.
* Some conditional "#if !__MACCATALYST__" in manual binding files.
* xtro updates.
* Misc other minor tweaks.
2021-07-29 16:17:51 +02:00
Rolf Bjarne Kvinge 2ca8970122
[tests] Add a .NET version of introspection for Mac Catalyst. (#12039)
* [tests] Add a .NET version of introspection for Mac Catalyst.

It shows a lot of failures (so it's disabled by default), but this way we can
at least start to fix the failures.

* [xharness] Always ignore the new test.

* [xharness] Ignored projects should be ignored.
2021-07-28 09:39:29 +02:00
Sebastien Pouliot 2032f4a09a
[tests] Fix introspection results on iOS 15 beta 3 devices (#12232) 2021-07-26 20:31:13 -04:00
Sebastien Pouliot 13b1b3c45a
[tests][macos] Fix protocol failures for introspection on beta 3 (#12233) 2021-07-26 20:29:05 -04:00
Sebastien Pouliot b02f7c8e66
[tests] Fix introspection on macOS 12 (#12234)
This was fixed for iOS 15 but also happens on macOS 12 so the case
was moved into the common, shared test sources.
2021-07-26 20:23:12 -04:00
TJ Lambert 149434de3e
[SafariServices] Update to Xcode13 beta1 (#12102) 2021-07-26 17:29:17 -05:00
TJ Lambert 62a9fd98c4
[SensorKit] Updates for Xcode13 Beta1
No updates for Beta 2 or 3
2021-07-23 14:16:28 -05:00
Sebastien Pouliot 2e57729fc2
[corefoundation] Update `CFArray` and make it public (#12003)
* Make `CFArray` public so it can be used for bindings, including 3rd party bindings
* Subclass `NativeObject` to remove some boilerplate code
* Most members are `internal` until needed
* Add nullability annotations

The next step is to make the same kind of optimization done on `NSString`
vs `CFString` by preferring faster p/invokes over calling selectors while
keeping generated code identical.

Also
* Make more methods internal so we can potentially rename them (when the NSArray variants becomes obsolete)
* Add CFArray to the attachment tests
2021-07-19 18:10:44 -04:00
Manuel de la Pena 7ea2524ce6
[Xcode13] Bump xcode 13 to beta 3. (#12137) 2021-07-19 09:03:20 -04:00
Manuel de la Pena a96421fde0
[CoreWLan] Add XCode13 beta 1 support. (#12103)
Added support for MacCatalyst and cleaned the backlog.


Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-07-19 09:02:47 -04:00
Manuel de la Pena d99235db4e
[CHIP] Add support for Xcode13 beta2. (#12025)
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2021-06-30 20:18:41 -04:00
Alex Soto e2a92c1b07
[xcode13] Bump PR to Xcode 13 Beta 2 (#12017)
Update tests regarding the deprecated fields and classes.

Co-authored-by: Rachel Kang <rachelkang@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-06-28 17:54:52 -04:00
Manuel de la Pena 1f84aaa9b4
[CoreSpotlight] Add Xcode13 beta1 support. (#11986) 2021-06-23 11:45:40 -04:00
Rolf Bjarne Kvinge 6b78a86849
Bump min watchOS simulator to 6.0. (#11981)
* Bump min watchOS simulator to 6.0.

Fixes https://github.com/xamarin/maccore/issues/2454.

* Try to keep using the iOS 12 simulator for watchOS 8.0

* [introspection] Fix running on watchOS 6.0.

* [AVFoundation] Adjust availability of AVPlayerWaitingDuringInterstitialEventReason.
2021-06-21 07:42:58 +02:00
Sebastien Pouliot 643cb41436
[tests][intro] Fix failures when executed on iOS 15 beta1 devices (#11960) 2021-06-16 19:49:00 -04:00
Sebastien Pouliot 2ecbb07068
[tests] Re-enable tests ignored due to dotnet/runtime #36897 (#11939)
They should now work (even if some tests required more changes) and
will be able to validate other changes.

ref: https://github.com/dotnet/runtime/issues/36897
2021-06-16 09:41:27 -04:00
Sebastien Pouliot 447c59db60
[iad] Remove most of the framework (#11906)
Most of the API were removed in Xcode 13 beta 1.

The App Store also started to reject some of the (already deprecated)
selectors that were removed, making the API not usable anymore (even
on older versions of the OS).
2021-06-14 20:13:47 -04:00
Rolf Bjarne Kvinge 77a8299e8d
[introspection] Handle a few Metal classes differently for 'encodeWithCoder:'. Fixes #11885. (#11927)
The base ApiSelectorTest class already handles these selectors, and does it
almost right, so just remove this special case and fix the base class logic.

Fixes these failures on macOS 10.15:

    Introspection.MacApiSelectorTest
    	[FAIL] InstanceMethods :   4 errors found in 27001 instance selector validated:
    Selector not found for CoreML.MLDictionaryFeatureProvider : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on CoreML.MLDictionaryFeatureProvider
    Selector not found for CoreML.MLMultiArray : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on CoreML.MLMultiArray
    Selector not found for CoreML.MLFeatureValue : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on CoreML.MLFeatureValue
    Selector not found for CoreML.MLSequence : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on CoreML.MLSequence

Fixes https://github.com/xamarin/xamarin-macios/issues/11885.
2021-06-14 20:08:34 +02:00
Rolf Bjarne Kvinge 0921ae4e26
Bump to Xcode 13 beta 1. (#11861)
* Bump maccore.

New commits in xamarin/maccore:

* xamarin/maccore@9acbbed1f6 [mlaunch] Add support for Xcode 13 beta 1. (#2452)
* xamarin/maccore@e48f75c0b6 [Xamarin.Hosting] Fix the --stdout arg not being forwarded to DeviceLaunchConfig (#2435)
* xamarin/maccore@109c695b1b [Xamarin.Hosting] Fix help string for launchdev argument (#2429)

Diff: cddbd1915d..9acbbed1f6

* [xtro] Fix generation of .pch files
* [xtro] Fix deprecated check to handle (anonymous) declarations and enable latest C# syntax in project
* [xtro] Fix _sanity_ checks
* [xtro] Update todo for beta 1

* [Siminstaller] Force siminstaller to use the xcode 12.5 url

Related issue: https://github.com/xamarin/xamarin-macios/issues/11881

* Fix introspection failures (due to [breaking] changes)
* [tests][intro] Fix hang for tvOS

Creating an instance of `NSMetadataQuery` hangs the simulator.

Even after (xharness) timeout the simulator is not in a good state
to run further tests and every new (tvOS) test will also hang...

* [tests][intro] Same hang for watchOS

except that further test execution does not seem affected (like tvOS)

```
CoreSimulator 772.1 - Device: Apple Watch Series 3 - 38mm (watchOS 8.0) - created by XHarness (42262867-E060-40C0-803E-6DA676AF50CC) - Runtime: watchOS 8.0 (19R5266p) - DeviceType: Apple Watch Series 3 - 38mm

Thread 0 Crashed:: tid_103  Dispatch queue: com.apple.main-thread
0   com.apple.Foundation          	0x00007fff21470bd0 -[NSMetadataQuery dealloc] + 432
1   libobjc.A.dylib               	0x00007fff200d11f7 objc_object::sidetable_release(bool, bool) + 177
2   com.apple.Foundation          	0x00007fff21470a03 -[NSMetadataQuery init] + 64
3   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107efc139 xamarin_dyn_objc_msgSend + 217 (trampolines-x86_64-objc_msgSend.s:15)
4   ???                           	0x000000010c76d4f6 0 + 4504081654
5   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107cffc85 mono_jit_runtime_invoke + 1621 (mini-runtime.c:3197)
6   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107e177d8 do_runtime_invoke + 54 (object.c:3052) [inlined]
7   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107e177d8 mono_runtime_invoke_checked + 136 (object.c:3220)
8   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107e1e3c5 mono_runtime_try_invoke_array + 2101 (object.c:5601)
9   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107daf977 ves_icall_InternalInvoke + 871 (icall.c:3927)
10  com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107dc0167 ves_icall_InternalInvoke_raw + 103 (icall-def.h:667)
11  ???                           	0x000000010a232799 0 + 4465043353
12  ???                           	0x000000010c76e08b 0 + 4504084619
```

* [tests][monotouch-test] Fix failures with xcode 13 beta 1
* [tests][mmptest] Use a FAT framework that's build with x86_64 and arm64

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-06-10 20:07:20 -04:00
Manuel de la Pena 5261242a4f
[Tests] Fix intro tests on older macOS (#11736)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-06-04 13:22:13 -04:00
Rolf Bjarne Kvinge f3b46b955f
[runtime] Add support for toggle refs to CoreCLR. (#11757)
The code contains comments explaining the new behavior.

Some tests that poked into the private 'flags' field on NSObject had to be
updated, because the field is now named differently in .NET.

I also added two more tests for toggle ref scenarios.
2021-06-02 00:13:49 +02:00
Rolf Bjarne Kvinge eeff586458
[AVFoundation/introspection] Fix availability attributes / introspection for watchOS 5.0. Fixes #xamarin/maccore@2420. (#11741)
* [AVFoundation] Set watchOS availability for a few classes that were forgotten about in Xcode 12.5.

Partially fixes https://github.com/xamarin/maccore/issues/2420.

* [introspection] Cope with MLSequence's lack of protocol compliance in earlier versions of watchOS.

Partially fixes https://github.com/xamarin/maccore/issues/2420.

* [introspection] Improve error message to include method and type data.
2021-05-31 15:26:12 +02:00
Sebastien Pouliot 34c55f4ed4
[dotnet][tests][intro] Update ApiPInvokeTest (#11557)
* `QCall` seems to be gone
* `libSystem.Globalization.Native` symbols are part of the executable
  since they come from a static library
2021-05-14 09:00:18 -04:00
Manuel de la Pena c1981b0b7e
[Tests] Undo change that broke intro in BS. (#11556) 2021-05-14 07:49:47 +02:00
Sebastien Pouliot aaefe7bcf2
[tests][intro] Add back `[Test]` on some methods (#11542)
Those were likely removed when we excluded the tests from Catalyst
2021-05-13 16:58:10 -04:00
Manuel de la Pena 01d11263b9
[Tests] Ignore tests that fail on VMs (#11524)
There are a number of tests that do not work on VMs yet our older
machines are using virtualization. Ignore those tests since we cannot
assert if they work or not.

fixes: https://github.com/xamarin/maccore/issues/2438
2021-05-13 08:41:07 -04:00
Rolf Bjarne Kvinge 9a0cd6182b
[introspection] Add/fix/remove availability attributes for Mac Catalyst to make introspection's Introduced test pass. (#10587)
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2021-04-13 15:48:20 -04:00
Sebastien Pouliot 4e48aa2ae1
[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
2021-04-10 11:09:14 -04:00
Alex Soto bc1d8513a6 Merge remote-tracking branch 'xamarin/xcode12.5' into alex-xcode12.5-main 2021-04-02 21:46:31 -04:00
Peter Collins 5c12fdfac9
[build] Use arcade dependency management tooling (#10890)
* [build] Use arcade dependency management tooling

* Apply feedback

* Apply second round of feedback

* Always make dotnet.config before trying to read it

* Debugging

* Update dependencies, trim tabs and spaces

* [dotnet] Remove the existing workload shipped with .NET and install our locally built ones.

The new version of .NET ships with our workloads, but those aren't
the workloads we want to use, so replace them with our own.

* Update .gitignores.

* Bump to 6.0.100-preview.3.21181.5

That required renaming simulator runtime packs...

* More rename for simulator packages

* moar (hopefully all)

* Bump to 6.0.100-preview.3.21201.11

This fix the issue with `Wait` that failed several tests in monotouch-tests

However it does not include the fix for AppConext.GetData on device (AOT)

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Sebastien Pouliot <sebastien@xamarin.com>
2021-04-02 00:02:27 -04:00
Sebastien Pouliot 747cc9a2b8
[dotnet] Fix device builds (#11036)
With P3 addition on ICU we must now link the native executable as C++.

Remove an old workaround, in many tests, referencing old (5.0/previews)
packages that caused native link time failures.

ref: https://github.com/mono/linker/issues/1139
2021-03-31 12:59:07 -04:00
Sebastien Pouliot 8e3be82e44
[tests] Fix introspection tests running on macOS 11.3 (beta 5) (#10947) 2021-03-25 09:09:30 -04:00
Rachel Kang f05658c0c2
More feedback updates 2021-03-19 18:10:42 -04:00
Rachel Kang f587e8900c
Update with styling/formatting feedback 2021-03-19 18:10:42 -04:00
Rachel Kang 4871938dd0
[AVFoundation] Update bindings for Xcode 12.5 beta 1,2,3 2021-03-19 18:10:41 -04:00
Sebastien Pouliot 9a4c06e006
[tests] Fix introspection build for iOS (and related) (#10906) 2021-03-18 09:15:26 -04:00
Sebastien Pouliot 403a6665e5
[gamecontroller] Update for Xcode 12.5 beta 3 (#10893) 2021-03-17 08:30:18 -04:00
Sebastien Pouliot 00a69e1654
[dotnet] Update `Min*` constants and fix builds for tests (#10835)
We're bumping the minimum OS versions for all supported platforms
https://github.com/dotnet/core/blob/master/release-notes/6.0/6.0-supported-os.md

Intro's `Introduced` test is ignored as it require (a lot of) changes. This
will be fixed in separate PRs and gradually re-enabled.

iOS
```
[FAIL] Introduced : 7573 API with unneeded or incorrect version information
```

tvOS
```
[FAIL] Introduced : 299 API with unneeded or incorrect version information
```

Tracking progress in https://github.com/xamarin/xamarin-macios/issues/10834
2021-03-13 10:38:46 -05:00
Sebastien Pouliot ab501eb2fd
[tests][intro] Run availability tests on properties too (#10763)
and not just methods even if we are generating them on both [1]

That spotted a single error inside `src/Security/SslContext.cs`
which this PR also fix. IOW there's no point in saying the API
was (a long time ago) available since our code to call it was
removed.

[1] which is something we should not need to do on .net since
* the compiler-based tooling does not need it on the getter/setter
* other tools needs to be updated (so it won't break any existing
  use case)
2021-03-03 09:30:46 -05:00
Sebastien Pouliot 6992a5a10a
[generator] Do not inline duplicate attributes when processing protocols (#10683)
- this requires small (but tricky) generator changes
- duplicate availability attributes detection is tested by introspection
- it also requires removing dupes in manual bindings (which was the
  current, if not the _named_, goal for this PR)

Long story:

It's always been hard to detect and enforce removal of extraneous
availability attributes since the generator inlined them _freely_
when processing ObjC protocols.

That meant introspection could not report dupes and led to many
extra attributes. This was **not** a problem in binding files since we
could ignore them. IOW their presence (in the input) does not mean they
are _all_ dupes in generated code (output).

However dupes in manual bindings were also (forced to be) _ignored_ and
those were part of the assemblies we ship. Again it was not a big deal,
nor a source of much extra metadata/size, so it was ignored.

Forward to today, manual bindings needs to be updated for net6 [1] so any
extra we have requires more (manual) work. Cleaning this problem up in
the generator code reduce the (manual) work we need to do.

It also means introspection can detect dupes (in generated and manual
code) so we don't end up adding more (which would also require more
manual work to support both set of attributes).

[1] https://github.com/xamarin/xamarin-macios/pull/10580
2021-03-01 08:39:52 -05:00
Rolf Bjarne Kvinge 85fe6340f6
Bump .NET to 6.0.100-preview.2.21114.3. (#10666)
* Bump .NET to 6.0.100-preview.2.21114.3.

* [dotnet-linker] Several steps are now gone, so load our custom step before the new first step (MarkStep).

* [dotnet-linker] Dump the current steps if we fail to call InsertBefore/InsertAfter.

* [dotnet-linker] Load the CollectAssembliesStep as the first step, and make it load every assembly.

* [dotnet] Set InvariantGlobalization=true because that's the only thing .NET supports for now.

* [dotnet-linker] Use recommended workaround for linker's inability to do load assemblies in custom step.

* [tests] Bump version of MSBuild.StructuredLogger to get support for new log version.

Otherwise this happens in tests that read binary logs:

    System.NotSupportedException : Unsupported log file format. Latest supported version is 9, the log file has version 10.

* [introspection] Ignore P/Invokes to QCall for LogThreadPool* P/Invokes.

* [dotnet-linker] Inject a dummy implementation of mono_config_parse_memory as a temporary solution for mono's removal of the same method.
2021-02-23 07:49:09 +01:00
Sebastien Pouliot 52301f3fb5
[xcode12.5] Bump for beta 2 (#10650) 2021-02-17 13:56:40 -05:00
Sebastien Pouliot 2bec8be74e
[main] Fix running introspection on iOS 11.4 simulators (#10626)
Once you have BigSur installed, to work with xcode12.5, then you
need to bump the minimum simulator versions (to 11.4) and this picked up
a few mistakes in availability and when checking protocol conformance

The bots won't run into those issues, as long as `xcode12.5` is not
merged or while they run on macOS Catalina, but it's nice to have green
tests locally :)

Subset of 8513316015 already in `xcode12.5`
2021-02-11 22:40:55 -05:00
Sebastien Pouliot 8513316015
[xcode12.5] Bump minimum version of simulators (as required for BigSur) (#10594)
Moving to macOS 11.x (BigSur) requires us to bump the minimum/tested
version of simulators to the oldest supported by the required OS.

This means iOS 11.4, tvOS 11.4 and watchOS 5.0 (with iOS 12).

xharness needs to be updated in order for watchOS 5.0, which needs
series 3, to work properly.

Filed as https://github.com/xamarin/xamarin-macios/issues/10593
2021-02-09 15:50:42 -05:00
Rolf Bjarne Kvinge 3bdd092c4d
[introspection] Stop hardcoding minimum OS versions. (#10582)
* [introspection] Stop hardcoding minimum OS versions.

* [src] Remove redundant availability attributes.
2021-02-08 07:34:02 +01:00
Sebastien Pouliot 32bce7fc1f
[xcode12.5] Initial bump for beta 1 (#10573)
This version of Xcode requires macOS 11.0 or later.

New commits in xamarin/maccore:

* xamarin/maccore@de616ca53e [mlaunch] Fix dependencies for Xcode 12.5 beta 1 (#2387)
* xamarin/maccore@e93375583c [Actions] Fix rebase trigger.
* xamarin/maccore@0dfeb85ff6 [CI][VSTS] Add information when the external tool fails. (#2377)
* xamarin/maccore@87e165fdbb Remove Vincent as a code owner 😞 (#2368)
* xamarin/maccore@55a700bb5b [build] Add /restore to Xamarin.Analysis build (#2366)
* xamarin/maccore@2d9f8a9685 Bump to xamarin/xamarin-analysis@95245313 (#2362)

Diff: 428964bf32..de616ca53e

* Bump system mono to the latest available 2020-02 package. (#10402)

This makes xamarin-macios build on Apple Silicon, and also seems to get an
updated csc that fixes a problem with nullability warnings/errors.

* [tests] Fix mmp-regression build

```
10:59:46.5383210 Making all in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/mmp-regression
10:59:46.5392610 TargetFrameworkFallbackSearchPaths=/Users/builder/azdo/_work/1/s/xamarin-macios/_mac-build/Library/Frameworks/Mono.framework/External/xbuild-frameworks MSBuildExtensionsPathFallbackPathsOverride=/Users/builder/azdo/_work/1/s/xamarin-macios/_mac-build/Library/Frameworks/Mono.framework/External/xbuild make all
10:59:46.6208220 /Applications/Xcode_12.5.0-beta.app/Contents/Developer/usr/bin/make clean
10:59:46.6956100 /Applications/Xcode_12.5.0-beta.app/Contents/Developer/usr/bin/make build
10:59:46.7422460 GEN      dylib/libTest.dylib
10:59:46.8094820 ld: library not found for -lSystem
10:59:46.8097590 clang: error: linker command failed with exit code 1 (use -v to see invocation)
10:59:46.8110310 make[2]: *** [dylib/libTest.dylib] Error 1
10:59:46.8112570 make[1]: *** [run] Error 2
10:59:47.0030120 Process make exited with 2
```

This happens on BigSur as it does not find the default location anymore...

* [tests] Do not test GKLeaderboardViewController on BigSur

The issue is the OS version, not the Xcode version. Update check
to skip that test on macOS 11+

* [tests] Fix MSBuild tests / integration

The test cannot work on BigSur since while you can `dlopen` the library
you can open `fopen` it as a file (and can't embed it for the test).

```
12:31:23.9407820 CSC : error CS1566: Error reading resource 'libz.dylib' -- 'Could not find file "/usr/lib/libz.dylib"' [/Users/builder/azdo/_work/1/s/xamarin-macios/tests/msbuild/Xamarin.MacDev.Tests/bin/Debug/net472/tmp-test-dir/msbuild-tests201/XM45Binding.csproj]
12:31:23.9407900 Done Building Project "/Users/builder/azdo/_work/1/s/xamarin-macios/tests/msbuild/Xamarin.MacDev.Tests/bin/Debug/net472/tmp-test-dir/msbuild-tests201/XM45Binding.csproj" (default targets) -- FAILED.
```

* [tests] Fix MTouch tests failures

* `nm` changed it's output and test was updated

* `clang` linking has a much higher limit for it's command-line length

At least it does not seem to be OS specific since both 10.15 and 11.0
returns the same maximum

```
$ getconf ARG_MAX
1048576
```
2021-02-05 20:30:24 -05:00
Rolf Bjarne Kvinge 7584ada30d
Bump to .NET 6.0.100-alpha.1.21060.3. (#10388)
* Bump to .NET 6.0.100-alpha.1.21060.3.

* Fix dotnet command line arguments.

* dotnet build: the project file must be the first argument.
* dotnet build/publish: use the documented verbosity format.

* Update version number in tests.

* [tests/introspection] Adjust introspection to cope with different library names in the new .NET version.

* [tests/link sdk] Adjust the LinkSdkRegressionTest.SpecialFolder test according to the new version of .NET 6.

* [tests/link sdk] Preserve a required method in System.Private.CoreLib to work around a bug in .NET 6.

Ref: https://github.com/dotnet/runtime/issues/46908.

* Revert "[CI][VSTS] Add the donet 6 pkg as a dependency. (#10348)"

This reverts commit 6de4e717e7.

There's no need to provision .NET 6, it's done automatically.
2021-01-14 14:07:28 +01:00
Alex Soto bd16f26f88 Merge remote-tracking branch 'xamarin/xcode12.3' into main 2020-12-15 23:50:18 -05:00
Sebastien Pouliot 4d53f14118
[tests] Re-enable ModelIO in Mac's introspection tests (fixed in 11.1 beta 2) (#10239) 2020-12-08 21:35:12 -05:00
Sebastien Pouliot dcc9a8322d
[gamecontroller] Update for Xcode 12.3 beta 1 (#10228) 2020-12-07 17:23:13 -05:00
Alex Soto ba0465c2e6
[AVFoundation] Update bindings to Xcode 12.3 Beta 1 (#10162)
* [AVFoundation] Update bindings to Xcode 12.3 Beta 1

* Fix xtro
2020-11-30 14:53:20 -05:00
Alex Soto f9679cde8c
[ARKit] Update bindings to Xcode 12.3 Beta 1 (#10158)
* [ARKit] Update bindings to Xcode 12.3 Beta 1

* Update tests/introspection/ApiProtocolTest.cs
2020-11-26 10:26:04 -05:00
Rolf Bjarne Kvinge f4c9327fac
[dotnet] Bump to .NET 6.0.100-alpha.1.20556.2 and net6.0 (#10079)
This involves a few changes:

* Change everything to reference net6.0 instead of net5.0
* Update various variables to be NET6* instead of NET5*
* Reorder build logic to account for that our targets are imported earlier in
  the build process:

   In the latest .NET 6, our Workloads.targets is imported earlier in the
   build. This requires a few changes, because we still need to run most of
   our logic later in the process, which we do by adding targets files we
   want imported later to the AfterMicrosoftNETSdkTargets property.

   What we're loading as soon as possible:

   * Our version information (Xamarin.Shared.Sdk.Versions.targets)
   * The supported OS versions
     (Microsoft.<platform>.Sdk.SupportedTargetPlatforms.targets)
   * The default OS version
     (Xamarin.Shared.Sdk.TargetFrameworkInference.targets).

   This is all information that the .NET build require early on.

   Changes:

   * Rename all files that are loaded early to *.props.
   * Updated documentations to reflect these changes.
   * Remove Microsoft.<platform>.TargetFrameworkInference.targets, these
     files aren't used and don't contain anything useful.
   * Move the logic to calculate _ComputedTargetFrameworkMoniker has been
     delayed to later, because it needs TargetFrameworkMoniker set.

* Add a StoreAttributesStep to store attributes that are removed by the
  linker, but that the static registrar needs.

   In particular, in .NET 6 the linker removes the
   System.Runtime.CompilerServices.ExtensionAttribute, which the static
   registrar needs to handle category methods properly.

   This involved copying and slightly modifying the RemoveAttributesBase
   code.
2020-11-19 15:01:55 +01:00
Manuel de la Pena 0f7bc75e50 Merge branch 'xcode12.2' into main-xcode12.2 2020-11-17 11:09:15 -05:00
Rolf Bjarne Kvinge 7218d51e1a One straggler! 2020-11-16 15:22:36 +01:00
Alex Soto b589427668 [tests] Accomodate tests to Xcode 12.2 changes 2020-11-12 21:40:32 -05:00
Alex Soto 1b243acbf9 Merge remote-tracking branch 'xamarin/xcode12.2' into d16-8-xcode12.2-merge 2020-11-12 18:52:53 -05:00
Rolf Bjarne Kvinge d6756f4829 Merge remote-tracking branch 'origin/main' into dotnet-6.0.100-alpha.1.20559.4 2020-11-11 16:38:15 +01:00
Rolf Bjarne Kvinge ac36750f49
[tests] Add a tvOS version of the dotnet introspection test project. (#10066)
* [tests] Move the dotnet introspection test project to a new test directory.

A tvOS project will come soon too, this makes the separation nicer.

* [tests] Add a tvOS version of the dotnet introspection test project.
2020-11-10 13:44:05 +01:00
Rolf Bjarne Kvinge c640775699 [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0
New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@f8768d9 Advance into the world of net6.0

Diff: 9abe69e6f5..f8768d99ef
2020-11-10 11:41:06 +01:00
Sebastien Pouliot 1f0b89cd6a
[appkit] Fix introspection tests for NSAccessibility on macOS 10.9 (#10016)
This reverts parts of https://github.com/xamarin/xamarin-macios/pull/9993
and add a special case to the test looking for duplicate attributes
between members and the type.

Why ? Introspection fails because `bgen` inline the `NSAccessibility`
protocol (added in 10.10) into types that existed earlier. That's
normally not a problem since the type-level attribute is there.
However because of the 10.9 (type) vs 10.10 (protocol) issue that was
moved into the manual bindings (so `bgen` does not know it)

Even if built inside `COREBUILD` the issue exists since the protocol
interface does not really exists at that point (by default), so it's
the type (10.9) availability that is looked up.

In retrospect we should have created a new type, like Swift did (a
few years later), named `NSAccessibilityProtocol` for 10.10.

Fix https://github.com/xamarin/xamarin-macios/issues/10009
2020-11-02 08:15:47 -05:00
Alex Soto 9d1988a3c8
[tests][xcode12.2] Fix xammac tests (#9935)
* [tests][xcode12.2] Fix xammac tests

* Update tests/common/TestRuntime.cs

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* [xammac] Avoid multiple #if statements

* [xammac] Fix missing cases amd reduce amount of changes

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-10-21 17:12:48 -04:00
Manuel de la Pena 00e25199ae [Main] Bring Xcode12.1 support. 2020-10-20 17:55:31 -04:00
Manuel de la Pena 18963f0983 [Xcode12.1] Bring Xcode12.1 support. 2020-10-20 17:27:14 -04:00
Rolf Bjarne Kvinge 062352ccae [tests] Use 'Microsoft.NET.Sdk' instead of 'Microsoft.<platform>.Sdk'. 2020-10-16 14:27:57 +02:00
Alex Soto dff6934850
[xcode12.2] Initial commit for Xcode 12.2 Beta 3 (#9877)
* [xcode12.2] Initial commit for Xcode 12.2 Beta 3

* Update iOSApiCtorInitTest.cs

* Fix watchOS check on intro for AVSpeechSynthesisVoice

* Update iOSApiCtorInitTest.cs

* Update iOSApiCtorInitTest.cs
2020-10-15 12:08:27 -04:00
Sebastien Pouliot 3090eca84d
[tests][intro] Detect cases where [Unavailable] is mis-used (#9871)
For each platform the presence of `[Unavailable]` should mean there are
no other availability (introduced, deprecated or obsoleted) attributes
on the same member.

Also check if the type is unavailable. In that case no member should,
for that platform, have other availability attributes.

Also fix failures - all in WatchKit which was removed from iOS.
2020-10-15 08:57:47 -04:00
Sebastien Pouliot 3a35c2425c
[xcode12.1] Bump for GM (#9876) 2020-10-14 20:06:20 -04:00
Sebastien Pouliot c379544def
[xcode12.2][intro] check for duplicate or inconsistent availability attributes (#9825) (#9856)
This can easily happen when existing type(s) or framework are added to a platform. E.g.

```csharp
[Watch (6,0)][iOS (9,0)]
interface AVFoo {
   [Watch (6,0)][iOS (13,0)]
   void NewMember ();
}
```

Here we have duplicate attributes and, while not confusing, it does mean extra (and non required) metadata into the platform assemblies.

```csharp
[Watch (6,0)][iOS (9,0)]
interface AVFoo {
   [Watch (5,0)][iOS (13,0)]
   void NewMember ();
}
```

Here we declare a member as available when the type is not. I'm not sure how the IDE will react - but this should be audited since one of them is wrong (whatever the IDE behaviour is).

Fix https://github.com/xamarin/xamarin-macios/issues/6856

Backport of https://github.com/xamarin/xamarin-macios/pull/9825

Includes additional fixes for XM (disabled in `main`)
2020-10-14 13:57:14 -04:00
Sebastien Pouliot 11aafadd86
[intro] check for duplicate or inconsistent availability attributes (#9825)
This can easily happen when existing type(s) or framework are added to a platform. E.g.

```csharp
[Watch (6,0)][iOS (9,0)]
interface AVFoo {
   [Watch (6,0)][iOS (13,0)]
   void NewMember ();
}
```

Here we have duplicate attributes and, while not confusing, it does mean extra (and non required) metadata into the platform assemblies.

```csharp
[Watch (6,0)][iOS (9,0)]
interface AVFoo {
   [Watch (5,0)][iOS (13,0)]
   void NewMember ();
}
```

Here we declare a member as available when the type is not. I'm not sure how the IDE will react - but this should be audited since one of them is wrong (whatever the IDE behaviour is).

Fix https://github.com/xamarin/xamarin-macios/issues/6856
2020-10-13 14:16:33 -04:00
Alex Soto 2a6320ba55
[tests] Fix macOS 11 intro/apitest (#9844)
* 'GKGameCenterViewController' init throws on macOS 11 and makes sense
  to remove the DefaultCtor since it has other init methods that
  should be used instead. Added XAMCORE_4_0 removal.

* 'ModelIO' seems to be broken in macOS 11.0, if you touch several
  types you end up getting some C++ errors

* 'CoreSpotlight.CSLocalizedString' crashes in Xcode 12.0 GM and now
  in Xcode 12.2 Beta 2 on macOS.

Added issues to check for future betas/GM here #9744
2020-10-12 13:37:22 -04:00
Alex Soto cb524b13a8
[introspection] Do not let intro check on QTKit now that is just stubs (#9843)
* [introspection] Do not let intro check on QTKit now that is just stubs

* Update ApiCtorInitTest.cs

* [QTKit] Fix more QT Tests

* Remove some more QT leftovers
2020-10-11 14:43:41 -04:00
Alex Soto afa9f62ce0
[VideoSubscriberAccount] Update bindings up to Xcode 12.2 Beta 2 (#9794) 2020-10-07 11:53:56 -04:00
Sebastien Pouliot 63e3744c70 [tests][intro] ConstantsCheck should only be executed on latest OS (#9751)
since the files, mapped by the constants, might not be present in earlier
versions of the OS. We can only be sure, of their presence, on the
current/supported SDK version

Fix intro running on iOS 10.3 (64 bits)

```
Introspection.iOSApiTypoTest
    [PASS] AttributeTypoTest
    [FAIL] ConstantsCheck :   NetworkLibrary
  Expected: True
  But was:  False
 :   at Introspection.ApiTypoTest.ConstantsCheck () [0x00168] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiTypoTest.cs:1088
```
2020-10-01 22:38:06 -04:00
Sebastien Pouliot 1e5801c930 [tests][intro] Split attributes typos from API typos tests (#9652)
The latter requires the spellchecker which varies by OS versions, so we
only run it on the latest OS version (and simulator, except macOS).

The former are some internal rules and can be run on every commit and
avoid finding issues late in a release cycle.

Also changed to
- process members even if a type is obsoleted
- process the properties and events on types

About the strings...

Some were fine, others were not. Copy/pasted strings are hard to
maintain. Moving them to constants will help, both maintainability and
will reduce the metadata size of the platform assemblies.

ref: https://github.com/xamarin/xamarin-macios/issues/9353
2020-10-01 22:37:54 -04:00
Sebastien Pouliot 2b6eb8438a
[tests][intro] ConstantsCheck should only be executed on latest OS (#9751)
since the files, mapped by the constants, might not be present in earlier
versions of the OS. We can only be sure, of their presence, on the
current/supported SDK version

Fix intro running on iOS 10.3 (64 bits)

```
Introspection.iOSApiTypoTest
    [PASS] AttributeTypoTest
    [FAIL] ConstantsCheck :   NetworkLibrary
  Expected: True
  But was:  False
 :   at Introspection.ApiTypoTest.ConstantsCheck () [0x00168] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiTypoTest.cs:1088
```
2020-10-01 22:30:04 -04:00
Rolf Bjarne Kvinge 0293ae5153
Revert "[introspection] Adapt to .NET 5's vision of how ConstructorInfo.ToString () should behave." (#9738)
This reverts commit f69ed9a25e.

This is now fixed in .NET.
2020-10-01 08:38:21 +02:00
Sebastien Pouliot 3e14650b6e
[tests][intro] Split attributes typos from API typos tests (#9652)
The latter requires the spellchecker which varies by OS versions, so we
only run it on the latest OS version (and simulator, except macOS).

The former are some internal rules and can be run on every commit and
avoid finding issues late in a release cycle.

Also changed to
- process members even if a type is obsoleted
- process the properties and events on types

About the strings...

Some were fine, others were not. Copy/pasted strings are hard to
maintain. Moving them to constants will help, both maintainability and
will reduce the metadata size of the platform assemblies.

ref: https://github.com/xamarin/xamarin-macios/issues/9353
2020-09-30 07:53:48 -04:00
Manuel de la Pena dcb0c93ab0 [Xcode12] Bring xcode 12 changes into main. 2020-09-23 16:05:22 -04:00
Rolf Bjarne Kvinge 8bda9174fd
Bump to Xcode 12.2 beta 1. (#9665)
* Bump to Xcode 12.2 beta 1.

* [tests] Fix xtro and intro

* Fix wrong availability

* Fix monotouch tests

* Disable watchOS tests and bump iOS version to the right one

watchOS tests have been disabled because Xcode 12.2 Beta is
broken, you cannot create a watch app and deploy, Xcode just
crashes when you try to list simulators, If you try to use
our tools at the moment of deploying we get:

> error HE0046: Failed to install the app 'app' on the device 'watchOS 7.1 (18R5552f) - Apple Watch Series 6 - 44mm': Unable To Install ???app???

* Fix macOS check and bump both versions to satisfy commit distance check, luckily we have infinite numbers!!

Co-authored-by: Alex Soto <alex@alexsoto.me>
2020-09-23 08:11:26 -04:00
Manuel de la Pena 26d108b30a [Intro] Fix availabilty test with watchOS 7.0 2020-09-21 21:26:42 -04:00
Manuel de la Pena eb9b690fe0 Merge xcode12 into d16-8. 2020-09-18 17:51:52 -04:00
Alex Soto bfc98f8059
[xcode12] Initial bump for Xcode 12 GM (#9644)
* [xcode12] Initial bump for Xcode 12 GM

* [tests][intro] We cannot load CoreNFC framework on iOS simulator anymore

* [tests][xtro] New Metal API are not abstract (before XAMCORE_4_0)

* [tests][intro] Fix crash when CSLocalizedString 'description' selector is called

* [tests][xtro] Add support for excluding platforms

Based on `Make.config` variables `INCLUDE_[IOS|TVOS|WATCH|MAC]`

This required moving some entries (common -> macOS) to keep the
sanitizer happy.

* [xtro] Ignore Intents watchOS differences since they will likely match iOS in the future

* Update to use Xcode 12 GMb instead of the old GM

* [tests][xtro] Remove OSLog for iOS and tvOS (changed in GM)

* [tests][msbuild] Disable FrameworkListTest based on the active/disabled platforms

* [tests][msbuild] Track new directory/file inside CoreML projects

* [mlaunch] Bump maccore and disable mlaunch if mac build is disabled

New commits in xamarin/maccore:

* xamarin/maccore@ba332d4d07 Disable mlaunch if Mac is not built (#2314)

Diff: 87a96d21c9..ba332d4d07

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2020-09-16 11:41:44 +02:00
Sebastien Pouliot 9f7a57ec65
[xcode12][tests] Fix typos (#9640) 2020-09-15 13:09:18 -04:00
Sebastien Pouliot a8c5216148
[xcode12] Introspection-based fixes for Big Sur (#9632) 2020-09-15 08:56:24 -04:00
Manuel de la Pena 2147976458
[Metal] Update framework for xcode 12 beta 6. (#9569)
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-09-11 16:06:22 -04:00
Rolf Bjarne Kvinge d2788511b6
[dotnet] Use net5.0-[ios|tvos|watchos|macos] TargetFrameworks. (#9532)
* [dotnet] Set TargetPlatformSupported when the right TargetPlatformIdentifier is used.

* [dotnet] Generate a list of valid OS versions for each platform, and add it to the SupportedTargetPlatform item group.

The generated files: https://gist.github.com/rolfbjarne/765c4e4b38b1b017380c9378d9666317

* [dotnet] Define and set the default platform version if it's not set in the TargetFramework variable.

* [dotnet] Switch to using the new-style TargetFramework values.

This includes bumping spouliot/Touch.Unit to get new-style TargetFramework values for Touch.Client.

* spouliot/Touch.Unit@89afaf7 [Touch.Client] Use the right TargetFrameworks for watchOS and macOS as well. (#92)
* spouliot/Touch.Unit@fd0e576 [Touch.Client] Use the right TargetFrameworks. (#91)
* spouliot/Touch.Unit@40f47db [Touch.Client] Add a macOS and watchOS version for .NET. (#90)
* spouliot/Touch.Unit@1d4b8c0 Add .gitignore for NuGet.config and global.json. (#89)
* spouliot/Touch.Unit@49441f3 Call `mlaunch` instead of `mtouch` (#88)
* spouliot/Touch.Unit@b157cf4 Fix a few markdown issues found by markdownlint. (#87)

Diff: d7f55a6167..89afaf7e05

* [dotnet] Document the script that generates the lists of the target platform versions a little bit better.

* [dotnet] Make the [Platform]SupportedTargetPlatform variables public.

This matches how Android and Windows do it:

* https://github.com/xamarin/xamarin-android/pull/5007
* 18ee4eac8b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSupportedTargetPlatforms.props

* [xharness] Update the TargetFramework value when creating project variations.
2020-08-31 09:27:19 +02:00
Whitney Schmidt efe8abd606
[CarPlay] [Xcode 12] Update through beta 6 (#9479)
* carplay initial updates through beta 6
2020-08-28 13:45:43 -04:00
Alex Soto 4129224408
[Vision] Update bindings to Xcode 12 Beta 1 - 6 (#9523)
* [Vision] Update bidnings to Xcode 12 Beta 1 - 6

* Add feedback

* fix assert messages

* Fix error message

* Apply feedback and stop all the 🤦
2020-08-28 10:57:22 -04:00
Manuel de la Pena a19b0f2c75
[Submission] Fix all the selectors that apple warns about. (#9268) (#9408)
* [Submission] Fix all the selectors that apple warns about. (#9268)

We have noticed the following message from Apple when performing
submissions with Xamarin.iOS:

> ITMS-90338: Non-public API usage - The app references non-public
> selectors in WcBc.iOS: behaviorTypes, convolutionState,
> discoverAllContactUserInfosWithCompletionHandler:,
> discoverAllContactsCompletionBlock,
> discoverUserInfoWithEmailAddress:completionHandler:,
> discoverUserInfoWithUserRecordID:completionHandler:,
> discoverUserInfosCompletionBlock, displayContact, drawableResizesAsynchronously,
> encodeToCommandBuffer:sourceImage:convolutionState:,
> encodeToCommandBuffer:sourceImage:destinationImage:state:,
> getProperty:onChannel:responseHandler:, hasProperty:onChannel:responseHandler:,
> initWithEmailAddresses:userRecordIDs:, initWithMIDIEntity:dataReadyHandler:,
> initWithZoneID:options:, initWithZoneID:subscriptionID:options:,
> isPublicDatabase, mouseUpAction, newDrawable, propertyChangedCallback,
> removeAllAppearanceStreams, replaceTextStorage:, retrieveConnectedPeripherals,
> retrievePeripherals:, setDiscoverAllContactsCompletionBlock:,
> setDiscoverUserInfosCompletionBlock:, setDrawableResizesAsynchronously:,
> setEditedMask:, setMouseUpAction:, setMovieControlMode:,
> setProperty:onChannel:responseHandler:, setPropertyChangedCallback:,
> setSocketFamily:, setTemporaryAttributes:forCharacterRange:, setUserRecordIDs:,
> sourceOffset, subscriptionOptions, takeBackgroundColorFrom:, takePasswordFrom:,
> temporalAntialiasingEnabled, userRecordIDs. If method names in your source code
> match the private Apple APIs listed above, altering your method names will help
> prevent this app from being flagged in future submissions. In addition, note
> that one or more of the above APIs may be located in a static library that was
> included with your app. If so, they must be removed. For further information,
> visit the Technical Support Information at http://developer.apple.com/support/technical/

All of them have been removed but without a break in the API excep
"initWithMIDIEntity:dataReadyHandler:" wich does look like an error on
Apples side.

Empty stubs are used as much as possible except on those cases in which
a handler is called or an output variable should be modified (buffer,
out param) to minimize the users surprise at runtime.
2020-08-21 16:30:51 -04:00
Sebastien Pouliot 2f7770e0b4
[tests][intro] Fix tvOS crash on older (non 4k) devices (#9395) 2020-08-18 13:25:16 -04:00
Sebastien Pouliot e7d605c128
[passkit] Update for Xcode 12 beta 4 (#9218) 2020-08-17 20:01:41 -04:00
Rolf Bjarne Kvinge 9fda2c6c9b
[tests] Add --dlsym:+nunit.framework.dll to all Xamarin.iOS test suites. (#9349)
This works around a build problem that occurs because NUnit ships with a
P/Invoke to a function that doesn't exist on Apple platforms:

    MTOUCH : error MT5210: Native linking failed, undefined symbol: _GetVersionEx. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. [/Users/xamarinqa/myagent/_work/8/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test58/monotouch-test-tvos.csproj]
    MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -fembed-bitcode-marker [/Users/xamarinqa/myagent/_work/8/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test58/monotouch-test-tvos.csproj]
    clang : error : linker command failed with exit code 1 (use -v to see invocation) [/Users/xamarinqa/myagent/_work/8/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test58/monotouch-test-tvos.csproj]

Also fix an issue in mtouch where we would overwrite any previous --dlsym
values; they're now accumulative (`--dlsym:foo.dll --dlsym:bar.dll` works
as expected)

Ref: https://github.com/nunit/nunit/issues/3618
2020-08-12 09:42:53 +02:00
Whitney Schmidt 6ff4eb6c97
[Xcode12][NearbyInteraction] New framework, updated through beta 4 (#9336)
* add new framework for xcode12
2020-08-10 16:06:02 -04:00
Rolf Bjarne Kvinge 8f5dba2194
[introspection] Some P/Invokes have moved to a QCall library in .NET 5 preview 8+. (#9300)
This fixes numerous P/Invoke test failures like this:

    Could not find the symbol 'GlobalizationNative_GetCalendars' in QCall
    Could not find the symbol 'GlobalizationNative_GetCalendarInfo' in QCall
    Could not find the symbol 'GlobalizationNative_EnumCalendarInfo' in QCall
    Could not find the symbol 'GlobalizationNative_GetLatestJapaneseEra' in QCall
    [...]

Ref: a56d6a8034
Ref: fae477f34b
2020-08-07 08:06:31 +02:00
Rolf Bjarne Kvinge 8bb50638da Bump Touch.Unit.
This also required adding System.Core.dll to the MonoTouch.NUnitLite.dll, and fixing a csproj path.

New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@f620668 [Touch.Client] Adjust project configurations. (#83)
* spouliot/Touch.Unit@545400b [Touch.Client] Fix paths in the .NET project files. (#81)
* spouliot/Touch.Unit@703586b [Touch.Client] Add API to exclude tests based on categories. (#82)
* spouliot/Touch.Unit@9266732 [Touch.Client] Add support for macOS. (#80)
* spouliot/Touch.Unit@2d556a5 [TouchRunner] Fix network logging to log if we're logging to a file even if EnableNetwork is false. (#79)
* spouliot/Touch.Unit@1f85e16 [TouchOptions] Fix a few issues related to command-line parsing. (#78)
* spouliot/Touch.Unit@1c272a9 [TouchRunner] Rename TestElement.Update to TestElement.TestFinished to make it clearer when it's used. (#73)
* spouliot/Touch.Unit@9a654ca [TouchRunner] Fix running multiple test assemblies in NUnitLite mode. (#76)
* spouliot/Touch.Unit@55c747f [TouchRunner] Print test output to the console. (#75)
* spouliot/Touch.Unit@ab5dce0 [TouchRunner] Keep track of the last shown test suite, and return to it when the app is relaunched. (#74)
* spouliot/Touch.Unit@1a7068c [TouchRunner] Only update the UI for a single test after the test has finished running. (#72)
* spouliot/Touch.Unit@ba93ddf [TouchRunner] Fix unused variable warning by only defining the variable when it's used. (#71)
* spouliot/Touch.Unit@ab2aaa5 [TouchRunner] Always show 'Run all'. (#70)
* spouliot/Touch.Unit@af58317 Move every Touch.Client projects to its own folder. (#69)
* spouliot/Touch.Unit@8a0ec0d [TouchRunner] Improve name printing in NuGet mode. (#68)
* spouliot/Touch.Unit@c7f8ff0 Ignore any 'packages' directory. (#67)

Diff: b4e8606a85..f62066880a
2020-08-03 16:21:43 +02:00
Rolf Bjarne Kvinge 5dcb243a05 [introspection] Remove NUnitLite and MonoTouchDialog tests.
These tests now end up testing the NUnitLite and MonoTouch.Dialog assemblies from
NuGet, not the ones we ship, which means they're out of our control to fix.
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge dcfa5015cc [tests] Update Xamarin.Mac tests to use Touch.Client and the official NUnit[Lite]. 2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge b7db211e2d [tests] Use MonoTouch.Dialog from NuGet and Touch.Client instead of MonoTouch.NUnit.
* Touch.Client references the official NUnitLite package, which means we're using
  a non-forked version of NUnit.

* This makes it easier for our .NET 5 effort, since we won't have to port an ancient
  version of NUnitLite to .NET 5 (nor will we have to keep using it in our existing
  code, we can use more modern NUnit patterns).

* Reference MonoTouch.Dialog from the NuGet package. This also eases the .NET 5 effort,
  since we won't have to port MonoTouch.Dialog to .NET 5 (we'll probably still do it
  though at some point, but it doesn't have to be done right away), nor build it
  ourselves / ship it.
2020-08-03 11:53:17 +02:00
Whitney Schmidt c999bd5f57
[HealthKit][Xcode12] Update beta 1 (no b2, b3 changes) (#9249)
* HealthKit updates for Xcode12
2020-07-30 16:41:38 -04:00
Sebastien Pouliot e8de7afd4d
[mlcompute] New Xcode 12 framework. Up-to-date with beta 3 (#9208)
Framework not shipped for iOS/tvOS simulators - even if it's available
on macOS...

Feedback FB8132074 / https://github.com/xamarin/maccore/issues/2271
2020-07-28 20:55:28 -04:00
Whitney Schmidt 8fc88096ad
Revert "[Xcode12] HealthKit b1 update (#9152)" (#9217)
This reverts commit 74e8421f2c.
2020-07-28 14:04:31 -04:00
Whitney Schmidt 74e8421f2c
[Xcode12] HealthKit b1 update (#9152)
* HealthKit updates for beta 3
2020-07-28 14:03:56 -04:00
Alex Soto f9c2a62127 [MetalPerformanceShaders] Neural Networks Update to Xcode 11 (#8844)
* [MetalPerformanceShaders] Neural Networks Update to Xcode 11

This includes updates from PRs xamarin/xamarin-macios#6932, xamarin/xamarin-macios#6935 and xamarin/xamarin-macios#7461

It adds new functionality to the neural network components.
This is still not the complete API for 11.3

* Update src/metalperformanceshaders.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Make changes requested by @rolfbjarne

* Fix binding of default random distribution creation

The parameterless function creates new
default distributions and is not a property.
It is a counterpart of CreateUniform.

* Expose public APIs for MPSCnnConvolutionTransposeNode

These APIs are public and documented at: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposenode/2942641-initwithsource?language=objc

I have also tested that they work.

* Reintroduce compat API.

* Fix acronym casing.

* Fix introspection tests.

* Fix xtro.

* One last xtro issue.

* Fix more xtro.

* Another introspection fix.

Co-authored-By: Frank A. Krueger <fak@praeclarum.org>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Apply suggestions from code review

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Apply feedback

* Please the typo guardians

Co-authored-by: Frank A. Krueger <fak@praeclarum.org>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-07-26 18:27:06 -04:00
Sebastien Pouliot dd6f12bb5d
[tools][tests] Update to use macOS 11.0 (instead of 10.16) (#9188) 2020-07-24 22:03:46 -04:00
Sebastien Pouliot 142ff3127b
[xcode12] Bump for beta 3 (#9162)
* Disable iOS 32bits simulator based tests
2020-07-24 08:52:33 -04:00
Alex Soto 98a4c2bd60 [tests] Accommodate intro test to .NET 5 changes 2020-07-22 15:44:42 -04:00
Alex Soto 5d6b8057ed [MetalPerformanceShaders] Neural Networks Update to Xcode 11 (#8844)
* [MetalPerformanceShaders] Neural Networks Update to Xcode 11

This includes updates from PRs xamarin/xamarin-macios#6932, xamarin/xamarin-macios#6935 and xamarin/xamarin-macios#7461

It adds new functionality to the neural network components.
This is still not the complete API for 11.3

* Update src/metalperformanceshaders.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Make changes requested by @rolfbjarne

* Fix binding of default random distribution creation

The parameterless function creates new
default distributions and is not a property.
It is a counterpart of CreateUniform.

* Expose public APIs for MPSCnnConvolutionTransposeNode

These APIs are public and documented at: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposenode/2942641-initwithsource?language=objc

I have also tested that they work.

* Reintroduce compat API.

* Fix acronym casing.

* Fix introspection tests.

* Fix xtro.

* One last xtro issue.

* Fix more xtro.

* Another introspection fix.

Co-authored-By: Frank A. Krueger <fak@praeclarum.org>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Apply suggestions from code review

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Apply feedback

* Please the typo guardians

Co-authored-by: Frank A. Krueger <fak@praeclarum.org>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-07-22 15:44:42 -04:00
Sebastien Pouliot f36b2ae7b8
[sensorkit] Update for Xcode 12 beta 2 (#9142) 2020-07-21 13:12:51 -04:00
Rolf Bjarne Kvinge f9fbf56544
[xharness] Disable default inclusion behavior for the introspection .NET tests. (#9137)
It gets too annoying to keep track of which files are where with the project
cloning we're doing, if files are implicitly included.
2020-07-21 14:48:52 +02:00
Alex Soto 7768cc8f05 [MetalPerformanceShaders] Neural Networks Update to Xcode 11 (#8844)
* [MetalPerformanceShaders] Neural Networks Update to Xcode 11

This includes updates from PRs xamarin/xamarin-macios#6932, xamarin/xamarin-macios#6935 and xamarin/xamarin-macios#7461

It adds new functionality to the neural network components.
This is still not the complete API for 11.3

* Update src/metalperformanceshaders.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Make changes requested by @rolfbjarne

* Fix binding of default random distribution creation

The parameterless function creates new
default distributions and is not a property.
It is a counterpart of CreateUniform.

* Expose public APIs for MPSCnnConvolutionTransposeNode

These APIs are public and documented at: https://developer.apple.com/documentation/metalperformanceshaders/mpscnnconvolutiontransposenode/2942641-initwithsource?language=objc

I have also tested that they work.

* Reintroduce compat API.

* Fix acronym casing.

* Fix introspection tests.

* Fix xtro.

* One last xtro issue.

* Fix more xtro.

* Another introspection fix.

Co-authored-By: Frank A. Krueger <fak@praeclarum.org>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Apply suggestions from code review

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Apply feedback

* Please the typo guardians

Co-authored-by: Frank A. Krueger <fak@praeclarum.org>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-07-18 18:19:53 -04:00
Chris Hamons fbcbdcde77
[AppKit] Xcode 12.0 Beta 1 (#9106)
* [AppKit] Xcode 12.0 Beta 1

* Apply suggestions from code review

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>

* More code review changes

* Apply suggestions from code review

Co-authored-by: Alex Soto <alex@alexsoto.me>

* Code review changes

* Apply suggestions from code review

Co-authored-by: Whitney Schmidt <whschm@microsoft.com>

* Remove unnecessary 10.7 mac attribute

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Whitney Schmidt <whschm@microsoft.com>
2020-07-17 15:19:31 -05:00
Sebastien Pouliot 486ded93dc
[mediasetup] Update for Xcode 12 beta 2 (#9087)
The framework is not available (binary or even headers) for the iOS
simulator, only devices.

As such `tools/mtouch/Makefile` is not updated with a `-weak-framework`

Tracked with
* https://github.com/xamarin/maccore/issues/2266
* https://feedbackassistant.apple.com/feedback/8001312
2020-07-16 20:34:19 -04:00
Sebastien Pouliot 376ad7444d
[authenticationservices] Update for Xcode 12 beta 2 (#9099) 2020-07-16 11:53:02 -04:00
Alex Soto 802bd4e069
[UIKit] Update bindings to Xcode 12 Beta 2 (#8992) 2020-07-10 13:21:18 -04:00
Sebastien Pouliot 05cff07082
[xcode12] Update for Xcode 12 beta 2 (#9052) 2020-07-10 08:56:23 -04:00
Sebastien Pouliot de306cd96d
Bump for Xcode 12 beta 2 (#9027)
* [arkit] Remove fields (from beta2) to fix introspection
* [tests][introspection] AVMutableMediaSelection is as bad as it's non mutable parent
* [tools] Update IsFrameworkBroken (remove CoreAudioTypes and MediaPlayer)
* [tests][monotouch-test] MKPinAnnotationView seems fixed in beta 2
* [tests][xtro] Update ARKit todo (with previous fix)
2020-07-08 09:26:24 -04:00
Manuel de la Pena 5fae175cf6
[ARKit] Add support for Xcode 12 beta 1. (#9002)
PInvoke that is missing is due to a dependency with Visio which is not
yet updated.



Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-07-07 09:37:16 -04:00
Rolf Bjarne Kvinge 919edef176 [introspection] Skip verification of P/Invokes to the libhostpolicy library.
System.Private.CoreLib.dll contains P/Invokes to a libhostpolicy library,
which isn't shipped.

An isssue has been filed to fix this in the runtime: https://github.com/dotnet/runtime/issues/38543
2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 9075929561 [introspection] Skip verification of GlobalizationNative_* functions for .NET, they're not shipped yet. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 8f4877a665 [introspection] Adjust native filename for 'libSystem.Native'. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge cf7e855857 [introspection] Skip NUnitLite and MonoTouch.Dialog in .NET 5. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge b303f5e699 [introspection] Disable tests that require crypto due to dotnet/runtime#36897 on .NET. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge f69ed9a25e [introspection] Adapt to .NET 5's vision of how ConstructorInfo.ToString () should behave. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 022092a002 [introspection] Add a .NET project for iOS. 2020-06-30 18:41:16 +02:00
Sebastien Pouliot f427b5e91d
[xcode12] Bump for beta 1 (#8935)
Known issues https://github.com/xamarin/xamarin-macios/issues/8943
2020-06-26 14:02:44 -04:00
Rolf Bjarne Kvinge 952037b7a3
[tests] Remove Classic code from all tests. (#8707) 2020-05-29 16:43:06 +02:00
Alex Soto 1614d569cc
[d16-7] Merge Xcode11.5 Support and include provisionator changes (#8645)
New commits in xamarin/maccore:

* xamarin/maccore@ef861db73e [devops] Enhance Xcode renaming script (#2208)

Diff: 92a06f7303..ef861db73e
2020-05-21 14:11:27 -04:00
Alex Soto 5dc1b55dc6
[master] Merge Xcode11.5 Support and include provisionator changes (#8643)
New commits in xamarin/maccore:

* xamarin/maccore@4bfce64847 Update README.md
* xamarin/maccore@24682998f7 [devops] Enhance Xcode renaming script (#2206)
* xamarin/maccore@e03f16b862 [Localization][Mlaunch] Fix watchos timeout issue (#2196)

Diff: ad1696d6f3..4bfce64847
2020-05-21 12:16:33 -04:00
Rolf Bjarne Kvinge 944ec6dc2f
[introspection] Remove Classic code. (#8620) 2020-05-20 09:29:21 +02:00
Rolf Bjarne Kvinge c81f254a28
[mtouch/mmp] Share Driver.GetFrameworks. (#8511) 2020-05-05 16:52:56 +02:00
Sebastien Pouliot 15938de198
[generator] Add C#8 nullability into generated code (#7570) (#8333)
Goals
* Reflect Apple nullability annotations in our bindings using C#8
* No warnings when building bindings

Non-Goals
* Update (add or fix) `[NullAllowed]` to match Apple headers (next phase)
* Make the generator or internal code fully nullable aware (`nowarn` is used)

Notes
* Apple's own annotations are not 100% accurate :(
* Where known issue exists we have _fixed_ our attributes to match reality :)
* We also do additional null-checks internally that might seems not required (better safe than sorry).
2020-04-10 12:38:14 -04:00
Sebastien Pouliot a5ac0ea102
[generator] Add C#8 nullability into generated code (#7570)
Goals
* Reflect Apple nullability annotations in our bindings using C#8
* No warnings when building bindings

Non-Goals
* Update (add or fix) `[NullAllowed]` to match Apple headers (next phase)
* Make the generator or internal code fully nullable aware (`nowarn` is used)

Notes
* Apple's own annotations are not 100% accurate :(
* Where known issue exists we have _fixed_ our attributes to match reality :)
* We also do additional null-checks internally that might seems not required (better safe than sorry).
2020-04-09 09:29:28 -04:00
Manuel de la Pena 6c9f62f56e
[Introspection] Fix a false typo in mac modern typo tests. (#8294)
Add Sha as an allowed word in the typo tests, it is a well known
acronym.
2020-04-06 14:31:46 -04:00
Sebastien Pouliot ac01b522f0
[generator] Add missing `EnsureUIThread` for generated `init` and `initWithCoder` (#8250)
Fix https://github.com/xamarin/xamarin-macios/issues/8249
2020-03-31 17:20:44 -04:00
Alex Soto 3ff3e07ebe Merge remote-tracking branch 'xamarin/d16-5-xcode11.4' 2020-03-26 19:59:14 -04:00
Alex Soto f5b3a6f1c4
Merge remote-tracking branch 'xamarin/xcode11.4' into d16-5-xcode11.4 2020-03-08 13:16:04 -04:00
Alex Soto a8f38e3696
[AutomaticAssessmentConfiguration] Update bindings to Xcode 11.4 Beta 3 (#8049)
* [AutomaticAssessmentConfiguration] Update bindings to Xcode 11.4 Beta 3
2020-03-05 19:48:28 -05:00
Sebastien Pouliot 0129618de8
[mtouch] Add `force-rejected-types-removal` optimization (#8009) (#8042)
This optimization can be enabled when it's not possible to use the
managed linker (e.g. **Don't link**) or when the managed linker cannot
remove references to deprecated types that would cause an application
to be rejected by Apple.

References to the existing types will be renamed, e.g. `UIWebView` to
`DeprecatedWebView`, in every assemblies.

The type definition is also renamed (for validity) and all custom
attributes on the types and their members will be removed.
Code inside the members will be replaced with a
`throw new NotSupportedException ();`.

The msbuild test app `MyReleaseBuild` has been updated to test that the
optimization is working as expected (device builds are slow so reusing
this test has little impact in test time).

Basically the test ensure that `UIWebView` is used and cannot be removed
by the compiler (optimization) or the managed linker (since it's
referenced). Since the optimization is enabled then we can `grep` then
final `.app` directory to ensure there's no mention of `UIWebView` inside
any of the files that would be submitted.

The application can be run, by itself, and will turn green if OK, red if
`DeprecatedWebView` can't be found (skeleton replacement for `UIWebView`)
or orange if a `NotSupportedException` is thrown.

Finally introspection tests have been updated to skip over the deprecated
(and renamed) types. It should not be an issue right now, since this
optimization is not enabled by default, but it made testing easier.
2020-03-04 21:21:41 -05:00
Alex Soto 709a90599e Merge remote-tracking branch 'xamarin/xcode11.4' into d16-5-xcode11.4-merge 2020-03-03 10:57:24 -05:00
Alex Soto 5cc1406ec4
[Intents] Update bindings from Xcode 10.3 to Xcode 11.4 Beta 2 (#8025)
* [Intents] Update bindings from Xcode 10.3 to Xcode 11.4 Beta 2

* Fix breaking change and apply feedback

* actually add the bug number 🙄
2020-03-03 06:49:56 -05:00
Sebastien Pouliot 54f2dae935
[mtouch] Add `force-rejected-types-removal` optimization (#8009)
This optimization can be enabled when it's not possible to use the
managed linker (e.g. **Don't link**) or when the managed linker cannot
remove references to deprecated types that would cause an application
to be rejected by Apple.

References to the existing types will be renamed, e.g. `UIWebView` to
`DeprecatedWebView`, in every assemblies.

The type definition is also renamed (for validity) and all custom
attributes on the types and their members will be removed.
Code inside the members will be replaced with a
`throw new NotSupportedException ();`.

The msbuild test app `MyReleaseBuild` has been updated to test that the
optimization is working as expected (device builds are slow so reusing
this test has little impact in test time).

Basically the test ensure that `UIWebView` is used and cannot be removed
by the compiler (optimization) or the managed linker (since it's
referenced). Since the optimization is enabled then we can `grep` then
final `.app` directory to ensure there's no mention of `UIWebView` inside
any of the files that would be submitted.

The application can be run, by itself, and will turn green if OK, red if
`DeprecatedWebView` can't be found (skeleton replacement for `UIWebView`)
or orange if a `NotSupportedException` is thrown.

Finally introspection tests have been updated to skip over the deprecated
(and renamed) types. It should not be an issue right now, since this
optimization is not enabled by default, but it made testing easier.
2020-03-02 09:20:29 -05:00
Rolf Bjarne Kvinge 47291a95b4
[src] Simplify/remove defines. (#8011)
* XAMARIN_MAC: Used once, replace with MONOMAC.
* UNIFIED: Use once elsewhere, replace with __UNIFIED__.
* OBJECT_REF_TRACKING: not used anywhere.
* XAMARIN_MODERN: not used anywhere.
* NET_2_0: not used anywhere.

Also update the README a bit.
2020-02-29 00:22:58 +01:00
monojenkins fe451491f6
[xcode11.4] [tests] Add `.cctor` execution to introspection (#7987)
This will spot cases like https://github.com/xamarin/xamarin-macios/issues/7959
where a type (static) constructor can fail at runtime, leading to
`TypeLoadException`

Ideally it's covered by it's own tests but it's better covered twice
than never :)

On iOS 64bits [1] simulator we hit some failures [2], later, if the
`.cctor` is executed. It's not a big deal to avoid those types since
we it will be executed on devices later.

[1] API not present on 32bits

[2] Fixing the following triggers similar failures for `DCDevice`

```
ApiClassPtrTest.VerifyClassPtr: class_ptr and RegisterAttribute are different: NFCIso15693CustomCommandConfiguration
Expected: 0
But was: 140735471513712

ApiSelectorTest.StaticMethods: 7 errors found in 2788 static selector validated:
CoreNFC.NFCIso15693ReaderSession : readingAvailable
CoreNFC.NFCNdefMessage : ndefMessageWithData:
CoreNFC.NFCNdefPayload : wellKnownTypeURIPayloadWithString:
CoreNFC.NFCNdefPayload : wellKnownTypeURIPayloadWithURL:
CoreNFC.NFCNdefPayload : wellKnownTypeTextPayloadWithString:locale:
CoreNFC.NFCNdefReaderSession : readingAvailable
CoreNFC.NFCReaderSession : readingAvailable
Expected: 0
But was: 7
```

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
2020-02-26 16:16:04 -05:00
Sebastien Pouliot 98b8ac8321
[tests] Add `.cctor` execution to introspection (#7976)
This will spot cases like https://github.com/xamarin/xamarin-macios/issues/7959
where a type (static) constructor can fail at runtime, leading to
`TypeLoadException`

Ideally it's covered by it's own tests but it's better covered twice
than never :)

On iOS 64bits [1] simulator we hit some failures [2], later, if the
`.cctor` is executed. It's not a big deal to avoid those types since
we it will be executed on devices later.

[1] API not present on 32bits

[2] Fixing the following triggers similar failures for `DCDevice`

```
ApiClassPtrTest.VerifyClassPtr: class_ptr and RegisterAttribute are different: NFCIso15693CustomCommandConfiguration
Expected: 0
But was: 140735471513712

ApiSelectorTest.StaticMethods: 7 errors found in 2788 static selector validated:
CoreNFC.NFCIso15693ReaderSession : readingAvailable
CoreNFC.NFCNdefMessage : ndefMessageWithData:
CoreNFC.NFCNdefPayload : wellKnownTypeURIPayloadWithString:
CoreNFC.NFCNdefPayload : wellKnownTypeURIPayloadWithURL:
CoreNFC.NFCNdefPayload : wellKnownTypeTextPayloadWithString:locale:
CoreNFC.NFCNdefReaderSession : readingAvailable
CoreNFC.NFCReaderSession : readingAvailable
Expected: 0
But was: 7
```
2020-02-26 15:03:59 -05:00
Alex Soto cbe129fad0
[xcode11.4] Add support for Xcode 11.4 Beta 2 (#7944) 2020-02-19 18:33:06 -05:00
Alex Soto cee4b5e5a1
[xcode11.4] Add xcode 11.4 b1 initial support (#7805)
* [xcode11.4] Add xcode 11.4 b1 initial support

* [xtro] re-enable PDFKit

* Disable watchOS and fix xtro

Unfortunately watchOS simulator hangs when we try to deploy to it
and it keeps our tests timing out. Disabling for now until we
can investigate more.

Disables PDFKit on xtro in macOS

* [jenkins] Switch to use the catalina bot group (#7819)

* Bump maccore to get fix for launching the simulator for watch apps.

New commits in xamarin/maccore:

* xamarin/maccore@546270c8f9 [Xamarin.Hosting] Fix the name of the notification we get when the simulator has launched. (#2145)

Diff: 55957e908d..546270c8f9

* [tests] Diable watch due to time out, enable 10,15,4 in intro, fix min version

* Bump macios-binaries to get updated binary mlaunch as well.

New commits in xamarin/macios-binaries:

* xamarin/macios-binaries@f8c6e63 Bump mlaunch to xamarin/maccore@546270c8f9

Diff: eb6980e8b6..f8c6e63228

* [msbuild] Reflect ibtool changes in our tests

Looks like Apple reverted some changes introduces in Xcode 11
in ibtool, for more context see xamarin/xamarin-macios#6970

* [mtouch] Workaround strange behavior of realpath.

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-02-11 20:25:43 -05:00
Waleed Chaudhry 00985a55e2
[Localization] mtouch/mmp C# (#7710) 2020-01-31 15:02:52 -05:00
Manuel de la Pena e98780ec8d
[Introspection] Allow introspection to test CAMetalLayer when xcode 11 and simulator. (#7670)
The order of the check matters, we only skip with a sim && not on
xcode11.

The other whay around will do the wrong short circuit. Since if we are
not on Xcode11 we will always skip, including device, which is not
correct.

Fixes: https://github.com/xamarin/xamarin-macios/issues/6243.
2020-01-05 18:34:20 -05:00