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

812 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 63e6d9b4e8
[src] Commit some of the response files. (#17718)
We'll soon build and run tests on Windows, and some tests use these response files,
so it makes building these tests on Windows easier if we don't have to re-create
the response files (our generation logic is all written in make, which is not the
easiest on Windows).
2023-03-07 17:32:27 +01:00
Rolf Bjarne Kvinge 7e05ea54bb Merge main into net8.0. 2023-02-17 14:58:12 +01:00
dustin-wojciechowski 3eeb7691dc
Add ventura to mac tests configurations (#17349)
Added Ventura machines to macTestConfigurations within both the
build-ci-pipeline and the build-pr-pipelines.

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-02-13 11:08:18 -05:00
Rolf Bjarne Kvinge 9f55faeee0 Merge remote-tracking branch 'origin/net8.0' into bump-main-in-net8.0-2023-02-06 2023-02-07 07:18:23 +01:00
Rolf Bjarne Kvinge ca930e3001 [tools/tests] Remove the Compat option for the MonoNative library.
No OS version we currently support require the Compat option, so just remove
it.
2023-02-02 16:30:29 +01:00
Rolf Bjarne Kvinge c54f623141 [tests] Remove 32-bit architectures and logic from project files.
Additionally remove a lot of 64-bit-specific configurations
(Debug64/Release64) as well, and just make the default configurations
(Debug/Release) be 64-bit.
2023-02-02 16:30:29 +01:00
Rolf Bjarne Kvinge 94a3903df7 [tests] Bump min OS versions in all tests. 2023-02-02 16:30:28 +01:00
Rolf Bjarne Kvinge 882db3657d
[tests] Remove workaround for issue #14802. (#17421)
Seems like this is fixed now.
2023-02-02 07:30:16 +01:00
Rolf Bjarne Kvinge 98819287cc
[runtime/generator] Add support for BindAs with CMVideoDimensions. (#17308)
This is required for some new iOS 16 APIs.
2023-01-25 15:34:28 +01:00
Rolf Bjarne Kvinge 4453d773ce
[tests] Unify code related to how to load test assemblies. (#17111)
Unify a lot of code related to how to load test assemblies.

This resulted in adding a couple of test assemblies to monotouch-test when executed on macOS (this was a bug), and this also required adapting some of those tests to work correctly on macOS.
2023-01-13 22:20:47 +01:00
Rolf Bjarne Kvinge 83b0727967
[tests] Port and improve the availability attribute test from introspection. (#17083)
Port the availability attribute test from introspection to cecil-tests. It's much
easier and faster to test attributes using Cecil using a desktop executable than
having to execute a test app on each target platform.

This also means that we can make the ApiAvailabilityTest in introspection
legacy-only.

Ref: https://github.com/xamarin/xamarin-macios/issues/10834
2022-12-20 12:46:06 +01:00
Rolf Bjarne Kvinge dc37be300e
Remove bitcode-related code, since bitcode is dead. (#16986) 2022-12-12 15:25:37 +01:00
Rolf Bjarne Kvinge 1c80823582
[autoformat] Add all of tests/. (#16857) 2022-12-05 08:23:34 +01:00
Rolf Bjarne Kvinge d627b203eb
[tests] Create a shared AppDelegate class and use it everywhere. (#16877)
Create a shared AppDelegate class, which contains all the identical
AppDelegate code for all test projects. This reduces a lot of code duplication.
2022-11-28 18:17:49 +01:00
Rolf Bjarne Kvinge 78229568e7
[autoformat] Add introspection. (#16593) 2022-11-07 15:20:26 +01:00
Rolf Bjarne Kvinge c708c71c3b Merge remote-tracking branch 'origin/xcode14.1' into bump-xcode14.1-in-net7.0-xcode14.1-2022-10-24 2022-10-28 09:50:14 +02:00
Manuel de la Pena e315f09ea8
[MacOS] Fix all the issues we found running the tests on Ventura. (#16488) 2022-10-27 20:42:35 -04:00
Alex Soto ac3ef8c348
[xcode14.1][HomeKit] Brings back HMAccessorySetupManager (#16439)
Fixes xamarin/xamarin-macios#16415

HMAccessorySetupManager was removed by mistake when we had to remove
matter related objects due to submission tests.

We have kept the Matter APIs removed and just enabled
PerformAccessorySetup Submission tests are happy using Xcode 14.1 RC1
https://gist.github.com/dalexsoto/243b0da224c613e9afc9706c54f882a1
2022-10-25 15:31:44 -04:00
Rolf Bjarne Kvinge 24f1fc18ed Merge remote-tracking branch 'origin/xcode14.1' into net7.0-xcode14.1 2022-10-20 19:30:22 +02:00
Rolf Bjarne Kvinge a15b2e0fe0
Bump min watchOS simulator version. (#16317) 2022-10-17 17:57:47 +02:00
Israel Soto 48293a4b05
[HomeKit] Added support to Xcode 14.1 b1-b3 (#16069)
* Matter properties are still missing

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-10-13 11:35:09 -04:00
Israel Soto bac36c5040
[VideoToolbox] Added support for Xcode 14 b1-3 (#15845)
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-10-13 11:27:15 -04:00
Israel Soto 17f0ffd332
[SharedWithYouCore] Added support for Xcode 14.1 b3 (#16198)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-10-12 12:09:00 -04:00
Chris Hamons 83ed66e7d6
[generator] Use new ObsoletedOSPlatformAttribute for generated code (#15941)
- Part of https://github.com/xamarin/xamarin-macios/issues/15849
- A bit of dead code was removed while I was reviewing things.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-10-06 11:15:51 -05:00
Alex Soto 27e6958b0a
[xcode14.1] Bump to Xcode 14.1 Beta 3 (#16010)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-10-03 17:24:41 +02:00
Chris Hamons 8a07db61bb
[main] Fix selectors from submission tests (#16042)
These selectors failed the most recent submission test:

```
UIFocusDebugger
  checkFocusGroupTreeForEnvironment:

HMMatterRequestHandler
  configureAccessoryWithName:room:completion:
  fetchRoomsInHome:completion:
  pairAccessoryInHome:onboardingPayload:completion:
HMMatterTopology
  initWithHomes:
HMMatterHome/HMMatterRoom
  initWithUUID:name:
HMAccessorySetupManager
  performMatterEcosystemAccessorySetupUsingRequest:topology:completionHandler:

ChipDeviceController
  pairDevice:address:port:discriminator:setupPINCode:error:
  setListenPort:
  sharedController
ChipLowPower
  sleep:
ChipTestCluster
  test:
  toggle:
ChipGeneralCommissioning
  commissioningComplete:
```

Passed API diff locally.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-09-27 08:42:53 +02:00
Chris Hamons 865e481498
[xcode14.1] Fix selectors from submission tests (#16047)
Manual backport of https://github.com/xamarin/xamarin-macios/pull/16042 to xcode14.1

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-09-26 11:14:37 +02:00
Rolf Bjarne Kvinge b230ef3601 Merge remote-tracking branch 'origin/main' into bump-main-in-xcode14.1-2022-09-16 2022-09-19 14:11:45 +02:00
Rolf Bjarne Kvinge 4643e42b7d
[tests] Introspection does not use simlauncher64-sgen.framework in .NET. (#15966) 2022-09-16 18:37:34 +02:00
Manuel de la Pena ae42d556fe
[ShareWithYou] Add support for Xcode 14 beta 6. (#15819)
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-09-02 10:46:52 -04:00
TJ Lambert 7bd98383e1
[HealthKit] Update bindings for Xcode 14 beta 1-4 (#15612)
This one has been a toughy 😮‍💨
@mandel-macaque I am creating the draft PR and here is a gist with the MacModern failures that you mentioned you would take a closer look at: https://gist.github.com/tj-devel709/24f5c63d4b698a0e2387524a0d2666c6

There were also monotouch-test failures that seem to be related to enabling mac that I could use some help with as well.

Lastly, @chamons there was a failing Cecil test regarding ios in DidGenerateEvent method found here: https://gist.github.com/tj-devel709/2c8aee7325c0c2751e29269d3eb77fef. I did not touch this method so I am not sure why this would be a problem.
Here is the Cecil failure: https://gist.github.com/tj-devel709/cfb2576c75de2ee100a8f2b7ee6e3923

Thanks for the help!

Edit *: Issues mentioned in the code comments
https://github.com/xamarin/maccore/issues/2609
https://github.com/xamarin/maccore/issues/2610

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-09-01 10:24:35 -05:00
Chris Hamons 532ad02c6b
[AppKit] Xcode 14 Beta 1-5 (#15778)
Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-08-31 15:08:57 -05:00
Manuel de la Pena 8cecb962a4
[UIKit] Add support for Xcode 14 up to beta 5. (#15694)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-08-26 20:14:11 -04:00
Manuel de la Pena e95ae331e3
[Mediaplayer] Add support for xcode14 beta 4. (#15654)
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-08-26 10:38:21 -04:00
Manuel de la Pena 52cb5066f4
[VideoSubscriberAccount] Update API to support Xcode 14 beta 5. (#15699)
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-08-25 09:59:38 -04:00
TJ Lambert b6ece9e175
[PassKit] Update bindings for Xcode 14 beta 1-5 (#15613)
* Starting Xcode14 changes for PassKit Beta 123

* use protocol correctly, ignore conformance

* make suggested changes

* add the abstract to the ignore files

* removing disabledefaultctor

* remove empty todo files

* use manual file for same type constructors and beta changes

* adjust apiselector test

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-08-12 15:17:55 -05:00
Manuel de la Pena 3962f6cb34
[SharedWithYouCore] Add new framework for xcode14. (#15634) 2022-08-08 19:41:32 -04:00
Manuel de la Pena d02dd49235
[PushToTalk] Add new framework for Xcode 14 bet4. (#15645)
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-08-07 14:07:21 -04:00
Manuel de la Pena 7749b91153
[DeviceCheck] Add support for Xcode 14 beta 4. (#15639) 2022-08-05 11:51:11 -04:00
Chris Hamons 3c359f5838
[foundation] Xcode 13 & Xcode 14 beta 1-3 bindings (#15579)
- Xcode 13 section Based upon https://github.com/xamarin/xamarin-macios/pull/13328- 
- Some disabled due to https://github.com/xamarin/maccore/issues/2608
2022-08-01 10:22:39 -05:00
Chris Hamons 4276c90260
[xcode14] Bump to beta 4 (#15584)
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-07-29 12:34:27 -05:00
Chris Hamons ca8e5cb068
[tests] Fix MonoNativeFunctionWrapper/MonoPInvokeCallback to report specific errors (#15572)
- Both tests directly asserted there were no errors, and tried to print results from an unused 'failed_api' variable.
- However, details were being written via `ReportError` in the base class's 'error_output' that was not being printed
- AssertIfErrors on the base class prints that, and asserts that there are no errors so it works for both these cases

I checked the other tests that asserted against 0 errors, and they all seems to have valid test data to report, and thus appear fine.
2022-07-26 09:56:55 -05:00
Manuel de la Pena c5bd8bd4b1
[ClockKit] Add support for Xcode 14 beta 1 & 2. (#15417)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-07-15 11:24:07 -04:00
Rolf Bjarne Kvinge 330ddae9ba [introspection] A few fixes for watchOS. 2022-06-29 13:30:53 +02:00
Manuel de la Pena 754bfe53a5 Fix all intro issues + xtro. 2022-06-28 13:06:26 -04:00
Manuel de la Pena 9bb446eda8 Fix most but not all intro. 2022-06-27 10:01:29 -04:00
Rolf Bjarne Kvinge a358b493fd Merge remote-tracking branch 'origin/xcode14' into HEAD 2022-06-21 16:12:26 +02:00
Rolf Bjarne Kvinge d5e8656b53
[introspection] Fix protocol checks on iOS and tvOS 12.4. (#15265) 2022-06-15 12:18:04 +02:00
Rolf Bjarne Kvinge be6b818ecf Merge remote-tracking branch 'origin/xcode14' into xcode14-initial-pr 2022-06-13 10:17:06 +02:00
Rolf Bjarne Kvinge 0fa87fef48
[introspection] Fix according to macOS 12.4. Fixes #15229. (#15230)
* Ignore anything Chip-related, the framework was removed from macOS.
* Fix reporting errors some protocol-related errors so that they're actually
  reported as errors (by calling 'ReportError' instead of just adding the
  errors to a list that doesn't affect anything else).
* Ignore the NSUserActivityRestoring protocol, according to the macOS headers
  it's attached to NSResponder using a category, which is invisible at
  runtime. Due to the previous point this didn't show up before, but once at
  least another error (which happened with the Chip framework), then this was
  listed as well.
* Add ignores for a couple of protocols.

Fixes https://github.com/xamarin/xamarin-macios/issues/15229.
2022-06-13 09:55:24 +02:00
Rolf Bjarne Kvinge 89eb1bbd9d [introspection] Skip checking IOSurface ctor in Xcode 14, it crashes. 2022-06-08 18:42:08 +02:00
Rolf Bjarne Kvinge 30e03ffbe4
[tests] We're not implementing Mac Catalyst for legacy Xamarin.iOS. (#15181)
So there's no need to ignore tests for that particular scenario.
2022-06-03 10:40:52 +02:00
Frank A. Krueger bd4fee0cdc
Add MetalPerformanceShadersGraph Bindings (#14303)
I'm very pleased to present full bindings to the MetalPerformanceShadersGraph framework!

I'm happy with how everything turned out with the exception of a few notes and questions below.

I re-implemented Apple's MNIST sample (from https://developer.apple.com/documentation/metalperformanceshadersgraph/training_a_neural_network_using_mps_graph) here:

https://gist.github.com/praeclarum/b8077771fb341a1f9c28240113e00425

It's also added as a unit test.

Fixes #14286

### Notes

* Although the API says it works on macOS 11, it has bugs and crashes with errors even with Apple’s Swift examples. It’s better on macOS 12. iOS 14 and on is fine.

* `MPSGraphSparseStorageType` has terrible names. They match Apple's but I wish they were better.

* I added convenience methods to `MPSNDArray` and `MPSGrapTensorData` and the `Variable` and `Constant` operations to decrease the amount of unsafe code users have to write. I currently do this for 32-bit floats, the most common data type.

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-05-10 10:52:22 +02:00
Chris Hamons 7d3fd33b2a
[introspection] Fix failures on older iOS/tvOS (#14911)
- Fixes https://github.com/xamarin/xamarin-macios/issues/14905 by skipping with a link to https://github.com/xamarin/xamarin-macios/issues/14802
2022-05-06 08:51:55 +02:00
Chris Hamons 1dcefc9c56
[NET Attribute Conversion][generator] Generate NET style attributes (#14779)
This PR teaches our code generator to generate .NET 6 style availability attributes, adds a 4th Cecil test to verify our generated attributes, and a metric ton of API changes to satisfy that test.

The generator work is the core of this PR, and includes:

- Hacking out chunks of generator.cs that "helpfully" remove duplicate attributes, which are no longer duplicate in the new order that NET6 attributes force upon us. See changes in FilterMinimumVersion and PrintPlatformAttributes
- Prevent a crash when the generator processes availability attributes with no version included (example: introduced on iOS but no version). See Is64BitiOSOnly.
- The meat, GetPlatformAttributesToPrint, which synthesizes many attributes "out of thing air" from:
        - The parent context
        - Implied introduced just because the class exists on a given framework at all
        - Implied Catalyst because iOS exists
- A few cludgy hacks PrintPlatformAttributesNoDuplicates and GenerateProperty because the existing PrintPlatformAttributes did not pass down parent context down, and the refactor was dangerous/too time consuming given time pressure.

There are two intended API changes introduced by the reviews in this PR:

- GetCurrentInputDevice was obviously intended by availability attributes to exist on Catalyst but due to define confusion was excluded. It is an addition in Microsoft.MacCatalyst.dll only.
- The NEAppRule constructors were mis-marked on platforms, and were showing up incorrectly on Mac/Catalyst. I corrected the Catalyst one unconditionally, as we have not shipped Catalyst yet, but Mac is only fixed in NET6.

There is a lot of follow up work in https://github.com/xamarin/xamarin-macios/issues/14802 to do to remove a number of hard coded test failures, but this should be almost all of the remaining work in NET6 attributes.

🤞 this doesn't break too much for future us.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-05-02 09:44:25 -05:00
Chris Hamons cf77b790cb
[NET Attribute Conversion] Add missing attributes in code-behind by re-running conversion (#14660)
* [NET Attribute Conversion] Chip Framework
* [NET Attribute Conversion] Rerun with many fixes
* Fix generator crash when compiling attributes with no introduced version
* Test changes for availability re-run. One new test
2022-04-07 10:46:15 -05:00
Rolf Bjarne Kvinge a46afd0147
[tests] Use 'BundledNETCoreAppTargetFrameworkVersion' to specify the .NET version in the project files. (#14666)
This way we don't have to update all these files when moving to .NET 7.
2022-04-06 20:58:20 +02:00
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