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

12502 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 86b9fb4ea9 [dotnet] The 'createdump' executable goes in the same directory as all the assemblies 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 7096d7626d [msbuild] Remove the static libraries (.a) we ship with Xamarin from ResolvedFileToPublish 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 07f0f3eefb [dotnet] Only publish a single icu*.dat file 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 59096ba942 [dotnet] We're not bundling the runtimeconfig.json file.
It's parsed at build time (in the _CreateRuntimeConfiguration target), and stored
in a binary format, so we don't need the original json file.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 394c8fa4c7 [msbuild] The CollectBundleResources and DetectAppManifest targets need to know the target framework moniker. 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 22220b149c [dotnet] Start using the new ComputeBundleLocation task 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 19dc9ce0aa [msbuild] Add a ComputeBundleLocation task 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 3dc0fe881a [dotnet] Add target to decompress compressed binding resource packages.
This new target will process all the items in the _CompressedAppleBindingResourcePackage
item group, decompress them, and then resolve the extracted results.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge ee55170feb [dotnet] Add target to decompress compressed plugins.
This new target will process all the items in the _CompressedPlugIns item group,
decompress them, and add them to _DirectoriesToPublish for later copying into the
app bundle.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge e617903fac [dotnet] Add target to decompress compressed frameworks.
This new target will process all the items in the _CompressedAppleFrameworks item
group, decompress them, resolve them if necessary (for .xcframeworks) and add them
to _FrameworkNativeReference.
2021-12-22 10:17:34 +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 5551e2fff7 [msbuild] Fix the ResolveNativeReferences task to return the path to the framework binary instead of the framework directory.
That's what the _FrameworkNativeReference item group contains: framework binaries
instead of the framework directory itself. This makes us process frameworks in binding
packages correctly.
2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 0d0b0bc86b [dotnet] Always set 'UseAppHost' and '_RuntimeIdentifierUsesAppHost' to 'false' in .NET.
Otherwise .NET might want to include an app host in the app, which ends up with a
build warning, because we don't use apphosts.
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 a269eec46a [msbuild] Add support for computing linker arguments for native references that are dynamic libraries.
Dynamic libraries are perfectly valid native references for macOS and Mac Catalyst.
2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 86a3689b77 [dotnet] Make sure that MSBuild doesn't strip away our PublishFolderType metadata 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 19de8ca69e [dotnet] Add documentation about how we determine where files go in the app bundle 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 94b1536ba8 [dotnet] There's no need to compute the publish location if we're not building a (publishable) app 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 3b187b4075 [msbuild] Rename the _CopyFrameworksToBundle target to _CopyDirectoriesToBundle
We're soon going to use this task to copy other types of directories (such as plugins)
as well, and in that case the old target name would be misleading.
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 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