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

5184 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 0c50905fc5
[tests] Fix boolean logic when checking for macOS version between 11.0 and 12.0 (#13446) 2021-11-25 22:35:24 +01:00
Rolf Bjarne Kvinge f52f763fa7 [xtro] Remove support for legacy Mac Catalyst. 2021-11-25 11:48:38 +01:00
Rolf Bjarne Kvinge df4399bbde
[CGImageSource] Change CreateThumbnail to return null if the thumbnail creation fails. (#13443)
Otherwise we'll create a CGImage with a zero Handle, which is usually not the
right thing to do. Still, keep the old behavior for legacy Xamarin for the
sake of backwards compat.
2021-11-25 07:36:24 +01:00
Rolf Bjarne Kvinge f916702568 [xharness] Don't run both legacy and .NET xtro at the same time. 2021-11-25 00:20:22 +01:00
Rolf Bjarne Kvinge 9cba70d183 [xtro] Update annotations. 2021-11-24 17:05:35 +01:00
Rolf Bjarne Kvinge 25b41c7ac3 [xtro] Fix dependencies for the .NET report. 2021-11-24 16:55:13 +01:00
Rolf Bjarne Kvinge 4445606653 [xtro] Run u2todo on the .NET annotations to update annotations according to current API. 2021-11-24 15:39:04 +01:00
Rolf Bjarne Kvinge 0cb2591e1a [xtro] Run autosanitize on the .NET annotations to update annotations according to current API. 2021-11-24 15:39:04 +01:00
Rolf Bjarne Kvinge 70333367a0 [xtro] Adjust the .NET annotations for nfloat and NSWritingDirection move. 2021-11-24 15:39:04 +01:00
Rolf Bjarne Kvinge aac316efbb [xtro] Add .NET annotations. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 14c7909317 [xtro] Have a different map between native and managed enums for .NET and legacy Xamarin.
We've fixed a few managed enum names to match the native counterpart in .NET, which
means we need a different map too.
2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge fc39a0df5b [xtro-sharpie] Detect UnsupportedOSPlatform attributes as a deprecation attribute. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge fa55aab0b2 [xtro] Point to the actual .ignore file location when reporting ?unknown-entry?
This makes the output clearer when we have ignore files in multiple directories.
2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 7e255ddcb5 [xharness] Add support for running xtro in .NET mode. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 234f593511 [xtro] Run on .NET assemblies. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 87c4fb0669 [xtro-report] Honor the input directory in a few places. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 4baa67a07d
[xtro] Improve makefile. (#13424)
* Use proper dependency tracking, so that we'll only rebuild what needs to be rebuilt
  when rebuilding. This required using a few stamp files. It also improves parallel
  builds.
* Remove *.raw files before running xtro-sharpie, and only for the current platform.
  This makes sure rebuilds of just some of the platforms work correctly (because
  the *.raw files for other platforms are still around when needed).
* Build the u2todo project file instead of manually calling csc.
2021-11-24 15:38:10 +01:00
Rolf Bjarne Kvinge 03b352036a
[LocalAuthentication] Adjust code for .NET and fix availability of LAContext.MaxBiometryFailures (#13425)
* LAContext.MaxBiometryFailures is available in macOS, just deprecated, so mark
  it as such.
* Remove deprecated code from .NET.
* Update xtro definitions.
2021-11-24 15:37:56 +01:00
Rolf Bjarne Kvinge 98d7c95020
[MediaPlayer] Remove deprecated/removed API in .NET (#13427)
* [MediaPlayer] Remove deprecated/removed API in .NET

* [tests] Fix monotouch-test according to API changes.
2021-11-24 15:37:23 +01:00
Rolf Bjarne Kvinge 84c147a1db
[tests] Give up on LinkSdkRegressionTest.SpecialFolder on macOS and Mac Catalyst for the Favorites and Fonts folders (#13429)
* [tests] Try to fix LinkSdkRegressionTest.SpecialFolder on macOS 10.15.

* I give up.
2021-11-24 15:37:02 +01:00
Rolf Bjarne Kvinge 2901f7aba6
[tests] Adjust FontTest to cope with broken GameKit/UIKit/fontWithSize on certain macOS versions. (#13428)
Fixes:

    MonoTouchFixtures.UIKit.FontTest
        CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
        CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
            [FAIL] NullFonts :   WithSize
            Expected: not null
            But was:  null
                at MonoTouchFixtures.UIKit.FontTest.NullFonts() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/UIKit/FontTest.cs:line 165
2021-11-24 08:07:30 +01:00
Rolf Bjarne Kvinge ff345ba4eb
[xtro-sanity] Pass the included platforms as command line arguments. (#13420)
This avoids the need to compute them, and makes it possible to have multiple sets
of platforms.
2021-11-22 23:24:25 +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 b55ee6d521
[xtro] Improve enum check. (#13396)
* Unify the signed and unsigned implementations. We lose some type-safety (because
  we have to use 'object' as the unifying type between long and ulong), but we minimize
  code duplication, so the code becomes easier to maintain.
* Add an additional check for managed enum values that show up in the native header,
  but aren't available on the current platform.
2021-11-22 18:51:12 +01:00
Rolf Bjarne Kvinge 6302878ad5
[runtime] Implement storing the original working directory for later retrieval for .NET. Fixes #13392. (#13403)
This also adds the Runtime.OriginalWorkingDirectory to all platforms.

Fixes https://github.com/xamarin/xamarin-macios/issues/13392.
2021-11-22 18:50:28 +01:00
Rolf Bjarne Kvinge 3c5dfab710
[xtro-sharpie] Add support for specifying the output directory. (#13408)
This makes it possible to have a different output directory for .NET assemblies.
2021-11-22 18:50:17 +01:00
Rolf Bjarne Kvinge 88eb5e1ac8
Rename any *OSX_SDK_VERSION variables to *MACOS_SDK_VERSION. (#13411)
This makes it easier to iterate over all the *_SDK_VERSION variables in
template code, because they're all named using the standard platform names we
use elsewhere.
2021-11-22 18:48:05 +01:00
Rolf Bjarne Kvinge f8305e213f
Bump xharness. (#13406)
To get this fix: 769755cc98
2021-11-22 11:25:51 -05:00
Rolf Bjarne Kvinge 7fb12bc441
[tests] Disable signing in the Xamarin.MTouch.BindingLibraryDSymCreated test. Fixes #13404. (#13405)
The test builds an app that wants to be signed - but that requires signing
certificates. Instead just change the test to not require signing.

Fixes https://github.com/xamarin/xamarin-macios/issues/13404.
2021-11-22 14:18:00 +01:00
Rolf Bjarne Kvinge 8c942aac1c
[xtro-report] Report the html file we created. (#13409) 2021-11-22 08:06:01 +01:00
Rolf Bjarne Kvinge ec045766ca
[AVFoundation] Remove the AVMediaType enum and the AVMediaTypes.TimedMetadata field from .NET. (#13368) 2021-11-19 08:53:51 +01:00
Rolf Bjarne Kvinge eaef8d4da6
[xtro] Fix typo in comment. (#13384) 2021-11-19 08:51:22 +01:00
Rolf Bjarne Kvinge b99f0a7798
[xtro] Rename 'XMAC*'/'XCAT*/ to 'XMACOS*'/'XMACCATALYST*' to follow the OS naming pattern. (#13391)
This makes it easier to use templated code.
2021-11-19 08:13:43 +01:00
Rolf Bjarne Kvinge d1b5507111
[xtro] Skip numerous validations for deprecated API. (#13383)
There are numerous checks that don't make much sense to report for deprecated
API, so skip those. This also required updating a few .ignore and .todo files.
2021-11-18 16:26:30 +01:00
Rolf Bjarne Kvinge 7d7bc8d25d
[tests] Don't run SCNViewTests on a VM. (#13388)
Hopefully fixes this crash:

    0x7fff6fbad5fd - /usr/lib/system/libsystem_platform.dylib : _sigtramp
    0x354861360 - Unknown
    0x7fff71fb9707 - /System/iOSSupport/System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit : C3DEngineContextSetRenderContext
    0x7fff720802c0 - /System/iOSSupport/System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit : -[SCNRenderer _initWithOptions:isPrivateRenderer:privateRendererOwner:clearsOnDraw:context:renderingAPI:]
    0x7fff72126352 - /System/iOSSupport/System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit : -[SCNView _commonInit:]
    0x7fff72126551 - /System/iOSSupport/System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit : -[SCNView initWithFrame:options:]
2021-11-18 15:38:46 +01:00
Rolf Bjarne Kvinge 118bcc148d
[tests] Remove a few unused make variables. (#13375) 2021-11-17 08:05:26 +01:00
Rolf Bjarne Kvinge e08cbbb8a9
[tests] Add the compiler response files from src/ to the .NET test builds. (#13351)
This means that the HAS_<FRAMEWORK> defines will now work in .NET test code
(as it already does in legacy test code).
2021-11-17 08:01:31 +01:00
Rolf Bjarne Kvinge bbb7632e24
[tests] Automatically run/exit tests executed from the command line. (#13360)
This is already the default for macOS apps, but this way it behaves the same
for Mac Catalyst as well.
2021-11-16 18:01:41 +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 769482018c
[tests] Create a binlog for the mtouch tests (#13357) 2021-11-16 14:20:31 +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 ac6f75b55a
[EmbeddedResources] Add helper makefiles for .NET testing. (#13349) 2021-11-12 16:26:42 +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 06295499ed
[mtouch/mmp/dotnet-bundler] Rework getting the availability attributes so that it works for .NET as well. (#13327)
* Stop using AvailabilityBaseAttribute, this type will disappear in .NET.
* Handle System.Runtime.Versioning.SupportedOSPlatformAttribute instead of our own availability attributes for .NET.
* Add tests (somewhat hacked together, but they work).
2021-11-10 22:55:12 +01:00
Rolf Bjarne Kvinge a8bf64b053
[CoreServices] Fix FSEventStream to properly pass the managed context to the FSEventStreamCreate method. Fixes #13325. (#13329)
The FSEventStreamCreate method takes a pointer to a structure with context information,
which contains a user-defined pointer value in addition to a few callbacks. Previously
we were passing the GCHandle as a pointer to this structure, which is obviously quite
wrong (as evidenced by a native crash when calling FSEventStreamCreate).

Changes:

* Modify the code to provide the expected context structure instead with the GCHandle
  as a field in that structure.
* Add a release callback to the context structure to release the GCHandle.
    * This avoids the need for storing the GCHandle as a field in the FSEventStream instance.
    * It also avoids also the need for overriding Dispose to release said GCHandle.
* Modify the callback code to use the [UnmanagedCallersOnly] attribute for .NET
  (ref: #10470).

This was a regression introduced in 8c99bdc9ad.

Fixes https://github.com/xamarin/xamarin-macios/issues/13325.
2021-11-10 11:13:28 -05:00
Rolf Bjarne Kvinge f4a5bf2720
[SystemSound] Don't implement the INativeObject interface for .NET. (#13324)
The supposed handle for system sounds is an uint, which does not match the
IntPtr handle INativeObject uses, so remove the INativeObject interface from
the SystemSound class.
2021-11-10 11:41:50 +01:00
Rolf Bjarne Kvinge 1f9b80da49
[tests] Fix macOS 10.15+ version check for Mac Catalyst to actually work. (#13317)
Make needs twice the amount of dollars to do the right thing.
2021-11-09 15:59:56 +01:00
Rolf Bjarne Kvinge 4fb86e70e0
[tests] Fix checking for sub-test failures in packaged macOS tests. (#13318)
Any failure stamp files are deleted before the failing target exists, so
checking for failure stamp files at a later point won't work.
2021-11-09 15:59:14 +01:00