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

805 Коммитов

Автор SHA1 Сообщение Дата
Alex Soto 132d5694d6
[ScreenCaptureKit] Add ScreenCaptureKit bindings up to Xcode 13.3 (#14644)
* [ScreenCaptureKit] Add ScreenCaptureKit bindings up to Xcode 13.3

* Use more appropriate exceptions.

* Remove ScreenCaptureKit from Mac Catalyst.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-05 20:16:31 -04:00
Alex Soto cf9f4aa446 [HomeKit] Update bindings up to Xcode 13.3 Beta 3 2022-03-14 22:54:34 -04:00
Alex Soto 0b0ad6f904 [tests] Fix introspection tests for Xcode 13.3 2022-03-14 22:54:33 -04:00
Rolf Bjarne Kvinge 03f8ec502f
[introspection] Fix ApiCMAttachmentTest on macOS / Mac Catalyst. (#14266)
Fixes:

    Introspection.ApiCMAttachmentTest
        [FAIL] CheckFailAttachments : System.InvalidOperationException : Could not create the new instance for type CGEvent.
            at Introspection.ApiCMAttachmentTest.GetINativeInstance(Type t) in xamarin-macios/tests/introspection/ApiCMAttachmentTest.cs:line 498
            at Introspection.ApiCMAttachmentTest.CheckFailAttachments() in xamarin-macios/tests/introspection/ApiCMAttachmentTest.cs:line 572
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2022-02-28 22:35:42 +01:00
Rolf Bjarne Kvinge bd97933b60
[runtime] Remove ObjCRuntime.nfloat in favor of System.Runtime.InteropServices.NFloat. (#14197)
* Remove ObjCRuntime.nfloat (in favor of   System.Runtime.InteropServices.NFloat).
* Automatically add a reference to the System.Runtime.InteropServices.Internal
  package, so that developers get the new NFloat API (with operators) we've
  added post .NET 6 (but don't do this for .NET 7).
* Automatically add a global using alias for
  System.Runtime.InteropServices.NFloat -> nfloat. This is not behind the
  usual `ImplicitUsings` condition our other implicit usings are, because
  they're off by default for existing projects, and the main target for the
  global using alias for nfloat is upgraded projects.
* Automatically generate a global using alias (like above) in the generator
  for all code the generator compiles.
* Update xtro entries to reference System.Runtime.InteropServices.NFloat
  instead of ObjCRuntime.nfloat.
* Add a workaround for a hopefully temporary issue with .NET/CoreCLR where the
  wrong runtime pack is selected otherwise (without the new NFloat API, so
  nothing works at runtime).

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2022-02-24 16:51:12 +01:00
Rolf Bjarne Kvinge a021ecae72
[test] Add help makefile targets to run .NET tests on remote machines. (#14144) 2022-02-16 07:57:09 +01:00
Rolf Bjarne Kvinge 3eb50804a3
[src/introspection] Adjust tests and availability attributes to work run on iOS/tvOS 12.4. Fixes #13957. (#14133)
Fixes https://github.com/xamarin/xamarin-macios/issues/13957.
2022-02-15 08:20:16 +01:00
Rolf Bjarne Kvinge 305ecde2cd
[tests] Adopt XAMCORE_4_0 changes for introspection in .NET. (#14098)
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-02-09 08:26:37 +01:00
Rolf Bjarne Kvinge 5eda463eaf
[Foundation] Remove a WebKit workaround for NSProxy on tvOS in .NET. (#14089)
The WebKit framework doesn't exist on tvOS.
2022-02-08 10:48:40 +01:00
Rolf Bjarne Kvinge d766fe8c8b
[AppKit] Remove a few obsolete members in .NET (#14043) 2022-02-04 08:14:10 +01:00
Rolf Bjarne Kvinge 56a71684e5
[CoreImage] Adopt XAMCORE_4_0 changes in .NET. (#13983) 2022-02-02 16:07:45 +01:00
Rolf Bjarne Kvinge 2d48710858
[AppKit] Adopt XAMCORE_4_0 changes in .NET. (#13987)
* A lot of obsolete/deprecated removal.
* Remove the NSDraggingInfo model, which required numerous other changes.
* Remove the NSPasteboardReading/NSPasteboardWriting models, which required more
  numerous changes.
* Update the tests accordingly.
2022-02-01 20:56:32 +01:00
Rolf Bjarne Kvinge 82a3b71c60
[Foundation] Adopt a better name/signature for numerous Foundation API in .NET. (#13776) 2022-01-20 10:32:55 +01:00
Rolf Bjarne Kvinge fa2173e5ef
[CFNetwork] Move the CFHost and CFHTTP* types to the CFNetwork namespace in .NET. (#13761)
These types come from the CFNetwork.framework, but for some reason they were bound inside CoreServices many years ago.

This resolves a potential issue where we might end up linking with the
CoreServices framework instead of CFNetwork framework (because we use the
namespace of types to determine which framework they belong to).
2022-01-19 08:07:06 +01:00
Chris Hamons a9c2caa571
[tests] Disable attribute duplication check (#13745)
- Disable check "[FAIL] Both '{t}' and '{m}' are marked with `{s}`." type and member on that type in NET
- Due to the behavior of NET6 style attributes, we are forced to duplicate availability attributes in many cases
- See https://github.com/xamarin/xamarin-macios/issues/10170 for details
2022-01-18 09:07:43 -06:00
Rolf Bjarne Kvinge f831146acf
[introspection] Add exception according to recent changes in .NET API. (#13762) 2022-01-18 11:05:58 +01:00
Sebastien Pouliot f269d03c06
[coregraphics] Fix some names for the NET profile (#13668)
* Fix `CGColorConversionInfoTriple` name (missing initial `C`)

* Rename `RectangleFExtensions` to `CGRectExtensions` since the former
  name has not been around for a while

* Remove API naming mistakes (already under XAMCORE_4_0)

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-01-13 07:18:39 +01:00
Rolf Bjarne Kvinge bcbb6c8438
[src] Define XAMCORE_3_0 for .NET for all platforms. (#13566)
Also update xtro and tests accordingly.
2021-12-17 07:44:02 +01:00
Rolf Bjarne Kvinge bc2a5e2251
[xharness] Inline the dotnet-shared.csproj file as well when inlining shared imports. (#13514)
This fixes a problem where we'd build the same project reference from
dotnet-shared.csproj in parallel, and each build would stomp on eachother
(because we'll now clone the project references in dotnet-shared.csproj).

This als required updating project files to use MSBuildThisFileDirectory
instead of MSBuildProjectDirectory, which makes it easier for xharness to
inline/process these files, because MSBuildThisFileDirectory is easy to know
when processing a file, while MSBuildProjectDirectory depends on the calling
project, which complicates matters significantly.

A fix in MonoTouch.Dialog was also required.

New commits in migueldeicaza/MonoTouch.Dialog:

* migueldeicaza/MonoTouch.Dialog@59fbf5b [dotnet] Shared project files don't need the DefaultTargets/ToolsVersion/xmlns attributes.

Diff: 4d0e0a9a5f..59fbf5bb1b

Fixes https://github.com/xamarin/maccore/issues/2527.
2021-12-16 19:01:39 +01:00
Rolf Bjarne Kvinge b169c806fc
[dotnet] Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst. Fixes #10312. (#13562)
Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst, because they don't
apply for a Mac Catalyst app (which is neither a simulator environment, nor a
device environment).

This means that code using these APIs will have to be re-evaluated to
determine what's the correct behavior for Mac Catalyst.

Also update our tests accordingly.

Fixes https://github.com/xamarin/xamarin-macios/issues/10312.
2021-12-15 22:32:14 +01:00
Rolf Bjarne Kvinge 39bdae2b7f
[monotouch-test] Ignore a few tests in non-ARM64 simulators. (#13487)
* [monotouch-test] Ignore a few tests in non-ARM64 simulators.

Some tests fail when running on an M1, but in a x64_86 mode, so just ignore
those unless we're running on ARM64 (this will currently exclude them on
x86_64 hardware too, but that'll eventually not be a problem anymore when
there's no more x86_64 hardware, and just checking for ARM64 is easier than
checking for x86_64 mode on an ARM64 CPU).

* Make more legacy projects unsafe.
2021-12-07 21:10:39 +01:00
Rolf Bjarne Kvinge 5cc92ac564
[src] Add a new ObjCRuntime.NativeHandle type to represent native handles for .NET. Fixes #13126. (#13356)
Add a new struct, ObjCRuntime.NativeHandle, which will be used to represent
native handles for .NET (instead of using IntPtr). The main purpose is to be
able to use 'nint' as a number in API while not being prevented from using
native handles as well.

One example is NSMutableString, which has a constructor that takes a single
'nint capacity' parameter. With this change, we'll also be able to have a
constructor that takes a native handle in .NET - otherwise we'd have two
constructors with the same signature, because a C# 'nint' is just an 'IntPtr'.

This change required numerous changes pretty much everywhere. The work is
split up in commits as well as I was able to, and each commit explains what it
does.

Fixes https://github.com/xamarin/xamarin-macios/issues/13126.
2021-12-02 08:38:39 +01:00
Rolf Bjarne Kvinge 941507525e
[tests] Unify .NET test projects (#13474)
* Make the .NET project files for BundleResources and EmbeddedResources follow
  the pattern of all the other test projects.
* Move the LangVersion and AllowUnsafeBlocks propertieso to the shared project
  file.
2021-12-01 20:00:14 +01:00
Rolf Bjarne Kvinge 00482325d1
[src] Add missing availability attributes in a few places. (#13422)
* [src] Add missing availability attributes in a few places.

* [src] Don't add availability attributes to error enums.

* [introspection] Change version check for Mac Catalyst to be 'greater than'.

We have a tests that verifies that the availability attributes for an API
doesn't state that the API was deprecated before or when it was introduced.

This sounds reasonable, except that Apple has introduced and deprecated entire
frameworks in the same Mac Catalyst version (probably because Apple decided to
port an already deprecated framework to Mac Catalyst).

Our test for this scenario was a bit too eager; this change will make it so
that (for Mac Catalyst only), we accept APIs that are introduced and
deprecated in the same Mac Catalyst version (not not APIs that were deprecated
before they were introduced).
2021-11-29 07:58:16 +01:00
Rolf Bjarne Kvinge c02cc7e27d
[introspection] Fix the ApiFrameworkTest.Simlauncher test to fail in case of errors. (#13456)
* Assert at the end of the test if there were any errors.
* Don't run this test for .NET, since we don't use a simlauncher in .NET.
2021-11-26 20:14:38 +01:00
Rolf Bjarne Kvinge a1d7224c6d [tests][introspection] A few test updates according to the API changes 2021-11-26 14:25:21 +01:00
Rolf Bjarne Kvinge 5329b19f62
[introspection] Migrate .NET code to use the new .NET-style availability attributes. (#13363)
* [tools] Extract the logic to parse OSPlatformAttribute platform names to a separate file/class.

* [introspection] Migrate .NET code to use the new .NET-style availability attributes.

This also means using the 'ApplePlatform' enum instead of the 'PlatformName'
enum, because the latter will be removed in .NET.

* [FileProvider] Exclude some deprecated API from .NET.

* [AVFoundation] Adjust availability attribute for AVCaptureStillImageOutput.HighResolutionStillImageOutputEnabled.

* Update tests.
2021-11-22 20:54:07 +01:00
Rolf Bjarne Kvinge 6d321c9f77
[tests] Don't import nunit.frameworks.target more than once. (#13362)
The nunit.framework.targets file is already imported in the
tests/common/shared-dotnet.targets file, which all these files imports as
well.
2021-11-16 16:46:08 +01:00
Rolf Bjarne Kvinge 66e596e9d9
[tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350)
The PlatformName enum will be removed from .NET soon.
2021-11-15 08:06:36 +01:00
Rolf Bjarne Kvinge 7a76bbeb64
[tools] HomeKit was added to Mac Catalyst in 14.0, so mark it as such. (#13333)
* [tools] HomeKit was added to Mac Catalyst in 14.0, so mark it as such.

Fixes this launch crash when executing on macOS 10.15:

    dyld: Library not loaded: /System/iOSSupport/System/Library/Frameworks/HomeKit.framework/Versions/A/HomeKit
      Referenced from: /Users/runner/work/1/s/artifacts/mac-test-package/tests/./linker/ios/dont link/dotnet/MacCatalyst/bin/Debug/net6.0-maccatalyst/maccatalyst-x64/dont link.app/Contents/MacOS/dont link
      Reason: image not found

* [introspection] Skip the default SKView constructor on all platforms, not only macOS.

Fixes a crash on Mac Catalyst.

* Fix SKView skipping logic.
2021-11-15 08:04:56 +01:00
Rolf Bjarne Kvinge a1768573e3
[introspection] Remove a few version checks which are now constant values. (#13348)
* Mac.Is32BitMavericks is always false (we only run on 64-bit macOS), so remove corresponding code.
* Mac.IsElCapitanOrHigher is never used; remove
* Remove a few unused Mac.Version_* fields.
2021-11-15 07:57:39 +01:00
Rolf Bjarne Kvinge a2e2fef0c2
[introspection] Fix macOS 10.15 version checks. (#13315)
The logic seems to want to verify MPSPredicate on maOS 10.14, but not on macOS
10.15+. But checking for macOS 10.14 is always successful on macOS 10.15+,
which means that we can't check for macOS 10.14 before checking macOS 10.15.
So I moved the macOS 10.14 check to after the macOS 10.15 check, but that made
the macOS 10.14 check redundant, because both branches of the condition did
the same thing, so I removed the whole check.

Fixes this introspectionf failure:

    [FAIL] DefaultCtorAllowed :   1 potential errors found in 1387 default ctor validated:
        Default constructor not allowed for MetalPerformanceShaders.MPSPredicate : Could not initialize an instance of the type 'MetalPerformanceShaders.MPSPredicate': the native 'init' method returned nil.
2021-11-11 16:07:51 +01:00
Rolf Bjarne Kvinge 1713d7dd6a
[WatchKit] Remove the WatchKit framework from iOS in .NET. (#13299)
Apple removed it from iOS a few years ago.
2021-11-08 16:17:26 +01:00
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