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

5685 Коммитов

Автор SHA1 Сообщение Дата
Alex Soto c7dc47ed59 [ScreenCaptureKit] Add new Framework to todo 2022-03-14 22:54:34 -04:00
Alex Soto 60f012c328 [ReplayKit] Update bindings up to Xcode 13.3 Beta 3 2022-03-14 22:54:34 -04:00
Alex Soto edc55e0283 [ProximityReader] Ignoring this framework nothing useful to bind 2022-03-14 22:54:34 -04:00
Alex Soto 31970e83c8 [Network] Add Framework to todo 2022-03-14 22:54:34 -04:00
Alex Soto e24151b438 [MetalPerformanceShadersGraph] Add Framework to todo
We can update it once https://github.com/xamarin/xamarin-macios/pull/14303 lands
2022-03-14 22:54:34 -04:00
Alex Soto 5ca983925d [MediaSetup] Add MacCat framework to the todo list 2022-03-14 22:54:34 -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 cf0cabbf64 [CoreMotion] Update bindings up to Xcode 13.3 Beta 3 2022-03-14 22:54:34 -04:00
Alex Soto f1257d8095 [CoreMediaIO] Add new macOS framework to todo 2022-03-14 22:54:34 -04:00
Alex Soto 858c60474e [CellularDataDiagnosticsSuite] Wait to bind this new one until GA 2022-03-14 22:54:33 -04:00
Alex Soto 03bdc33103 [CarPlay] Update bindings up to Xcode 13.3 Beta 3 2022-03-14 22:54:33 -04:00
Alex Soto 7efe7bee2d [AppKit] Update xtro annotations of unbound API 2022-03-14 22:54:33 -04:00
Alex Soto d8fac167a7 [Accessibility] Update bindings up to Xcode 13.3 Beta 3 2022-03-14 22:54:33 -04:00
Alex Soto 0b0ad6f904 [tests] Fix introspection tests for Xcode 13.3 2022-03-14 22:54:33 -04:00
Alex Soto 019ec18bc6 [xtro] Fix xtro annotations
Ignoring CHIP framework for now since it is not stable just yet
and we want to avoid breaking changes in the future.
2022-03-14 22:54:33 -04:00
Alex Soto 35e2e45e98 [Xcode 13.3] Initial commit to Xcode 13.3 release 2022-03-14 22:54:33 -04:00
Rolf Bjarne Kvinge 174aca5b04
[tests] Simplify some logic in mmptest and msbuild tests. (#14400)
Use already existing logic in the Configuration class to find files on disk.

Also remove some dead code and use Path.Combine instead of string
concatenation to compute paths.

Fixes https://github.com/xamarin/maccore/issues/2553.
2022-03-14 20:43:49 +01:00
Alex Soto c055c10917
[generator] Avoid NRE when using native enums on delegates (#14396)
Fixes NRE in GetNativeEnumToManagedExpression when a native enum
with MaxValue is used on delegates.
2022-03-14 11:56:34 -04:00
Rolf Bjarne Kvinge aa4f94bb05
[xharness] Don't test documentation, it's broken. (#14373)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-11 18:44:37 -05:00
Rolf Bjarne Kvinge 9c4c3213e1
[registrar] Fix comparing full token references. Fixes #11641. (#14313)
The static registrar usually stores a compressed version of metadata tokens in
the generated code. However, when there are many assemblies in the app (>127),
we can't use the compressed version anymore, and fall back to a full version.

In this case, we weren't comparing type metadata tokens correctly when looking
for a type in our table of types, and thus we weren't finding the type we were
looking for.

The result is an exception like this:

> Can’t register the class MyClass when the dynamic registrar has been linked away.

In the generated table of types we're storing the full metadata token, which
includes a few bits indicating which type of token it is (in this particular
case a TypeDef token). When going through the table looking for a type, we
need to compare with those few bits set on the input type token as well to
find what we're looking for.

Also make it possible to use the remove-dynamic-registrar optimization on
macOS (which is useful by itself, but it also makes adding a test case
easier).

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1476585.
Fixes https://github.com/xamarin/xamarin-macios/issues/11641.
2022-03-11 07:30:01 +01:00
Rolf Bjarne Kvinge 84b1a87bd6
[msbuild] Improve the Strip task. (#14342)
* Enable nullability and fix code accordingly.
* Augment it to be able to take multiple files to strip at the same time.
* Strip in parallel.
* Execute using xcrun (ref: #3931)
* Pass the full path to the executable file to strip, to make command lines
  easier to copy-paste.
* Remove test that is now outdated. We have other tests that run strip
  anyways, so this shouldn't be a problem.
2022-03-11 07:28:00 +01:00
Manuel de la Pena e07b7bef79
[CI] Move tests outside of the build machine. (#14105)
Move the execution of tests to a diff bot to be compliant with the latests EO.
2022-03-10 23:36:37 -05:00
Aaron Bockover 23c8620af0
FSEventStream: bind FSEventStreamCreateRelativeToDevice, FSEventStreamGetDeviceBeingWatched (#14357)
Introduce `FSEventStreamCreateOptions` to avoid a slew of .ctor overrides, and make it easier to specify `DeviceToWatch` and `SinceWhenId`. `SinceWhenId` was previously only exposed on the "low level" .ctor, and it's a rather important parameter for supporting events that may have happened while the application was not running.

Make the existing constructors wrap `FSEventStreamCreateOptions` to avoid API break.

This is a followup to #14318. When using device-relative watches, files can be tracked via a tuple of their device ID and inode instead of paths. #14318 exposes inode data on `FSEvent`.
2022-03-10 21:30:57 +01:00
Aaron Bockover 9fe2a5c28c
FSEventStream: fix crash when asking for extended data; support dispatch queues (#12007) (#14318)
Implements support for `FSEventStreamCreateFlags.UseExtendedData`, fixing #12007.

When `.UseExtendedData` is specified, the event data type changes from `CFString` to `CFDictionary`; the dictionary contains the path (`path` key) and inode (`fileID` key) information for the file and may be extended in the future with other fields. Previously this was crashing because we assumed `CFString` always.

Further add a convenience constructor for monitoring a single path, add the missing `UnscheduleFromRunLoop` APIs, and add `SetDispatchQueue` to allow using dispatch queues directly instead of run loops.

Finally, this PR adds a fairly exhaustive file system test which covers the existing (non-extended) and fixed (extended) creation modes, along with using a dispatch queue instead of run loop.

Fixes https://github.com/xamarin/xamarin-macios/issues/12007
2022-03-09 19:05:10 +01:00
Přemek Vysoký 93bad76aae
Bump Microsoft.DotNet.XHarness.iOS.Shared to `1.0.0-prerelease.22157.2` (#14350)
I don't expect anything changed since Nov 19th but there might be miniature API changes this week so want to bump now and then after.
2022-03-09 18:32:44 +01:00
Rolf Bjarne Kvinge 1a21e1ee5c
[msbuild] Make the CollectBundleResourcesDependsOn property public. Fixes #11984. (#14330)
Make the CollectBundleResourcesDependsOn property public, so that custom
targets can inject themselves into the build early enough to add additional
BundleResource or Content items (by adding their custom target's name to the
CollectBundleResourcesDependsOn property).

Fixes https://github.com/xamarin/xamarin-macios/issues/11984.
2022-03-09 18:19:48 +01:00
Rolf Bjarne Kvinge c98a6d01cc
[HealthKit] Add this framework to Mac Catalyst. (#14312) 2022-03-09 18:18:48 +01:00
Manuel de la Pena 488a647b49
[Tests] Ignore certain tests that do not longer work on bots. (#14326)
The new tests do not have a display and that makes certain mac tests
fail. Added a new TestRuntime function to let us know if we are on vsts
and ignore accordingly.

fixes https://github.com/xamarin/maccore/issues/2546


Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-03-09 11:24:53 -05:00
Rolf Bjarne Kvinge bb655a3840
[dotnet] Only validate the RuntimeIdentifier if we need/use it. Fixes #13482. (#14339)
Fixes https://github.com/xamarin/xamarin-macios/issues/13482.
2022-03-09 08:22:52 +01:00
Rolf Bjarne Kvinge f248e9f70b
[tests] Add test to verify that the generator can compile C# 10+ code. Fixes #13837. (#14340)
Fixes https://github.com/xamarin/xamarin-macios/issues/13837.
2022-03-09 08:22:16 +01:00
Rolf Bjarne Kvinge 00e1d72377
[tests] Improve a few asserts to show unexpected values instead of just true/false. (#14338) 2022-03-09 08:21:39 +01:00
Rolf Bjarne Kvinge 5103060d72
[tests] Long live Xamarin! (#14336)
And a few other minor updates to test Info.plists.
2022-03-09 08:19:48 +01:00
Rolf Bjarne Kvinge 3a124d3f10
[tests] Don't use reflection to create HttpClient handlers. (#14333)
Fixes two test failures on tvOS with all optimizations enabled:

    MonoTests.System.Net.Http.MessageHandlerTest.DnsFailure
        [FAIL] DnsFailure(System.Net.Http.SocketsHttpHandler) :   Exception
            Expected: instance of <System.Net.Http.HttpRequestException>
            But was:  <System.MissingMethodException: No parameterless constructor defined for type 'System.Net.Http.SocketsHttpHandler'.
                at System.RuntimeType.CreateInstanceMono(Boolean , Boolean )
                at System.RuntimeType.CreateInstanceDefaultCtor(Boolean , Boolean )
                at System.Activator.CreateInstance(Type , Boolean , Boolean )
                at System.Activator.CreateInstance(Type , Boolean )
                at System.Activator.CreateInstance(Type )
                at MonoTests.System.Net.Http.MessageHandlerTest.GetHandler(Type ) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/System.Net.Http/MessageHandlers.cs:line 50
                at MonoTests.System.Net.Http.MessageHandlerTest.<>c__DisplayClass3_0.<<DnsFailure>b__0>d.MoveNext() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/System.Net.Http/MessageHandlers.cs:line 76>

    MonoTests.System.Net.Http.MessageHandlerTest.RejectSslCertificatesServicePointManager
        [FAIL] RejectSslCertificatesServicePointManager(System.Net.Http.SocketsHttpHandler) : System.MissingMethodException : No parameterless constructor defined for type 'System.Net.Http.SocketsHttpHandler'.
            at System.RuntimeType.CreateInstanceMono(Boolean , Boolean )
            at System.RuntimeType.CreateInstanceDefaultCtor(Boolean , Boolean )
            at System.Activator.CreateInstance(Type , Boolean , Boolean )
            at System.Activator.CreateInstance(Type , Boolean )
            at System.Activator.CreateInstance(Type )
            at MonoTests.System.Net.Http.MessageHandlerTest.GetHandler(Type ) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/System.Net.Http/MessageHandlers.cs:line 50
            at MonoTests.System.Net.Http.MessageHandlerTest.RejectSslCertificatesServicePointManager(Type ) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/System.Net.Http/MessageHandlers.cs:line 405
            at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
2022-03-09 08:11:06 +01:00
Rolf Bjarne Kvinge 074a90496f
[tests] Don't try to create an instance of PKPaymentAuthorizationViewController. (#14334)
The default constructor doesn't work (it's already obsolete).

Fixes:

    Xamarin.Mac.Tests.DelegateAndDataSourceTest
        [FAIL] DelegateAndDataSourceAllowsNull : 1 failing types
            1 failing types:
            PassKit.PKPaymentAuthorizationViewController: Could not initialize an instance of the type 'PassKit.PKPaymentAuthorizationViewController': the native 'init' method returned nil.
            It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
                at Xamarin.Mac.Tests.DelegateAndDataSourceTest.DelegateAndDataSourceAllowsNull () [0x0026c] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/DelegateAndDataSourceTest.cs:90
2022-03-09 08:10:21 +01:00
Rolf Bjarne Kvinge 0897150a4f
[VisionKit] Add this framework to Mac Catalyst. (#14316) 2022-03-07 09:30:17 +01:00
Alex Soto 28f905fd75
[CHIP] Remove CHIP framework from dotnet (#14309)
CHIP framework seems to not be stable yet from Apple's side
each xcode update it brings breaking changes and it is also
not documented anywhere so let's disable it for now and
we can re-enable it in the future once it is stable.
2022-03-04 11:59:49 -05:00
Rolf Bjarne Kvinge 2a8e0121d8
[ARKit] Ignore this framework on Mac Catalyst. (#14290)
It exists, but does nothing on Mac Catalyst.

"This framework ignores calls from Mac apps built with Mac Catalyst."

Ref: https://developer.apple.com/documentation/arkit?language=objc

Also augment xtro to not be confused when encountering lines starting with '#'
that has no other text.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-03 21:43:33 +01:00
Rolf Bjarne Kvinge 1011419896
[xtro] Remove old and unused annotations. (#14282) 2022-03-02 15:15:11 +01:00
Curtis Wensley 069d34b454
Set NSImageRep DrawInRect hints as nullable (#13834)
* Set NSImageRep DrawInRect hints as nullable

* Add nullable attributes to NSString DrawAtPoint/DrawInRect/StringSize

* Fix xtro test failure

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-01 20:34:02 +01:00
Rolf Bjarne Kvinge 83c1ee189a
[monotouch-test] Adjust ImageCaptioningTest to work on older versions of macOS for Mac Catalyst. (#14265)
Also improve assert messages a bit to not have multiple asserts with the same message.
2022-03-01 08:36:26 +01:00
Rolf Bjarne Kvinge c51b064ba2
[Message[s|UI]] Add to Mac Catalyst. #13935. (#14268)
Fixes https://github.com/xamarin/xamarin-macios/issues/13935.
2022-02-28 22:37:14 +01:00
Rolf Bjarne Kvinge ddb16120f9
[monotouch-test] Fix UbiquitousKeyValueStoreTest to work on newer versions of macOS. (#14267)
Fixes:

    MonoTouchFixtures.Foundation.NSUbiquitousKeyValueStoreTest
        [FAIL] Indexer :   key 1
            Expected: <value>
            But was:  null
2022-02-28 22:36:05 +01: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 df491ed4b3
[cecil-tests] Improve the obsolete member test. Fixes #13621. (#14258)
* Check implementation assemblies instead of reference assemblies.
* Try to print the source code location for failing API (this required processing
  the implementation assemblies, because the reference assemblies don't have debug
  information where the source code location is stored).
* Don't report API that has [EditorBrowsable (None)] attributes, presumably we
  decided to keep these for compatibility, while highly discouraging their
  continued use. Also stop doing this for the next time we can do a breaking
  change, maybe we can remove these APIs then.
* Don't report API that has [UnsupportedOSPlatform ("...#.#") attributes (with
  a version number), presumably this is API that is still valid for some OS
  versions.
* Enable the test for all APIs (no ignores anymore). It's green!

Fixes https://github.com/xamarin/xamarin-macios/issues/13621.
2022-02-28 11:26:44 +01:00
Rolf Bjarne Kvinge 8f5c8b1685
Bump ObjectiveSharpie to 3.5.50. (#14256)
This also requires updating the xtro definitions, because sharpie now finds
many more Mac Catalyst frameworks than before (and we haven't bound those
frameworks yet).
2022-02-26 01:59:11 +01:00
Rolf Bjarne Kvinge fec9a29756
[tests] Remove ignore for test that has been fixed in .NET. (#14255) 2022-02-26 01:56:12 +01:00
Rolf Bjarne Kvinge b746b04b2d
[xtro] Generate a proj file that contains variables for the current pch and assembly. (#14249)
Generate a proj file that contains variables for the current pch and assembly,
and include this proj file in the main xtro-sharpie project file. This way we
can use these variables for the pch and assembly arguments in the run
configurations, so we don't have to update the project file every time these
change (in particular the pch file changes name with every Xcode bump).
2022-02-25 17:03:01 +01:00
Rolf Bjarne Kvinge af2c68288c
[xtro] Add a makefile target to generate C# code for Mac Catalyst like we do for the other platforms. (#14250) 2022-02-25 17:02:49 +01:00
Rolf Bjarne Kvinge 681b45bd41
[monotouch-test] Fix the BaseEffectTest and EffectPropertyMaterialTest tests. (#14243)
The [Culture ("en")] attribute means: only run this test if the culture is
"en". This usually meant not running this test (apparently we don't run often
with culture = "en"), leading to outdated tests that happened to fail when
actually run under culture = "en" (such as on older macOS bots).

So change these tests to actually change the culture to "en" (by using the
SetCulture attribute), and also fix them.
2022-02-25 09:19:08 +01:00
Rolf Bjarne Kvinge 2a1f24f2cc
[CoreTelephony] Fix multiple issues. Fixes #13931. (#14242)
* Add to Mac Catalyst. Fixes #13931.
* Manually include CoreTelephony headers in xtro. There's no umbrella header
  in CoreTelephony 😡 😞
* Fix availability attributes
	* Only CTCall and CTCallCenter are deprecated in the CoreTelephony API.
	* None of these APIs are obsolete, just deprecated.
	* Add Mac Catalyst attributes.

One curious fact is that the PCSC framework interferes with compiling CTCarrer.h:

    In file included from /private/var/folders/43/h027tm1n101cdrq2_b6n9n2m0000gn/T/n0b0byrt.h:163:
    /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h:62:41: error: reference to 'BOOL' is ambiguous
    @property (nonatomic, readonly, assign) BOOL allowsVOIP __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
                                            ^
    /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/PCSC.framework/Headers/wintypes.h:59:18: note: candidate found by name lookup is 'BOOL'
            typedef int16_t BOOL;
                            ^
    /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/objc/./objc.h:78:18: note: candidate found by name lookup is 'BOOL'
        typedef bool BOOL;
                     ^
    1 error generated.

but since we don't bind the PCSC framework, we can just ask ObjectiveSharpie
to exclude it.

Fixes https://github.com/xamarin/xamarin-macios/issues/13931.
2022-02-24 23:41:52 +01:00
Rolf Bjarne Kvinge 3fb288ff5c
[Foundation] Remove NSUrlSessionHandler.TrustOverride in .NET. (#14214)
It's better to use the TrustOverrideForUrl property instead, which already exists.
2022-02-24 23:08:21 +01:00
Rolf Bjarne Kvinge 2f494665bc
[Network] Remove obsolete API from .NET. (#14211)
All the obsolete API has replacement API that works just fine.
2022-02-24 23:07:53 +01:00
Rolf Bjarne Kvinge b99e75d6ad
[Metal] Name the enum fields consistently, and obsolete/remove the rest. (#14240) 2022-02-24 23:00:26 +01:00
Rolf Bjarne Kvinge d414aa2eb1
[AVFoundation] Remove the AVAssetsDownloadTaskKeys and AVAssetDownloadOptions API in .NET for tvOS. (#14233)
These API were never valid for tvOS, and now we can completely remove them in .NET.
2022-02-24 22:58:01 +01:00
Rolf Bjarne Kvinge 83136c4507
[tests] Fix packaging mac tests by generating valid bash code for test.config. (#14236)
Fixes this failure:

    ++ DOTNET_CSC_COMMAND=/Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/dotnet
    ++ exec /Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/sdk/6.0.300-preview.22118.1/Roslyn/bincore/csc.dll
    test.config: line 22: /Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/sdk/6.0.300-preview.22118.1/Roslyn/bincore/csc.dll: Permission denied
    make[1]: *** [mac-test-package.zip] Error 1
    make: *** [package-tests] Error 2
2022-02-24 22:57:25 +01:00
Rolf Bjarne Kvinge b770d1eae8
[CoreGraphics] Improve matrix types for .NET. Fixes #14125. (#14208)
Hoping that one day we'll have a System.Numerics.Matrix3x3 type we can replace our
RMatrix3 type with:

* Add all API in OpenTK.Matrix3 that also exists in equivalent form in System.Numerics.Matrix4x4.
* Remove all API that doesn't exist in equivalent form in System.Numerics.Matrix4x4.

For NMatrix2 and NMatrix3:

* Change the fields to be M## instead of R#C# (this is how System.Numerics does
  it, and also how we do it in other matrix types).
* Add obsolete and hidden R#C# versions of the fields to ease migrating existing
  code to .NET (but let's try to remove these in xamcore 5).
* Add properties in legacy Xamarin recommending users to use the new naming.
* A few other API additions to add equivalent API to the matrix types in System.Numerics.

For CGAffineMatrix:

* Add obsolete and hidden versions of the legacy field names to .NET to ease
  migrating existing (but let's try to remove these in xamcore 5).

Fixes https://github.com/xamarin/xamarin-macios/issues/14125.
2022-02-24 18:42:19 +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 3b617adb0f
[CloudKit] Remove API that no longer exists in the headers from .NET. (#14228) 2022-02-24 08:20:26 +01:00
Sebastien Pouliot e82711f73e
[corefoundation] Optimize `CFString` creation (#12736)
* Add fast path if string is empty (`length == 0`)
* Add fast path (less allocations) for short string (`stackalloc`)
* Use `Marshal.AllocHGlobal`
	* we were the only consumer of `Marshal.AllocCoTaskMem` and `FreeCoTaskMem` (inside most apps) so those symbols can now be removed
	* `Marshal.AllocCoTaskMem` simply calls `AllocHGlobal` (with some extra casts) so it does not really have any other impact

* Add a few `CFString.FromHandle`` performance tests

To cover cases for

* `nil` which returns `null`
* `128` characters, which is the limit for `stackalloc`
* `129` characters, which is just over the limit for `stackalloc`

**Expectations**

* `empty` should be faster, since it now returns earlier
* `short_*` and `stackalloc_limit` should be a bit faster as they use `stackalloc`
* `allochglobal` and `long_string` should be (nearly) identical

**Before**

|              Method |             name |         Mean |       Error |     StdDev |
|-------------------- |----------------- |-------------:|------------:|-----------:|
| CFString_FromString |     allochglobal |   547.765 ns | 245.5782 ns | 13.4610 ns |
| CFString_FromString |            empty |   377.983 ns |   6.7926 ns |  0.3723 ns |
| CFString_FromString |      long_string | 5,480.664 ns | 264.9473 ns | 14.5227 ns |
| CFString_FromString |              nil |     4.848 ns |   0.0412 ns |  0.0023 ns |
| CFString_FromString |      short_7bits |   442.096 ns |  30.4907 ns |  1.6713 ns |
| CFString_FromString |     short_accent |   221.221 ns |   2.2069 ns |  0.1210 ns |
| CFString_FromString |      short_emoji |   221.870 ns |   2.4471 ns |  0.1341 ns |
| CFString_FromString |    short_unicode |   217.954 ns |   1.8771 ns |  0.1029 ns |
| CFString_FromString | stackalloc_limit |   484.019 ns |   6.3940 ns |  0.3505 ns |


**After**

|              Method |             name |         Mean |       Error |     StdDev |
|-------------------- |----------------- |-------------:|------------:|-----------:|
| CFString_FromString |     allochglobal |   554.028 ns | 317.1811 ns | 17.3858 ns |
| CFString_FromString |            empty |    95.442 ns |   7.6434 ns |  0.4190 ns |
| CFString_FromString |      long_string | 5,468.565 ns | 251.2252 ns | 13.7705 ns |
| CFString_FromString |              nil |     3.299 ns |   0.0229 ns |  0.0013 ns |
| CFString_FromString |      short_7bits |   352.567 ns |  25.7539 ns |  1.4117 ns |
| CFString_FromString |     short_accent |   221.132 ns |   0.9760 ns |  0.0535 ns |
| CFString_FromString |      short_emoji |   222.557 ns |   4.5978 ns |  0.2520 ns |
| CFString_FromString |    short_unicode |   216.375 ns |   5.1619 ns |  0.2829 ns |
| CFString_FromString | stackalloc_limit |   427.663 ns |  77.9610 ns |  4.2733 ns |
2022-02-23 20:49:10 +01:00
Sebastien Pouliot c918142101
[objcruntime] Fix some `IntPtr` -> `NativeHandle` inside `Class` (#14174)
* Using `NativeHandle` avoids implicit casts [1]
* Do not expose `IntPtr` as the type for the `SuperClass` handle

[1] likely not an issue with JIT/AOT optimization, less sure for the
interpreter. No harm in not having those in the product assembly.
2022-02-23 20:45:43 +01:00
Rolf Bjarne Kvinge 4fd770c3c4
[msbuild/generator] Pass .NET's C# compiler to bgen to use. Fixes #12922. (#14192)
We can't execute mono's C# compiler when using .NET, so we need to tell bgen
where csc is in that case.

Fixes https://github.com/xamarin/xamarin-macios/issues/12922.
2022-02-23 09:36:43 +01:00
Rolf Bjarne Kvinge 66dcb94e1f
[AVFoundation] Simplify code behind + api definition for AVCaptureConnection. (#14199)
* Remove the code behind for AVCaptureConnection.SupportsVideoMinFrameDuration
  and AVCaptureConnection.SupportsVideoMaxFrameDuration. The codebehind looks like
  a workaround for Apple renaming the selector, but from history it looks like that
  happened before the earliest version of iOS we support today, so this can be expressed
  in an api definition now without any code behind.
* Add these fields to macOS, where they're not even deprecated (like they are on
  other platforms).
* Remove conditional code in api definition, and distribute [No*] attributes as
  required.
* Remove the AVCaptureConnection.AudioChannels property from .NET, it doesn't do
  anything useful.
2022-02-21 20:58:47 +01:00
Rolf Bjarne Kvinge f83857638d
[tests/msbuild] Use full path to binlogs and executables. (#14195)
This way it's easier to copy-paste the path to the these files from terminal output
and open/run it (with a relative/partial path you'll need to know the current directory,
which is just an annoying thing to figure out sometimes).
2022-02-21 08:02:23 +01:00
Rolf Bjarne Kvinge 2140d46327
[monotouch-test] The RuntimeTest.ResurrectedObjectsDisposedTest test seems to be passing everywhere in .NET now. (#14175) 2022-02-18 16:34:58 +01:00
Sebastien Pouliot e6e4ddbab2
[appcompare] Remove old/local copy of the tool and update comparison documentation (#14190)
There's a newer version of the tool availble as a (tool)
[nuget](https://www.nuget.org/packages/appcompare/)

The nicest part, for this use case, is that it can map renamed files
between the two app bundles being compared.
[Example](https://gist.github.com/spouliot/68a43a4f514315d52b35446016ba0d2e)
2022-02-18 13:04:28 +01:00
Rolf Bjarne Kvinge e25163f573
[.NET] Rename our product assemblies. Fixes #13748. (#13847)
Rename our product assemblies to:

* Microsoft.iOS.dll
* Microsoft.tvOS.dll
* Microsoft.macOS.dll
* Microsoft.MacCatalyst.dll

This makes it easy to distinguish between legacy Xamarin and .NET whenever the
product assembly is mentioned, and I've also chosen the platform part of the
name to match how the platforms are named elsewhere (this also makes it
possible to simplify our build logic, since we can remove a lot of special
casing).

Fixes https://github.com/xamarin/xamarin-macios/issues/13748.
2022-02-16 21:30:32 +01:00
Rolf Bjarne Kvinge 5b8250486f
[dotnet/msbuild] Run install_name_tool to fix the id for dylibs. Fixes #13999. (#14147)
Fixes https://github.com/xamarin/xamarin-macios/issues/13999.
2022-02-16 21:13:40 +01:00
Rolf Bjarne Kvinge a404081365
[dotnet] Add support for the PublishFolderType metadata on Content and BundleResource items. (#14162)
Add support for the PublishFolderType metadata on Content and BundleResource
items, which makes it possible to change the location in the app bundle for
these items (this was possible to do before with the Link metadata), but most
importantly it also makes it possible to choose to *not* bundle these items in
the app bundle (which was not possible before with the Link metadata, nor any
other means).

At first I thought setting CopyToPublishDirectory /
CopyToOutputDirectory=Never would accomplish that, but it turns out we don't
honor those, and since we already have this behavior of ignoring
CopyToPublishDirectory / CopyToOutputDirectory in legacy Xamarin, I didn't
want to change it in .NET.

So I added support for honoring the PublishFolderType metadata instead, which
is new and we already support for other item groups. This is accomplished by
adding all Content and BundleResource items with PublishFolderType set to the
ResolvedFileToPublish item group (where we already handle any
PublishFolderType values), and then we ignore such Content and BundleResource
items in our CollectBundleResources task.

Also update the documentation and add tests.
2022-02-16 20:54:14 +01:00
Rolf Bjarne Kvinge 8060e2f6d3
[tests] Use the correct OS version for Mac Catalyst. (#14143)
This fixes the CheckManagedFilters tests on Mac Catalyst on older macOS versions:

    [FAIL] CheckManagedFilters :   Managed filters not found for CIAreaMinMax, CIAreaMinMaxRed, CIAttributedTextImageGenerator, CIBarcodeGenerator, CIBicubicScaleTransform, CIBlendWithBlueMask, CIBlendWithRedMask, CIBokehBlur, CICameraCalibrationLensCorrection, CIColorCubesMixedWithMask, CIColorCurves, CICoreMLModelFilter, CIDepthBlurEffect, CIDepthToDisparity, CIDisparityToDepth, CIDither, CIDocumentEnhancer, CIEdgePreserveUpsampleFilter, CIGaborGradients, CIGuidedFilter, CIKeystoneCorrectionCombined, CIKeystoneCorrectionHorizontal, CIKeystoneCorrectionVertical, CIKMeans, CILabDeltaE, CIMeshGenerator, CIMix, CIMorphologyGradient, CIMorphologyMaximum, CIMorphologyMinimum, CIMorphologyRectangleMaximum, CIMorphologyRectangleMinimum, CIPaletteCentroid, CIPalettize, CIPerspectiveRotate, CIRoundedRectangleGenerator, CISaliencyMapFilter, CISampleNearest, CITextImageGenerator
      Expected: 0
      But was:  39
2022-02-16 20:11:57 +01:00
Rolf Bjarne Kvinge 2e62431fb1
[nfloat] Obsolete nfloat.CopyArray in legacy Xamarin and stop using it. (#14164)
There's no corresponding System.Runtime.InteropServices.NFloat.CopyArray method in .NET.

It turned out that the API where we used CopyArray don't need to use CopyArray at all, the same can be accomplished faster and simpler by using unsafe code.
2022-02-16 20:10:13 +01:00
Rolf Bjarne Kvinge 404b6e9af5
[msbuild/dotnet] Set NoBindingEmbedding to 'true' by default in .NET. Fixes #12530. (#12694)
Not embedding third-party libraries in the binding assembly is the future, and
let's try to enable it by default starting with .NET.

Fixes https://github.com/xamarin/xamarin-macios/issues/12530.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-02-16 10:30:41 +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
Sebastien Pouliot 37b8a0709c
[objcruntime] Inline the use of the `Class.LookupFullName` method (#14150)
inside it's _only_ caller and remove the API.

Remove old test that was already not useful (since the method could not
be removed anyway for quite a while).
2022-02-16 07:53:21 +01:00
Rolf Bjarne Kvinge 97afd484d2
[ObjCRuntime] Keep accepting IntPtr constructors in .NET as an alternative to NativeHandle constructors. Fixes #14046. (#14145)
As a part of the breaking changes in .NET, we introduced a new type,
`ObjCRuntime.NativeHandle`, to represent native handles.

This meant that constructors taking taking `IntPtr handle`:

```cs
public class MyUIViewController : UIViewController {
    protected MyUIViewController (IntPtr handle)
        : base (handle)
    {
    }
}
```

would have to be ported to take `NativeHandle handle`:

```cs
public class MyUIViewController : UIViewController {
    protected MyUIViewController (NativeHandle handle)
        : base (handle)
    {
    }
}
```

The unfortunate part is that there will be no compiler warnings or errors
flagging this, so users won't know to do it unless they either read the
documentation (🤣) or run into the problem, googles for a while, runs into
someone else who had the same problem, and applies their (probably broken)
fix.

So we change our logic to:

1. Look for and use an `(IntPtr)` (or `(IntPtr, bool)`) constructor in .NET if
   the `NativeHandle` version isn't found.
2. Show a warning.
3. Some time in the future maybe remove this hack/workaround.

Fixes https://github.com/xamarin/xamarin-macios/issues/14046.
2022-02-15 22:48:23 +01:00
Rolf Bjarne Kvinge d58409c018
[AppKit] INSTextInputClient.GetAttributedSubstring can return null. Fixes #14129. (#14131)
Fixes https://github.com/xamarin/xamarin-macios/issues/14129.
2022-02-15 17:44:21 +01:00
Rolf Bjarne Kvinge 31f11e2632
[CoreText] Move numerous CoreText fields to generated code for .NET. (#14132) 2022-02-15 08:24:34 +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
Stephane Delcroix f36606e654
[C] Clear OpenTK namespace (#13767)
fixes #13160

- remove unused types
- use System.Numerics when possible
- move own created types from OpenTK namespace to CoreGraphics
- create missing types in CoreGraphics namespace

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-02-14 18:50:23 +01:00
TJ Lambert 764e797ceb
[NET 6 Attribute Conversion] Security (#14033)
* Removing attributes for mellite

* Remove existing attributes

* Attribute Conversion

* Reverting changes to Security/Enums.cs and Security/SecureTransport.cs since they are API source

* Revert "Removing attributes for mellite"

This reverts commit eea2898870.

* Fixing Verifies, Moving Obsolete, Adding missing conversion

* Adding in removed comments and messages

* Removing unused NET Attributes

* Removing duplicated comments

* Removing not needed availability

* Remove todos

* removing other not needed availability

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-02-14 10:36:33 -06:00
Chris Hamons 39d52ba64f
[tests] Add disabled NET6 availability attribute test (#14106) 2022-02-11 09:11:02 -06:00
Rolf Bjarne Kvinge 5a0c317d06
[tests] Make the Bug2000_NSPersistentStoreCoordinator test use a process-unique test file name. Fixes #xamarin/maccore@2515. (#14119)
Make the Bug2000_NSPersistentStoreCoordinator test use a test file name that
contains the process id, so that multiple test processes at the same time
don't stomp on eachother.

Fixes https://github.com/xamarin/maccore/issues/2515.
2022-02-10 15:25:55 +01:00
Rolf Bjarne Kvinge 808a61a12b
[msbuild] Make sure to set 'ResolveAssemblyConflicts=true' before importing Microsoft.CSharp.targets. Fixes #11691. (#14109)
We must set `ResolveAssemblyConflicts=true` before loading
Microsoft.Common.targets (which is loaded by Microsoft.CSharp.targets),
because otherwise we won'd do any conflict resolution at all, since the
variable isn't 'true' when it needs to be.

Also add test.

Fixes https://github.com/xamarin/xamarin-macios/issues/11691.
2022-02-09 14:07:35 -05:00
Rolf Bjarne Kvinge 382074bbb8
[bgen] Make sure to render nint/nuint in delegates as nint/nuint for .NET. Fixes #14107. (#14112)
This makes us render this:

    public delegate nfloat NSTableViewColumnWidth(NSTableView tableView, nint column);

instead of this:

    public delegate nfloat NSTableViewColumnWidth(NSTableView tableView, IntPtr column);

Fixes https://github.com/xamarin/xamarin-macios/issues/14107.
2022-02-09 13:17:48 -05:00
Rolf Bjarne Kvinge 5e462b1c21
[dotnet] Fix non-bundling of debug files for release builds. Fixes #14085. (#14103)
Fixes https://github.com/xamarin/xamarin-macios/issues/14085.
2022-02-09 16:46:04 +01:00
Rolf Bjarne Kvinge 06100d8dca
[xtro] Update legacy annotations to talk about .NET instead of XAMCORE_4_0. (#14094)
This makes the XAMCORE_4_0 list in our source code substantially smaller.
2022-02-09 08:27:46 +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
Filip Navara 0622ae4af2
Fix GC issue on CoreCLR where finalized objects are returned by Runtime.GetNSObject (#14070)
Fixes race condition where finalized objects are resurrected by the finalizer and for a brief moment `Runtime.TryGetNSObject`/`Runtime.GetNSObject` would return them even though a new instance is supposed to be used. In multi-threaded scenarios this would result in reused objects (same native handle) to suddenly become invalid when the UI thread processes the delayed finalization.

Fixes #13921
2022-02-08 11:08:44 +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 0fff3cbea0
[Foundation] Add strongly typed version of NSUndoManager.RunLoopModes for .NET. (#14040) 2022-02-08 10:40:46 +01:00
Rolf Bjarne Kvinge a5855f6f88
[JavaScriptCore] Bind JSValue.ToArray as NSArray in .NET. Fixes #12549. (#14090)
Fixes https://github.com/xamarin/xamarin-macios/issues/12549.
2022-02-08 10:39:14 +01:00
Rolf Bjarne Kvinge 0df9fa98ef
[UIKit] Implement the UIResponderStandardEditActions protocol. (#14095)
Implement the UIResponderStandardEditActions protocol, move the
corresponding API from UIResponder there, and make sure UIResponder implements
the new UIResponderStandardEditActions protocol (which should make this move a
non-breaking change, since the protocol is inlined in UIResponder).
2022-02-08 10:38:28 +01:00
Rolf Bjarne Kvinge 2d81a92270
[tests] Adopt XAMCORE_4_0 changes in monotouch-test .NET. (#14099) 2022-02-08 10:36:20 +01:00
Rolf Bjarne Kvinge 14dde5ca9a
[AppKit/Foundation] Make the "Color" suffix consistent in NSColor and UIColor properties. Fixes #7945. (#14080)
Make the "Color" suffix consistent in NSColor and UIColor properties (by removing the "Color" suffix for all such properties).

Fixes https://github.com/xamarin/xamarin-macios/issues/7945.
2022-02-08 09:15:21 +01:00
Rolf Bjarne Kvinge 352a0d818a
[dotnet] Include all files in the Resources subdirectory as bundle resources. Fixes #13808. (#14018)
Include all files in the project's Resources subdirectory as BundleResource
items (except .DS_Store files, which are pretty omnipresent on macOS).

Also, contrary to the other default includes, add a condition so files are
only included if we have a resource prefix (typically "Resources"), otherwise
the entire hard drive might be included, and that's not really what we want.

Fixes https://github.com/xamarin/xamarin-macios/issues/13808.
2022-02-07 18:55:31 +01:00
Rolf Bjarne Kvinge af541a05d8
[tests] Fix TOP declaration for a few makefiles. (#14086) 2022-02-07 18:38:01 +01:00
Rolf Bjarne Kvinge ef3b05478e
[tools/runtime] Enable exception marshalling by default for all platforms in .NET. (#14051)
When exception marshalling was originally implemented, for backwards
compatibility concerns it was only turned on by default for platforms that
really needed it (watchOS).

However, exception marshalling is by far the safest option, so in .NET we're
enabling it by default for all platforms (it's still possible to disable it
for those who wants to).

Ref: https://docs.microsoft.com/en-us/xamarin/ios/platform/exception-marshaling
2022-02-07 14:12:32 +01:00
Rolf Bjarne Kvinge eb281aefee
[AppKit] Make NSTextView implement the NSColorChanging protocol in .NET. (#14071)
Also change the NSColorChanging.ChangeColor method to not be deprecated
anymore, Apple's headers say nothing of the sort.
2022-02-07 08:06:24 +01:00
Rolf Bjarne Kvinge 18b53d8e4b
[xtro] Remove dead comment in ignore file. (#14078) 2022-02-07 08:04:34 +01:00
Rolf Bjarne Kvinge 6bef760049
[NetworkExtension] Remove fields from macOS that aren't in macOS for .NET. (#14082) 2022-02-07 08:03:53 +01:00
Marius Ungureanu dc9e080828
Implement IEquatable<T> on NSRange (#14083)
This avoids poor performance of GetHashCode and Equals that are used for the struct using reflection on the first field.
2022-02-07 07:52:45 +01:00
Rolf Bjarne Kvinge 534bf839c2
[Foundation] Fix signature for NSAttributedString.LowLevelGetAttributes to support no effectiveRange output. Fixes #13569. (#14069)
This makes it possible to override LowLevelGetAttributes to provide an
implementation, and be called with a NULL effectiveRange pointer.

Fixes https://github.com/xamarin/xamarin-macios/issues/13569.
2022-02-04 18:40:19 +01:00
Rolf Bjarne Kvinge 154bd6b22b
[AppKit] Implement the NSUserInterfaceValidation protocol for a few types in .NET. (#14036) 2022-02-04 08:27:29 +01:00
Rolf Bjarne Kvinge 8fafd7c806
[src] Remove CategoryAttribute.AllowStaticMembers and fix resulting issues in .NET. (#14038) 2022-02-04 08:26:56 +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 3a2acf9d99
[AppKit] Implement the NSUserActivityRestoring protocol. (#14045) 2022-02-04 08:06:25 +01:00
Rolf Bjarne Kvinge 0a10670d2e
[UIKit] Rename UISegmentedControl.DividerImageForLeftSegmentStaterightSegmentStatebarMetrics to UISegmentedControl.GetDividerImage in .NET. Fixes #6357. (#14059)
Also make the return value nullable since xtro says so.

Fixes https://github.com/xamarin/xamarin-macios/issues/6357.
2022-02-04 07:50:47 +01:00
Rolf Bjarne Kvinge 56313f896d
[AppKit] Use the correct interface for inlining protocols in our api definitions in .NET. (#14041)
Also update/fix code to show the corresponding warning in the generator, and
make a note of why MKUserLocation/MKAnnotation is special.
2022-02-03 17:56:20 +01:00
Rolf Bjarne Kvinge f0d4e1a1c7
[generator] Rework how we implement [Abstract] classes in .NET. Fixes #4969. (#14020)
We have a problem that's shown up a few times, where we're given an instance
of a native type, where the closest bound managed type is a type declared as
[Abstract] in the api definition. In this case, we want to create an instance
of the [Abstract] type to wrap the native instance, but that hasn't been
possible because the managed type is abstract.

Note: this is totally fine from the OS perspective: it might have created an
instance of a private subclass we haven't bound (or it might even be a public
subclass we just haven't bound yet).

The fix is to:

* Stop making [Abstract] classes in the api definition abstract classes in the generated code.
* Make the default constructor default to "protected" visibility for [Abstract] classes.

This way we can still create instances of these types at runtime when we need
them, but they must be subclassed in order to create a managed instance of
them.

Additionally I also had to make abstract members virtual for such types
(because otherwise the type would have to be abstract as well), and instead
throw a "You_Should_Not_Call_base_In_This_MethodException" in the
corresponding method implementations.

Fixes https://github.com/xamarin/xamarin-macios/issues/4969.
2022-02-03 08:25:07 +01:00
Rolf Bjarne Kvinge 363e58f079
[Foundation] Adopt more XAMCORE_4_0 changes in .NET. (#14017)
This is just removing obsolete API.
2022-02-02 17:24:51 +01:00
Rolf Bjarne Kvinge d5697a8867
[runtime] Use the full managed description (including inner exceptions) as the reason when creating an NSException from a managed exception. (#14002)
This makes diagnosing what happens much easier in some cases.

Exhibit A, pre fix:

    *** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to lookup the required marshalling information.
    Additional information:
    	Selector: conformsToProtocol:
    	Type: ViewController

Exhibit B, post fix:

    *** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to lookup the required marshalling information.
    Additional information:
    	Selector: conformsToProtocol:
    	Type: ViewController
     (ObjCRuntime.RuntimeException)
    Failed to get the 'this' instance in a method call to templ.ViewController.InvokeConformsToProtocol. (ObjCRuntime.RuntimeException)
       at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject(Type type, IntPtr selector, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
       at ObjCRuntime.Runtime.GetMethodAndObjectForSelector(IntPtr klass, IntPtr sel, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
       at ObjCRuntime.Runtime.get_method_and_object_for_selector(IntPtr cls, IntPtr sel, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc, IntPtr& exception_gchandle)
    Failed to marshal the Objective-C object 0x7f813fd2f470 (type: ViewController). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'templ.ViewController' does not have a constructor that takes one NativeHandle argument). (ObjCRuntime.RuntimeException)
       at ObjCRuntime.Runtime.MissingCtor(IntPtr ptr, IntPtr klass, Type type, MissingCtorResolution resolution)
       at ObjCRuntime.Runtime.ConstructNSObject[T](IntPtr ptr, Type type, MissingCtorResolution missingCtorResolution)
       at ObjCRuntime.Runtime.ConstructNSObject(IntPtr ptr, IntPtr klass, MissingCtorResolution missingCtorResolution)
       at ObjCRuntime.Runtime.GetNSObject(IntPtr ptr, MissingCtorResolution missingCtorResolution, Boolean evenInFinalizerQueue)
       at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject(Type type, IntPtr selector, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
2022-02-02 16:22:34 +01:00
Rolf Bjarne Kvinge 56a71684e5
[CoreImage] Adopt XAMCORE_4_0 changes in .NET. (#13983) 2022-02-02 16:07:45 +01:00
Chris Hamons 0a57125ccc
[tests] Add ILStrip with satellite assemblies lib (#13973)
- Part of investigation of https://github.com/xamarin/xamarin-macios/issues/13922
2022-02-02 09:01:32 -06:00
Rolf Bjarne Kvinge 4b1738826f
[FileProvider] Adopt XAMCORE_4_0 changes in .NET. (#14012) 2022-02-02 08:01:06 +01:00
Rolf Bjarne Kvinge 101c0a7ac0
[Network] Adopt XAMCORE_4_0 changes in .NET. (#13988) 2022-02-01 21:17:18 +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 b1ce33ba51
[Foundation/ObjCRuntime] Use 'ObjCException' as the native exception type name for all platforms in .NET. Fixes #13855. (#13915)
* Use 'ObjCException' instead of 'MonoTouchException' as the managed exception
  type wrapping an NSException for all platforms in .NET (that was already the
  case for macOS, so no change there).
* Make the ObjCException class behave like the MonoTouchException class does.
* Move the ObjCException type to the ObjCRuntime namespace in .NET.

Fixes https://github.com/xamarin/xamarin-macios/issues/13855.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-02-01 17:24:57 +01:00
Rolf Bjarne Kvinge 4d2db6463b
[dotnet] Fix templates to use NativeHandle instead of IntPtr. Fixes #13979. (#14001)
Also make the (NativeHandle) constructor protected instead of public, to make
it clearer that it's not for public consumption.

And modify the template tests to execute the template if we can.

Fixes https://github.com/xamarin/xamarin-macios/issues/13979.
2022-02-01 17:22:53 +01:00
Rolf Bjarne Kvinge 5606035493
[MediaAccessibility] Adopt XAMCORE_4_0 changes in .NET. (#13984) 2022-02-01 11:31:45 +01:00
Rolf Bjarne Kvinge aaee4d9f27
[ModelIO] Adopt XAMCORE_4_0 changes in .NET. (#13941)
This turned out a bit complex, because numerous ModelIO APIs were initially bound
with wrong matrix types, and had to be rebound later (our matrix type was transposed
with regards to the native matrix type). The new versions often had to use worse
names, so that's being fixed now. This means that numerous tests had to be updated,
because the original API now returns non-transposed matrices.
2022-02-01 08:08:50 +01:00
Rachel Kang a64b03a886
[CHIP] Updates for Xcode13.2 beta 1 (#13884)
* [CHIP] Updates for Xcode13.2 beta 1

* Update based on feedback

* Update based on feedback and intro test failure

* Update xtro .todo files

* Fix some breaking API changes

* Delete silly typos
2022-01-31 18:55:49 -05:00
Rolf Bjarne Kvinge 7517d6a8b5
[WKWebKit] Adopt XAMCORE_4_0 changes in .NET. (#13992) 2022-01-31 23:47:45 +01:00
Rolf Bjarne Kvinge bd5c7b331f
[Contacts] Adopt XAMCORE_4_0 changes in .NET. (#13993) 2022-01-31 23:46:11 +01:00
Rolf Bjarne Kvinge 1d8ef73ee1
[SystemConfiguration] Adopt XAMCORE_4_0 changes in .NET. (#13991) 2022-01-31 21:54:37 +01:00
Rolf Bjarne Kvinge 2de903f337
[Social] Adopt XAMCORE_4_0 changes in .NET. (#13986)
Also clean up the code to use fewer ifdefs.
2022-01-31 21:33:53 +01:00
Rolf Bjarne Kvinge d1989b63c4
[tests] Simplify makefiles by using shared code. (#13990) 2022-01-31 21:11:08 +01:00
Chris Hamons e8663ebbc7
[NET 6 Attribute Conversion] CoreFoundation (#13816) 2022-01-31 13:27:23 -06:00
Rolf Bjarne Kvinge 6674e83bec
[GameplayKit] Adopt XAMCORE_4_0 changes in .NET. (#13972) 2022-01-31 17:51:08 +01:00
Rolf Bjarne Kvinge 8405fcf3b8
[EventKit] Adopt XAMCORE_4_0 changes in .NET. (#13971) 2022-01-31 17:50:09 +01:00
Rolf Bjarne Kvinge ee8869a9d1
[GameKit] Adopt XAMCORE_4_0 changes in .NET. (#13964) 2022-01-31 17:04:23 +01:00
Rolf Bjarne Kvinge d8c2e5e040
[HealthKit] Adopt XAMCORE_4_0 changes in .NET. (#13968) 2022-01-31 16:57:26 +01:00
Rolf Bjarne Kvinge 62b3eab06d
[Darwin] Adopt XAMCORE_4_0 changes in .NET. (#13965) 2022-01-31 16:51:12 +01:00
Rolf Bjarne Kvinge e64a0b489a
[AVKit] Adopt XAMCORE_4_0 changes in .NET. (#13933) 2022-01-28 18:10:19 +01:00
Rolf Bjarne Kvinge ba555b2fcc
[tests] Use the local .NET for running unit tests. (#13836)
This hopefully solves a few problems on M1, where we'd want to execute with
.NET 5 (last stable .NET release), but that version only supports x86_64, and
then if an ARM64 version of .NET 6 was also installed, things would break in
mysterious ways.

This way we have full control over what happens, and also a consistent
environment across all machines.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-01-28 16:29:37 +01:00
Rolf Bjarne Kvinge b0f84a44c1
[CoreMedia] Adopt XAMCORE_4_0 changes in .NET. (#13932) 2022-01-28 10:20:51 +01:00
Rolf Bjarne Kvinge 43d74fb895
[ObjCRuntime] Add explicit conversion operators between NativeHandle and void*. Fixes #13867. (#13929)
Fixes https://github.com/xamarin/xamarin-macios/issues/13867.
2022-01-28 10:03:54 +01:00
Rolf Bjarne Kvinge d2ef29739b
[CoreAnimation] Adopt XAMCORE_4_0 changes in .NET. (#13918)
* Mostly just removal of obsolete/deprecated API.
* Modified CAScrollLayer.ScrollMode to use the good name
  (CAScrollLayer.ScrollMode) for the strongly typed enum, and then have a
  WeakScrollMode property for the NSString version (like we do elsewhere).
2022-01-28 10:02:46 +01:00
Rolf Bjarne Kvinge fb6ab21bc8
[AppKit] Improve a few API names for .NET. (#13824) 2022-01-27 10:56:06 +01:00
Rolf Bjarne Kvinge 7e8650a931
[ARKit] Adopt XAMCORE_4_0 changes in .NET. (#13886)
For ARKit this just means removing obsolete/deprecated API.
2022-01-27 10:45:50 +01:00
Rolf Bjarne Kvinge 00647d50a5
[ModelIO] Fix the MDLVoxelIndexExtent name for .NET. (#13893) 2022-01-27 10:37:51 +01:00
Chris Hamons 02644cac41
[NET 6 Attribute Conversion] AddressBook (#13715) 2022-01-25 12:57:44 -06:00
Chris Hamons 6ce1ff7093
[NET6] Add binding project template for iOS and MacCatalyst (#13840)
- Fixes https://github.com/xamarin/xamarin-macios/issues/13578
- Uses older-style namespace with {} instead of top level due to https://github.com/xamarin/xamarin-macios/issues/13837
2022-01-25 10:05:56 -06:00
Rolf Bjarne Kvinge e7024da461
[Photos] Adopt XAMCORE_4_0 changes in .NET. (#13830)
This means removing obsolete/deprecated API.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-01-25 11:58:48 +01:00
Rolf Bjarne Kvinge efb0ac2ac7
[PassKit] Adopt XAMCORE_4_0 changes in .NET. (#13833) 2022-01-25 11:52:59 +01:00
Rolf Bjarne Kvinge fbd55af78b
[NetworkExtension] Adopt XAMCORE_4_0 changes in .NET. (#13842) 2022-01-25 11:50:35 +01:00
Rolf Bjarne Kvinge f83e1cb4b7
[QuickLook] Adopt XAMCORE_4_0 changes in .NET. (#13826) 2022-01-25 11:24:09 +01:00
Sebastien Pouliot eb3015b388
[mobilecoreservices] Modernize UTType (#13831)
* Use `is` instead of `==` for null checks
* Use `ThrowHelper` to throw common exceptions
* Use faster `CFString` API (over the slower `NSString` variants)

* [tests] Adjust UTTypeTest.cs to build for net profile
2022-01-24 21:57:28 -05:00
Rolf Bjarne Kvinge c738fd47b4
[AudioComponentDescription] Strong-type the ComponentSubType field in .NET. (#13827)
Strong names are always better!
2022-01-21 21:30:55 +01:00
Rolf Bjarne Kvinge b540e1f2b9
[UIKit] Adopt XAMCORE_4_0 changes in .NET. (#13820)
This mostly involves removing obsolete/deprecated API.
2022-01-21 17:43:50 +01:00
Sebastien Pouliot 25fab0b74e
[net][coregraphics] Match native strings representation for structs (#13802)
* Use the native `NSStringFrom*` API so we can, eventually, use the
native code to parse them from `NSString` and also ensure increased
compatibility with any code that expects the native string representation

* Add unit tests for `ToString` methods

Also use [`System.HashCode`](https://docs.microsoft.com/en-us/dotnet/api/system.hashcode?view=net-6.0) to generate the hash code
2022-01-21 08:46:25 +01:00
dotnet-maestro[bot] 6a59b3eedd
[main] Update dependencies from dotnet/runtime (#13771)
* Update dependencies from https://github.com/dotnet/runtime build 20220117.8

Microsoft.NETCore.App.Ref
 From Version 6.0.2-mauipre.1.22054.8 -> To Version 6.0.2-mauipre.1.22067.8

* [tests] Adjust according to BCL changes.

* Update dependencies from https://github.com/dotnet/runtime build 20220118.10

Microsoft.NETCore.App.Ref
 From Version 6.0.2-mauipre.1.22054.8 -> To Version 6.0.2-mauipre.1.22068.10

* Update dependencies from https://github.com/dotnet/runtime build 20220119.5

Microsoft.NETCore.App.Ref
 From Version 6.0.2-mauipre.1.22054.8 -> To Version 6.0.2-mauipre.1.22069.5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-01-21 08:40:37 +01:00
Rolf Bjarne Kvinge e51355f657
[SceneKit] Adopt XAMCORE_4_0 changes in .NET. (#13806)
This means removing obsolete/deprecated methods.
2022-01-21 08:09:57 +01:00
Rolf Bjarne Kvinge a2f7407b76
[SafariServices] Adopt XAMCORE_4_0 changes in .NET. (#13801) 2022-01-20 10:33:42 +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 28df7033f2
[MessageUI] Fix enum sizes in .NET. (#13799) 2022-01-20 10:31:59 +01:00
Rolf Bjarne Kvinge 4068c49e8c
[CoreText] Adopt XAMCORE_4_0 changes in .NET. (#13789) 2022-01-20 07:45:32 +01:00
Marius Ungureanu d2ccca6539
Add NullAllowed to NSRunningApplication (#13703) 2022-01-19 22:36:07 +01:00
Rolf Bjarne Kvinge 26d9d9172a
[ScriptingBridge] Improve API and add nullability. (#13787)
* Improve the API for both legacy Xamarin and .NET.
* Obsolete the old API in legacy Xamarin and point to the new API.
* Remove the old API in .NET.
* Add nullability.
2022-01-19 20:52:18 +01:00
Rolf Bjarne Kvinge c6ee74377a
[msbuild] Unify some of the codesign dependency properties. (#13725) 2022-01-19 18:54:08 +01:00
Rolf Bjarne Kvinge 9368e0871e
[VideoSubscriberAccount] Adopt XAMCORE_4_0 changes in .NET. (#13778) 2022-01-19 18:51:26 +01:00
Rolf Bjarne Kvinge d7f1829a4b
[StoreKit] Adopt XAMCORE_4_0 changes in .NET. (#13783)
This is mostly removing obsolete/removed API, except for
SKProduct.ContentVersion, where the XAMCORE_4_0 annotations were wrong and the
property is still alive and kicking.
2022-01-19 18:50:30 +01:00
Rolf Bjarne Kvinge a914a8b23d
[SpriteKit] Adopt XAMCORE_4_0 changes in .NET. (#13786)
This means removing numerous obsolete/deprecated methods where better/more
correct alternatives already exist.

Also fix one obsolete message and adjust the tests.
2022-01-19 18:49:47 +01:00
Rolf Bjarne Kvinge 697e5b330e
[src] Fix optional/required protocol members in .NET. (#13764)
Make required protocol members [Abstract] and optional protocol members not in
.NET. This way we're matching Apple's API (for now at least).
2022-01-19 09:03:35 +01:00
Rolf Bjarne Kvinge 1c4c297795
[AppKit] Update NSSpellingState to be a native enum in .NET, according to current AppKit headers. (#13770) 2022-01-19 08:29:08 +01:00
Sebastien Pouliot 0d95c4a5b9
[net][objcruntime] Add `GetHashCode` and `Equals` to `DisposableObject` (#13746)
* Ensure all `DisposableObject` subclasses have an implementation based
  on their `Handle` property and not relying on `System.Object` default.
  E.g. `CFArray`, `CFString`...

* Reduce code duplication for the few subclasses that have overrides
  doing just the same, e.g. `Class`, `Selector`

Types subclassing `NativeObject` that had `Equals` and `GetHashCode` overridden

* CoreFoundation.CFRunLoop
* CoreFoundation.DispatchObject (and DispatchQueue subclass)
* CoreGraphics.CGColor -> special case with it's own [native equality function](https://developer.apple.com/documentation/coregraphics/1455217-cgcolorequaltocolor) [1]
* CoreGraphics.CGPath -> special case with it's own [native equality function](https://developer.apple.com/documentation/coregraphics/1411167-cgpathequaltopath) [1]
* Security.SecPolicy

[1] this is a **BUG** since `Equals` can return `true` while `GetHashCode` returns different values !?!?!

> Two objects that are equal return hash codes that are equal.
https://docs.microsoft.com/en-us/dotnet/api/system.object.gethashcode?view=net-6.0

I'm not sure how to get a good _fast_ hash code...

> However, the reverse is not true: equal hash codes do not imply object equality, because different (unequal) objects can have identical hash codes.

but returning a constant if fast and valid - even if it looks funky.

Subclasses that did not have `Equals` and `GetHashCode` implemented

* VideoToolbox.VTFrameSilo
* VideoToolbox.VTMultiPassStorage
* VideoToolbox.VTSession
* SystemConfiguration.NetworkReachability
* Security.SecCertificate
* Security.SecIdentity
* Security.SecKey
* Security.SecAccessControl
* Security.SecCertificate2
* Security.SecIdentity2
* Security.SecProtocolMetadata
* Security.SecProtocolOptions
* Security.SecTrust
* Security.SecTrust2
* Security.SslContext
* Network.NWAdvertiseDescriptor
* Network.NWBrowseResult
* Network.NWBrowser
* Network.NWBrowserDescriptor
* Network.NWConnection
* Network.NWConnectionGroup
* Network.NWContentContext
* Network.NWDataTransferReport
* Network.NWEndpoint
* Network.NWError
* Network.NWEstablishmentReport
* Network.NWFramer
* Network.NWInterface
* Network.NWListener
* Network.NWMulticastGroup
* Network.NWParameters
* Network.NWPath
* Network.NWPathMonitor
* Network.NWPrivacyContext
* Network.NWProtocolDefinition
* Network.NWProtocolMetadata
* Network.NWProtocolOptions
* Network.NWProtocolStack
* Network.NWResolutionReport
* Network.NWResolverConfig
* Network.NWTxtRecord
* Network.NWWebSocketRequest
* Network.NWWebSocketResponse
* MediaToolbox.MTAudioProcessingTap
* ImageIO.CGImageDestination
* ImageIO.CGImageMetadata
* ImageIO.CGImageMetadataTag
* ImageIO.CGImageSource
* CoreVideo.CVBuffer
* CoreVideo.CVMetalTexture
* CoreVideo.CVMetalTextureCache
* CoreVideo.CVPixelBufferPool
* CoreText.CTFont
* CoreText.CTFontCollection
* CoreText.CTFontDescriptor
* CoreText.CTFrame
* CoreText.CTFramesetter
* CoreText.CTGlyphInfo
* CoreText.CTLine
* CoreText.CTParagraphStyle
* CoreText.CTRun
* CoreText.CTRunDelegate
* CoreText.CTTextTab
* CoreText.CTTypesetter
* CoreMedia.CMBlockBuffer
* CoreMedia.CMBufferQueue
* CoreMedia.CMFormatDescription
* CoreMedia.CMMemoryPool
* CoreMedia.CMSampleBuffer
* CoreMedia.CMClockOrTimebase
* CoreGraphics.CGColorConversionInfo
* CoreGraphics.CGColorConverter
* CoreGraphics.CGColorSpace
* CoreGraphics.CGContext
* CoreGraphics.CGDataConsumer
* CoreGraphics.CGDataProvider
* CoreGraphics.CGFont
* CoreGraphics.CGFunction
* CoreGraphics.CGGradient
* CoreGraphics.CGImage
* CoreGraphics.CGLayer
* CoreGraphics.CGPDFContentStream
* CoreGraphics.CGPDFDocument
* CoreGraphics.CGPDFOperatorTable
* CoreGraphics.CGPDFPage
* CoreGraphics.CGPDFScanner
* CoreGraphics.CGPattern
* CoreGraphics.CGShading
* CoreFoundation.CFBundle
* CoreFoundation.CFAllocator
* CoreFoundation.CFArray
* CoreFoundation.CFBoolean
* CoreFoundation.CFData
* CoreFoundation.CFDictionary
* CoreFoundation.CFMachPort
* CoreFoundation.CFMessagePort
* CoreFoundation.CFNotificationCenter
* CoreFoundation.CFPropertyList
* CoreFoundation.CFRunLoopSource
* CoreFoundation.CFString
* CoreFoundation.CFType
* CoreFoundation.CFUrl
* CoreFoundation.DispatchBlock
* CoreFoundation.OSLog
* CoreServices.CFHost
* AddressBook.ABAddressBook
* AddressBook.ABMultiValue<T>
* AddressBook.ABRecord
* ObjCRuntime.BaseWrapper
2022-01-19 08:22:24 +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
Rolf Bjarne Kvinge d49903ccca
[AppKit] Fix atrocious API naming in NSTextFinderClient in .NET. (#13769) 2022-01-18 20:23:09 +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 c3e5d7e575
[tests] Ignore more cases of 502 errors in our tests. (#13768) 2022-01-18 15:53:37 +01:00
Rolf Bjarne Kvinge e8c55ddac0
[Foundation] Remove compat overloads of methods taking a NSUrlSessionPendingTasks delegate in .NET. (#13759) 2022-01-18 11:13:29 +01:00
Rolf Bjarne Kvinge f831146acf
[introspection] Add exception according to recent changes in .NET API. (#13762) 2022-01-18 11:05:58 +01:00
Rolf Bjarne Kvinge 14824b92b2
[tests] Simplify mmptest a bit by using existing mechanisms to create frameworks. (#13757) 2022-01-18 11:05:41 +01:00
Rolf Bjarne Kvinge 391b46b14f
[Foundation] Make NSBundleExecutableArchitecture non-native. (#13754)
NSBundleExecutableArchitecture is an enum of our own invention, so there's no
need for it to be a native enum.
2022-01-18 10:52:15 +01:00
Rolf Bjarne Kvinge f5cf33858b
[Foundation] Fix the NSMetadataItem.UbiquitousItemDownloadingStatus property name for .NET. (#13753) 2022-01-18 10:51:34 +01:00
Rolf Bjarne Kvinge 04a77c56dc
[Foundation] Fix a few method names to follow naming guidelines for .NET. (#13763) 2022-01-18 10:39:04 +01:00
Rolf Bjarne Kvinge 7b9f938f65
[Intents] Remove INSetMessageAttributeIntentResponseCode from macOS in .NET. (#13752)
According to the headers it's not available in macOS.
2022-01-18 08:09:49 +01:00
Rolf Bjarne Kvinge 5dd0b0dd62
[Intents] The INPersonRelationship enum was added to macOS 12.1 according to the documentation. (#13751)
But only some values, the rest aren't available, so remove those from .NET.
2022-01-18 08:06:54 +01:00
Rolf Bjarne Kvinge 97dcd69d41
[Foundation] Remove some obsolete API in .NET. (#13678) 2022-01-17 20:58:46 +01:00
Rolf Bjarne Kvinge 7ab734068c
[AudioUnit] Improve a few AudioUnit methods to return the error code. (#13730)
This makes it easier to figure out problems in consuming code, since it makes
it easier to identify where things start to go wrong.

Fixes https://github.com/xamarin/maccore/issues/2539.
2022-01-17 17:02:43 +01:00
Rolf Bjarne Kvinge 1d9a02cbef
[dotnet] Figure out where to publish files in the app bundle. Fixes #12572. (#13591)
In .NET, all files that should be published (put into the final .app bundle) are put into the @(ResolvedFileToPublish) item group, and at the end of the build process, .NET will publish all the files in that item group. Which files are in this item group, and how they're put in there, is out of our control (it's just how the build process works in .NET), so we'll have to cope.

Additionally, publishing an app for Apple platforms is different than publishing other .NET apps, because we can't just put all the files in the a directory like .NET usually does, we have a fairly strict directory structure we need to follow, and it also differs between platforms (the structure is different between macOS and iOS for instance).

This means that for every file in the `ResolvedFileToPublish` item group, we have to figure out:

* Should it be put into the app bundle in the first place?
* If so, in which subdirectory (if any)?

This PR implements these changes. The exact details are explained in a document in the PR, but the general logic is:

* We make an educated guess for some types of files we know about (assemblies, unmanaged libraries, images, etc).
* We provide a way to set metadata on each item specifying which type of item it is (assembly, unmanaged library, image, etc), and we'll treat the item as such. This method can also be used to override the guess we made (for files that shouldn't be published for instance).
* We warn if we run into files we're not educated enough to be able to guess about, and for which there's no custom metadata set.

Fixes https://github.com/xamarin/xamarin-macios/issues/12572.
2022-01-17 09:50:06 +01:00
Rolf Bjarne Kvinge ce86f7746b
[Foundation] Remove some obsolete NSObject API in .NET (#13719)
Remove badly named API (or with typos) in .NET.
2022-01-17 09:45:44 +01:00
Rolf Bjarne Kvinge 3183517e9d
[AppKit] Rename NSTableView.DragImageForRowsWithIndexestableColumnseventoffset to NSTableView.DragImageForRows in .NET. (#13723)
The original name is quite bad.
2022-01-17 09:45:03 +01:00
Rolf Bjarne Kvinge 0f5642f4b5
[Intents] Remove Intents types from macOS in .NET that were added by mistake. (#13727)
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-01-17 09:40:29 +01:00
Rolf Bjarne Kvinge f219bc0851
[Foundation] Remove a few broken NSExpression overloads in .NET. (#13728) 2022-01-17 09:38:16 +01:00
Rolf Bjarne Kvinge ed02a212bf
[Foundation] Replace broken version of NSRegularExpression.GetMatches with a working version for .NET. (#13732) 2022-01-17 09:34:26 +01:00
Rolf Bjarne Kvinge 209eca1fb7
[CGAffineTransform] Rename public fields in .NET to follow Apple and managed naming conventions. Fixes #13494. (#13737)
Rename the public fields in CGAffineTransform to:

* Follow our naming convention (public API should always start with an
  upper-case letter).
* Use the same names as Apple's version to ease porting Swift/Objective-C
  code.

Fixes https://github.com/xamarin/xamarin-macios/issues/13494.
2022-01-17 09:26:39 +01:00
Rolf Bjarne Kvinge ccf651c5f3
[Intents] Fix optional/abstract for protocols in .NET. (#13738) 2022-01-17 09:22:43 +01:00
Rolf Bjarne Kvinge ce609e5153
[Foundation] Abstractify protocol members in .NET. (#13741) 2022-01-17 09:20:58 +01:00
Rolf Bjarne Kvinge e963fc6f5f
[CoreData] Move CoreData into the .NET age. (#13718)
* Remove obsolete API from .NET.
* Change API marked with XAMCORE_4_0 due to naming problems to be in .NET.
* Change API marked with XAMCORE_4_0 due to using non-generic NSDictionary to be
  in XAMCORE_5_0 instead (yay!). This is because of #13704, which can make using
  generic NSDictionary in API buggy, and I feel it's a bit too risky to change this
  for .NET with the time we have available (no time to fix #13704). Additionally,
  moving this to XAMCORE_5_0 makes it possible to keep grepping for XAMCORE_4_0 to
  see what's left. Update all the CoreData API to be better as defined by our XAMCORE_4_0
  define. Mostly using generic NSSet/NSDictionary types instead of the non-generic
  ones, and other misc naming improvements.
* Change API marked with XAMCORE_4_0 due to both of the above to do both of the
  above - add a version of the naming issue fixed for .NET + a version with the generic
  dictionary for XAMCORE_5_0.
2022-01-14 17:13:46 +01:00
Rolf Bjarne Kvinge a34ca54cc2
[src] Make sure the (IntPtr/NativeHandle, bool) ctor is always preserved (conditionally) for types that subclass NativeObject. Fixes #13699. (#13708)
Also add test to make sure we never forget again.

Fixes https://github.com/xamarin/xamarin-macios/issues/13699.
2022-01-14 15:26:23 +01:00
Rolf Bjarne Kvinge 6564841c6a Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-14 11:00:16 +01:00
Rolf Bjarne Kvinge 5ef6fac236 [xharness] Give the .NET tests another hour to complete. 2022-01-14 10:58:33 +01:00
Rolf Bjarne Kvinge 9894605c4f
[SceneKit] Make SCNMatrix4 column-major in .NET. Fixes #4652. (#13695)
* Implement a column-major version of SCNMatrix4 in .NET to match native code.
* This was done by copying the existing SCMatrix4 implementation, and modify it
  as required (doing it with conditional compilation in the same file turned out
  to be quite messy, so I opted for using different files for legacy Xamarin and
  .NET).
* There was one major change: the matrix inversion algorithm is new (copied from
   .NET instead), because the legacy Xamarin version showed strange results with
  some test values.
* Add setters for SCNMatrix4.Column[0-3] for legacy Xamarin to match the .NET API.
* Add CreateFromColumns methods for legacy Xamarin to match the .NET API.
* Add tests for all the new API.

Fixes https://github.com/xamarin/xamarin-macios/issues/4652.
2022-01-14 07:30:19 +01:00
Rolf Bjarne Kvinge 1ee7a63412
[Foundation] Remove the NSDateComponentsWrappingBehavior in .NET. (#13713)
It's our own enum, and all the API using it have been obsoleted/removed.

There doesn't seem to be any other usage of it on GitHub either (only our own
source code and documentation).
2022-01-14 07:27:08 +01:00
Rolf Bjarne Kvinge 76cd53fe4d
[Foundation] Rename the NSLinguisticTagUnit enum to NSLinguisticTag in .NET. (#13706) 2022-01-13 22:30:44 +01:00
Rolf Bjarne Kvinge 65a7794244
[AppKit] Update NSWindowStyle deprecations according to headers. (#13696)
Also remove the Unscaled field, it's removed from the headers, and it was
deprecated before the earliest macOS version we support.

Also also fix a few xtro issues.
2022-01-13 22:29:11 +01:00
Rolf Bjarne Kvinge a2e4438536 Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-13 22:13:00 +01:00
Rolf Bjarne Kvinge d953b6f037 [tests] Augment tests to rebuild and make sure the result is as expected. 2022-01-13 22:07:57 +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 a35ee4e7a6
[CoreAnimation] Rename CATransform3D's fields to follow standard naming conventions for .NET. (#13684)
Public fields shouldn't start with a lower-cased letter.

Also provide public properties in legacy Xamarin so that we can write
identical code for both, and obsolete the lower-cased fields.
2022-01-12 21:46:20 +01:00
Rolf Bjarne Kvinge 10ad084ec3
[AudioUnit] Create a GCHandle when AudioUnit.SetInputCallback is called. Fixes #13637. (#13673)
AudioUnit needs a GCHandle in the input callback, which means we have to create it
when SetInputCallback is called (like we already do for SetRenderCallback).

Fixes https://github.com/xamarin/xamarin-macios/issues/13637.
2022-01-12 20:52:03 +01:00
Rolf Bjarne Kvinge 131829c4c4
[xharness] Bump timeout for the .NET tests to 3 hours. Fixes #xamarin/maccore@2538. (#13685)
Fixes https://github.com/xamarin/maccore/issues/2538.
2022-01-12 20:26:24 +01:00
Rachel Kang 304048a965
Add cecil test for verifying obsoleted apis (#13590)
* First version cecil test

* Add missing net6 platform assemblies

* Make it work for Catalyst

* Add namespace switch and clean up code

* Update based on feedback

* Update based on feedback

* Update based on feedback

* Make test pass by default

* Fix bgen tests by fixing GetRefNuGetName

* Update based on feedback

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2022-01-12 09:47:46 -05:00
Rolf Bjarne Kvinge 6f1362f1d2
[tests] Add helpful makefiles for a few test suites. (#13677)
Add makefiles that can build a test for all platforms with a single rule.
2022-01-12 11:39:06 +01:00
Rolf Bjarne Kvinge 753b3ee100 [tests] Simplify makefiles by deleting unused targets. 2022-01-11 17:35:20 +01:00
Rolf Bjarne Kvinge 214064d430 Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-11 17:32:26 +01:00
Rolf Bjarne Kvinge 16358a7963
[ObjCRuntime] Fix the DisposableObject.Owns property to return the correct value. Fixes #13646. (#13666)
* [ObjCRuntime] Fix the DisposableObject.Owns property to return the correct value. Fixes #13646.

Ops...

Also add tests to avoid more oopses.

Fixes https://github.com/xamarin/xamarin-macios/issues/13646.

* Update tests/monotouch-test/AudioToolbox/AudioConverterTest.cs

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-01-11 15:37:31 +01:00
Manuel de la Pena 94863148dc
[CI] Fix device tests (#13657)
Allow device tests to run. Tests do not pass yet, that has to be fixed in xharness.
2022-01-10 11:48:34 -05:00
TJ Lambert a0ad207ea7
[Dotnet] Automatically Allow Assets of all types and Test (#13346) 2022-01-10 08:32:05 -06:00
Rolf Bjarne Kvinge e06151c903
[VideoToolbox] Add a VTCompressionSession.EncodeFrame overload that takes a CVImageBuffer instead of a handle to one. (#13631)
This makes the API nicer to use.
2022-01-10 13:00:34 +01:00
Alex Soto dfe6c2b5ab
[main] Add Xcode 13.2 Support (#13643)
* [Xcode13.2] Bump to Xcode 13.2 RC (#13497)

* [Xcode13.2] Bump to Xcode 13.2 Beta 2

Breaking changes addressed for legacy
* HomeKit
* CallKit
* CoreLocation

* [xcode13.2] Bump to Xcode 13.2 RC and apply feedback

* [AppKit] Fix missing Notifications

* Fix xtro

* [xcode13.2] Bump versions and use stable Xcode 13.2

* [monotouch-tests] Make TestAddingByComponents work on the last day of the year

Happy New Year!!

* NO BOM PLZ!
2022-01-03 09:28:00 -05:00
Rolf Bjarne Kvinge 05ca39b211 [xharness] Bump timeout for .NET tests to 3 hours. 2021-12-22 21:50:33 +01:00
Rolf Bjarne Kvinge 5a45a3c3aa
[src] Remove the ModelAttribute.AutoGeneratedName property in .NET. (#13619)
AutoGeneratedName was a toggle to implement a certain (correct) behavior,
while at the same time not cause breaking changes.

Now that we can do breaking changes in .NET, we can remove the toggle (i.e.
the property), and just always do the right thing (that is: automatically
generate a _unique_ Objective-C name for Model classes, unless a name is
specified manually).

Ref: https://github.com/xamarin/xamarin-macios/issues/5107
2021-12-22 21:28:19 +01:00
Rolf Bjarne Kvinge ecbeca5725 [tests] Adjust the IsNotMacBuild .NET test to not expect Xamarin.iOS.dll in the app bundle.
We're copying files differently to the bundle now, and we end up doing less
when not building on a Mac, which is why we're not copying Xamarin.iOS.dll
anymore.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 268620bd0e [tests] Add BundleStructure, a test project to verify how files end up in the app bundle. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 5a2a7eef4f [tests] Make bindings-framework-test a NoBindingEmbedding binding project.
NoBindingEmbedding is the future, and that's what we want to test as well.
2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 20c41e1dc6 [tests] Print the binlog path on a line all by itself.
I look at the binlog *all the time*, and this shaves off a few seconds every time
I have to find the path to it.
2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 0681dc1f4a [tests] Move some sharable code to a more generic location, so that it's easier to share 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 7774518079 [tests] Allow for more time to build tests/test-libraries now, since more work is being done there 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge d430dd74c0 [tests] Add build logic to build numerous native libraries for testing purposes. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 0cc54bd76e [tests] Add build logic to build NuGets for testing purposes. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 40d4e6a49a [tests] Add build logic to build numerous native plugins for testing purposes. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge cf290be186 [tests] Add build logic to build numerous native frameworks for testing purposes. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 1a5e397b01 [tests] Add a zipped version of XTest.[xc]framework 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 1c008fe315 [tests] Fix some make logic in test-libraries.
Use the right template variable in the template expansion to avoid duplicating variable names.
2021-12-22 10:17:33 +01:00
Rolf Bjarne Kvinge b75b9f509a
[UIKit] Make UITextInputTraits members optional in .NET. Fixes #5831. (#13607)
Once upon a long time ago we decided to mark the properties in the
UITextInputTraits protocol as required in our API definition, because that way
we'd inline these properties in any class that implemented the
UITextInputTraits protocol, which made calling these properties much easier.

At a later point, we implemented better support for protocols, and now we
automatically generate extension methods for such properties (a corresponding
Get/Set method for the get/set property accessors), so we don't need these
inlined properties anymore.

However, removing them would be a breaking change, so we were stuck with these
redundant inlined properties, until .NET came along.

Ref: 0e80570863

Fixes https://github.com/xamarin/xamarin-macios/issues/5831.
2021-12-22 08:01:15 +01:00
Rolf Bjarne Kvinge c45d0ae55c
[generator] Fix the selector in extension methods for protocol properties with Bind attributes. Fixes #12727. (#13618)
Take into account any Bind attributes on optional property getters and setters
on protocols when generating the Get* and Set* extension methods, so that we
use the right selector.

Fixes https://github.com/xamarin/xamarin-macios/issues/12727.
2021-12-21 20:39:03 +01:00
Rolf Bjarne Kvinge f87016ca7d
[tests] Allow 502 Bad Gateway as well in the SecureTransportTest.Tls12 test. (#13610)
The "502 Bad Gateway" error occurs sometimes on the bots.

Maybe we should rename it "502 Bad Bot"?
2021-12-21 15:23:15 +01:00
Rolf Bjarne Kvinge b695c8c837
[dotnet] Don't add FileNativeReferences to the main libraries to link with. Fixes #13503. (#13598)
Don't add FileNativeReferences to the main libraries to link with, because we
pass that list of main libraries to the LinkNativeCodeTask, and we're already
passing the FileNativeReferences for a different task parameter.

This means that we end up adding the file native reference twice to the linker
arguments, and that's wasteful. It can also cause problems if those linker
arguments aren't always computed in the same way (once as a relative path,
once as an absolute path for instance).

Fixes https://github.com/xamarin/xamarin-macios/issues/13503.
2021-12-21 08:13:53 +01:00
Rolf Bjarne Kvinge 1100703536
[AVFoundation] Address all the XAMCORE_4_0 notes in AVFoundation for .NET. (#13593) 2021-12-21 08:12:25 +01:00
Rolf Bjarne Kvinge 368cf1fbbb
[VTCompressionSession] Fix broken Create overloads for .NET. (#13589)
Once upon a time there was a single VTCompressionSession.Create method, which
was [driving users insane][1] - they had to manually call CFRetain to avoid
crashes! What an abomination!!

Insane users are clearly not happy users, and we wanted happy users, so time
and effort went into creating a solution: a new Create overload was devised
and [implemented][1], taking extreme care to not break our brave and insane
existing users who had to manually call CFRetain. Because the fix would break
existing users - the now extraneous CFRetain would mean that their apps would
leak memory. *A lot* of it! That's bad, so we decided to make sure that didn't
happen.

Of course, dear old Murhpy wanted a say, so the new Create overload didn't do
as intended. In fact, it had the same insane behavior the old Create overload
had! Ops.

But Murphy decided to have even more fun: the changes were so buggy, that they
in fact fixed the old Create overload! Which from now on wouldn't require the
horrendous manual CFRetain calls... and effectively introducing the leak the
fix was trying so hard to not introduce.

Oh dear Murphy.

Of course he had another trick up his sleeve: in our extreme efforts to help
our users, we added an Obsolete attribute that would tell people to use the
new Create overload.

Let that sink in for a moment: we had an Obsolete attribute on a function that
was (now) perfectly fine, telling users to use a function that was broken.

To get the correct behavior, users would now have to to remove their manual
CFRetain calls, and ignore the obsolete warning on the old (and correct)
Create overload which told users to use the new (and buggy) Create overload.

In other words: still insanity, just a slightly different flavor.

Murphy had a field day!

Time went by, and eventually a sane enough user [reported the insanity to
us][2]. Even better: the user actually provided a fix! Truly, we have some
amazing users.

Unfortunately, the user didn't have access to our code history, and thus was
obviously not able to see the whole picture, and the fix ended up being
incorrect.

Unrelated lesson learned: don't forget your history, otherwise you'll end up
repeating mistakes from the past.

So now came the problem: how to fix all the APIs? In a way that didn't make
our users' existing apps just suddenly start crashing or leaking?

There really was no way, so nothing really happened for quite a while.

Then, an opportunity presented itself: we'd be able to do [widespread breaking
changes][3].

So, hoping that Murphy stays away this sunny winter day, I'm changing both the
new and the old Create overloads to do the right thing. But only in .NET,
where we can do breaking changes! Or at least that's my intention. I've tried
to stave off our dear old friend by adding his arch enemy: unit tests. Which,
of course, Murphy couldn't stay away from, but it seems adding a few
Thread.Sleep calls makes him bored enough to stay away. Hopefully for good...

[1]: 66c50b9a17
[2]: https://github.com/xamarin/xamarin-macios/pull/2070
[3]: https://github.com/xamarin/xamarin-macios/issues/13087
2021-12-21 08:08:40 +01:00
Rolf Bjarne Kvinge 3e0f589cd6
Merge branch 'main' into avfoundation-xamcore40 2021-12-20 18:07:05 +01:00
Rolf Bjarne Kvinge e103cbc6f5
[xharness] Improve how we execute external processes in certain cases (#13596)
* Capture evaluation output, and write it all to the terminal when something
  goes wrong. This way we can see the entire output next to the failure (often
  there's a lot of stuff written to the terminal from different threads, and
  this way we get all that matters written together).
* Only evaluate one project at a time, to avoid overloading the machine.
* Only execute `git ls-files` once at a time, to avoid overloading the machine.
* Bump evaluation timeout to 5 minutes.
* Also increase the time for git to list files in a directory to 60 seconds.

Hopefully this will fix errors like this:

* `Unable to evaluate the property OutputPath, build failed with exit code 0. Timed out: True`
* `System.Exception: Failed to list the files in the directory /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test3403 (TimedOut: True ExitCode: 0)`
2021-12-20 18:05:55 +01:00
Rolf Bjarne Kvinge 07f19ed423
Fix grammar in documentation
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2021-12-20 08:26:08 +01:00
Rolf Bjarne Kvinge 9ee6af7d4d
Fix grammar in documentation
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2021-12-20 08:26:02 +01:00
Rolf Bjarne Kvinge 09f349b8ce
[generator] Fix reporting BI1042. (#13587)
Fix reporting BI1042 to include the type + property that triggered the error +
add a test.
2021-12-17 21:47:24 +01:00
Rolf Bjarne Kvinge aee17ec7ad Update xtro. 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge 6307a3ab84 [AVFoundation] Remove numerous AVMetadataObject fields in .NET
These fields are already available on the AVMetadataObjectType enum, so this removes
some duplication.
2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge e3a9095830 [AVFoundation] Remove a few macOS-only structs from non-macOS platforms on .NET. 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge 9a67ae6f36 [AVFoundation] Remove some obsolete API from .NET 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge 02e4d749c3 [AVFoundation] Remove inexistent API from AVPlayerLoop 2021-12-17 07:45:12 +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 32b112bad9
[tests] Shutdown build servers when rebuilding. (#13581)
This makes sure that MSBuild picks up rebuilt task assemblies.
2021-12-16 17:40:12 +01:00
TJ Lambert c4e3ab85c2
[Dotnet] Fix building twice in a row issue (#13573) 2021-12-16 09:07:47 -06:00
Rolf Bjarne Kvinge c6efb26432
[AppKit] Make sure NSFunctionKey doesn't come into Mac Catalyst in .NET. (#13582)
If NSFunctionKey isn't in Mac Catalyst in legacy Xamarin, it shouldn't be in
.NET either, so adjust the conditional logic accordingly.

Also make the NSFunctionKey enum a non-native enum in .NET, like it's in the
headers.
2021-12-16 07:40:58 +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 69015b3cec
[dotnet] Honor 'TrimMode' to specify linker behavior if LinkMode/MtouchLink aren't set. Fixes #13518. (#13543)
* Change dotnet-linker to only care about whether we're actually trimming anything or not.
* Allow LinkMde/MtouchLink to not be set if TrimMode is set.
* Detect if any assemblies are linked or not by checking the global TrimMode
  property + any TrimMode properties on assemblies.

Fixes https://github.com/xamarin/xamarin-macios/issues/13518.
2021-12-15 09:27:00 +01:00
Rolf Bjarne Kvinge 342b312a73
Our current behavior is to detect any None, BundleResource or Content item that's (#13550)
named 'Info.plist', and assume that's the app manifest.

That doesn't quite work when we end up with multiple 'Info.plist' entries in any
of those item groups (one example being a framework as a BundleResource - all frameworks
have an Info.plist, and there's no good way to distinguish what the developer's intention
was).

So:

1. Implement a 'AppManifestDetectionEnabled' property to disable automatic app manifest
   detection.

2. Add a public 'AppBundleManifest' property that specifies the app manifest
   (this is just a renamed version of our previously private '_AppManifest' property).

This makes it possible for app developers to:

* Disable automatic app manifest detection.
* Still have an app manifest by specifying it manually.
* Disable automatic app manifest detection, but also not specify an app manifest
  manually (so no custom app manifest at all).

Also:

* Rename '_AppBundleManifest' to '_AppBundleManifestPath' to make it less confusing
  with the new 'AppBundleManifest' property.
2021-12-14 20:56:52 +01:00
Rolf Bjarne Kvinge bb2572fba5
[tests] Remove workaround for an objc_msgSend bug that's been fixed for a while. (#13556)
We're not executing anywhere where this bug is present anymore.
2021-12-14 17:07:14 +01:00
Rolf Bjarne Kvinge 0bd6cf095c
[tests] Remove a few Assert.Inconclusive calls that won't be executed anymore. (#13557)
Don't conditionally ignore tests that fail on Snow Leopard (or earlier),
because we're always executing on a later OS now.
2021-12-14 17:06:09 +01:00