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

12479 Коммитов

Автор SHA1 Сообщение Дата
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 9ab67cf9be Move some lookup tables in make to a more global location.
So that the tables can be used in more places.
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 030eb95f21 [mk] Zip it. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge ea0b64acc6 [msbuild] Add support for processing binding resource packages directly to the ResolveNativeReferences task. 2021-12-22 10:17:33 +01:00
Rolf Bjarne Kvinge 41711e7c66 [msbuild] Refactor out the logic to process the sidecar into its own function.
Best viewed by ignoring whitespace, since this is mostly whitespace changes.
2021-12-22 10:17:33 +01:00
Rolf Bjarne Kvinge 09fc600d0d [msbuild] Augment the ResolveNativeReferences task to accept and understand *.xcframework paths.
Previously we'd only support passing in a fake reference to a file inside the *.xcframework.

This makes some other code simpler later on.

Best viewed by ignoring whitespace, since this is mostly whitespace changes.
2021-12-22 10:17:33 +01:00
Rolf Bjarne Kvinge 55f11650b3 [msbuild] Move list of target dependencies for _ComputeFrameworkFilesToPublish to a separate property 2021-12-22 10:17:33 +01:00
Rolf Bjarne Kvinge c9610cfb6b [msbuild] Augment the Ditto task to take an AdditionalArguments property to pass to 'ditto'. 2021-12-22 10:17:33 +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
dotnet-maestro[bot] aacfb87a5f
[main] Update dependencies from dotnet/installer (#13588)
* Update dependencies from https://github.com/dotnet/installer build 20211215.3

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.21614.17 -> To Version 6.0.200-preview.21615.3

* Update dependencies from https://github.com/dotnet/installer build 20211216.3

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.21614.17 -> To Version 6.0.200-preview.21616.3

* Update dependencies from https://github.com/dotnet/installer build 20211217.4

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.200-preview.21614.17 -> To Version 6.0.200-preview.21617.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-12-22 09:02:12 +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
VS MobileTools Engineering Service 2 a7eacd2eb5
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 5561912 (#13604) 2021-12-21 10:48:59 -06:00
Rolf Bjarne Kvinge 5c4deb6ffe
[UIKit] Use the correct protocol hierarchy for UICollectionViewDelegate for .NET. (#13617)
The source code claims that having the different protocol hierarchy reduces
duplicate code, but I can't see what kind of code duplication this would
remove. The incorrect hierarchy causes all the UIScrollViewDelegate members to
not be inlined in UICollectionViewController, UICollectionViewDelegate and
UICollectionViewSource, effectively breaking API / source code, because this
might happen in UICollectionViewController subclasses now:

    MyUICollectionViewController.cs(105,24): error CS0115: 'MyUICollectionViewController.DraggingStarted(UIScrollView)': no suitable method found to override
    MyUICollectionViewController.cs(111,24): error CS0115: 'MyUICollectionViewController.DraggingEnded(UIScrollView, bool)': no suitable method found to override

This also debunks the claim from the comment in the api definition that
changing the protocol hierarchy would not be a breaking source change.

So go back to the correct protocol hierarchy for .NET, for all platforms.
2021-12-21 16:31:07 +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 0ec6e13566
[Foundation] Make NSStream.[Get|Set]Property abstract in .NET. (#13599)
These methods must be overridden, otherwise the app might crash, so making
them abstract forces developers to do the right thing.

Ref: https://bugzilla.xamarin.com/show_bug.cgi?id=50891
2021-12-21 15:22:40 +01:00
Mauro Agnoletti d117b0a01e
Updated Xamarin.Messaging reference (#13615) 2021-12-21 09:24:42 +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 c71143277e
[NSMetadataItem] Enable nullability + a few other code updates. (#13595) 2021-12-21 08:13:21 +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 9940062336
[src] No need to add the legacy version of the generated constants to the Mac Catalyst build. (#13597)
We're only building for Mac Catalyst on .NET, and this generated file is
entirely surrounded in a "#if !NET" condition, so not generating/compiling it
won't make a difference.
2021-12-21 08:10:47 +01:00
Rolf Bjarne Kvinge 71c8187fdf
[Blocks] Constrain the generic type for GetTarget and GetDelegateForBlock to delegates in .NET (#13606)
This makes it clearer what kind of types the method can handle.

A delegate constraint requires a newer C# version, which is why we can't do it
for legacy Xamarin.
2021-12-21 08:10:13 +01:00
Rolf Bjarne Kvinge 86c1a2fcf2
[src] Remove Runtime.GetSurfacedObjects in .NET. (#13608)
This method exposes internal implementation details, and makes it difficult to
innovate in the runtime. Additionally it's purpose was always for diagnosis,
but I've never seen it used (not even for its intented purpose), so we can
just remove it for .NET.
2021-12-21 08:09:26 +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
Filip Navara 23263f7f29
Remove duplicate code (#13600) 2021-12-20 14:01:17 +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
dotnet-maestro[bot] 0bbafbfe08
Update dependencies from https://github.com/dotnet/runtime build 20211216.2 (#13601)
Microsoft.NETCore.App.Ref
 From Version 6.0.1-mauipre.1.21602.7 -> To Version 6.0.1-mauipre.1.21616.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-12-20 08:24:02 +01:00
Rolf Bjarne Kvinge 3dd3c52503
[.NET/AudioSession] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] for the managed callbacks called from native code. (#13567)
Ref: https://github.com/xamarin/xamarin-macios/issues/10470.
2021-12-17 22:35:18 +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 b071f969f9 [AVFoundation] Fix unintentional API break in AVCaptureVideoDataOutput.SetSampleBufferDelegate. 2021-12-17 16:33:07 +01:00
Rolf Bjarne Kvinge aee17ec7ad Update xtro. 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge b0bb76f796 [AVFoundation] Fix AVCapture[Audio|Video]DataOutput.SetSampleBufferDelegate naming in .NET.
There were two issues to fix with regards to the legacy signature:

* Use an IAVCaptureVideoDataOutputSampleBufferDelegate parameter instead of AVCaptureVideoDataOutputSampleBufferDelegate.
* Name 'SetSampleBufferDelegate' instead of 'SetSampleBufferDelegateQueue'.
2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge d4f3565200 [AVFoundation] Use a more strongly typed property type for AVCapturePhotoOutput.SupportedFlashModes in .NET 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge dfd1a9cb15 [AVFoundation] Use a more strongly typed property type for AVCaptureVideoDataOutput.AvailableVideoCVPixelFormatType in .NET 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge eadff5bd8b [AVFoundation] Use a more strongly typed return type for AVAssetExportSession.SupportedFileTypes in .NET 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge 17f877957f [AVFoundation] Remove AVFragmentedMovieTrack.ATimeRangeDidChangeNotification in .NET
This API has a typo in its name, and the correct alternative is already implemented.
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 45b544bf34 [AVFoundation] Rename AVAudioSessionPortDescription.DataSourceDescriptions to DataSources in .NET to match the selector 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge b8b2908203 [AVFoundation] Change some AVAudio3DMixing to be properties instead of Get/Set methods for .NET.
This was already implemented through a XAMCORE_4_0 define, so the only required change
is to update the conditional logic.
2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge 0517fe801b [AVFoundation] Make abstract in .NET what couldn't be made abstract before 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge 630b772ae5 [AVFoundation] Make AVAudioEnvironmentNode.ApplicableRenderingAlgorithm's return type more strongly typed in .NET 2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge 78e798b19b [AVFoundation] Remove AVAudioSessionErrorCode.CodeResourceNotAvailable from .NET
Looks like we bound this incorrectly, and we're already providing the correct alternative,
so no need for this value.
2021-12-17 07:45:12 +01:00
Rolf Bjarne Kvinge cc5dd860c5 [AVFoundation] Make AVCaptureOutputDataDroppedReason available in macOS, like documentation says. 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