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

5605 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 054fb36507
[tests] Set the test name for the MySimpleApp test project. (#14798)
This way the 'make run' target in this project knows what to run.
2022-04-22 07:55:29 +02:00
Rolf Bjarne Kvinge beec791bda
[tests] Add some code to try to diagnose why certain test failures aren't ignored in CI. (#14769) 2022-04-20 08:19:50 +02:00
Přemek Vysoký 1730426ec9
[Xharness] Bump Microsoft.DotNet.XHarness.iOS.Shared to `1.0.0-prerelease.22211.4` (#14743) 2022-04-14 16:10:14 -04:00
Rolf Bjarne Kvinge 254a47c440
[tests] Improve NWProtocolStackTest to not crash the process if the state change handler throws an exception. (#14697) 2022-04-11 16:38:20 -04:00
Rolf Bjarne Kvinge 2125c8febe
[tests] Make MonoTests.System.Net.Http.MessageHandlerTest handle some 504's. (#14688) 2022-04-07 18:01:25 +02:00
Chris Hamons cf77b790cb
[NET Attribute Conversion] Add missing attributes in code-behind by re-running conversion (#14660)
* [NET Attribute Conversion] Chip Framework
* [NET Attribute Conversion] Rerun with many fixes
* Fix generator crash when compiling attributes with no introduced version
* Test changes for availability re-run. One new test
2022-04-07 10:46:15 -05:00
Rolf Bjarne Kvinge 9c185e1fff
[msbuild] Ask ditto to thin native libraries according to the architectures we're targetting. Fixes #13081. (#14403)
Ask ditto to thin native libraries and frameworks when copying them to the app
bundle to remove slices for architectures we're not building for.

Also add tests.

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

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-04-07 08:17:01 +02:00
Rolf Bjarne Kvinge 1b37c48ac5
[dotnet] Add support for Mac Catalyst apps optimized interface for macOS. Fixes #14621. (#14663)
This also required bumping Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@0717ac3 Add a new device type for Mac Catalyst.
* xamarin/Xamarin.MacDev@ed2a604 Remove net451 target framework from
Xamarin.MacDev.csproj

Diff: 9e6e29f2a4..0717ac3c24

Fixes https://github.com/xamarin/xamarin-macios/issues/14621.
2022-04-07 08:14:42 +02:00
Rolf Bjarne Kvinge 6af4b9607c
[tools] Make the TargetFramework.DotNet* variables version-agnostic. (#14669)
This minimizes the code changes required for .NET 7.
2022-04-06 21:33:46 +02:00
Rolf Bjarne Kvinge a46afd0147
[tests] Use 'BundledNETCoreAppTargetFrameworkVersion' to specify the .NET version in the project files. (#14666)
This way we don't have to update all these files when moving to .NET 7.
2022-04-06 20:58:20 +02:00
Rolf Bjarne Kvinge 34dfcbf3aa
[tests] Stop hardcoding system assembly version number in linker tests. (#14668)
Another step towards .NET 7.
2022-04-06 17:57:39 +02:00
Chris Hamons d51bd343f7
Add nullability on one UndoManager API (#14653)
- Fixes https://github.com/xamarin/xamarin-macios/issues/14646
- I checked UIDocument and AppKit versions and those are not nullable.
2022-04-06 10:43:29 -05:00
Rolf Bjarne Kvinge 3d904dae2c
[tests] A few test fixes to make testing system installs better. (#14652)
* Make the custom-type-assembly library build using assemblies relative to
  MAC_DESTDIR, instead of poking into $(TOP)/_mac-build (for legacy Xamarin).
* Build the custom-type-assembly using a project file for .NET (and use our
  local .NET).
* Change the default for [IOS|MAC]_DESTDIR when TESTS_USE_SYSTEM is set to
  point to the system installation.
* Make sure 'MSBuildSDKsPath' isn't set when building the custom-type-assembly
  (set by xibuild), it breaks a lot of things.
2022-04-06 08:35:25 +02:00
Alex Soto 132d5694d6
[ScreenCaptureKit] Add ScreenCaptureKit bindings up to Xcode 13.3 (#14644)
* [ScreenCaptureKit] Add ScreenCaptureKit bindings up to Xcode 13.3

* Use more appropriate exceptions.

* Remove ScreenCaptureKit from Mac Catalyst.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-05 20:16:31 -04:00
Rolf Bjarne Kvinge 906b94cb00
[mmptest] Fix resolving paths to required test files. Fixes #xamarin/maccore@2560. (#14566)
* Fix resolving paths to required test files (test files can be found relative to the root path of the repository, not relative to where Xamarin.Mac is installed)
* Don't try to sign symlinks - we can end up trying to sign the target of the symlink twice simultaneously.
* Fix finding libxammac.dylib and Xamarin.Mac.dll when testing a system installation (when MAC_DESTDIR or TESTS_USE_SYSTEM are set).
* Remove a few .NET tests we don't need anymore.

Fixes https://github.com/xamarin/maccore/issues/2560.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-05 14:30:35 +02:00
Rolf Bjarne Kvinge 277baaf521
[tests] Request labels after each test from NUnit. (#14628)
Fixes this NUnit warning:

> labels=All is deprecated and will be removed in a future release. Please use labels=Before instead.

We don't follow the suggestion from the warning, because the advantage of
writing the label after each test is that the test result will also be
printed, which means it's possible to see if any tests failed during the test
run, as opposed to having to wait until the entire test run is completed
(which can take a while) to realize that pretty much every test failed with
some silly mistake which could have been quickly fixed before re-running the
tests.
2022-04-04 19:19:45 +02:00
Rolf Bjarne Kvinge 42d561c623
[tests] Execute tests on older macOS bots with a timeout. (#14593)
This prevents a single test hang from breaking the entire test run.

Also bump timeout to 45 minutes.
2022-04-04 19:16:48 +02:00
Chris Hamons 612c32ca20
[metalperformanceshaders] Add one troublesome missing method (#14557)
- Fixes https://github.com/xamarin/xamarin-macios/issues/14450
- There is a significant amount of additional bindings to be done, but this way
we at least get the trivia one in now.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-04 11:08:55 -05:00
Rolf Bjarne Kvinge 6e348f0e65
[dotnet] Port the iOS tabbed app template to .NET. (#14592)
Ref: https://github.com/xamarin/xamarin-macios/issues/10747
2022-04-04 10:05:08 +02:00
Rolf Bjarne Kvinge 06140f1712
[tests] Adjust the Xamarin.Tests.Misc.PublicSymbols test to accept Brotli-related symbols. (#14605)
Our latest mono bump (in fd772aa82b), brought in
these new public symbols. Accept them for now, but hopefully we'll be able to
make them private at some point.

Fixes https://github.com/xamarin/xamarin-macios/issues/14604.
2022-04-04 09:55:05 +02:00
Rolf Bjarne Kvinge 53fdca45c8
[tests] Fix dependencies to build the mtouch tests. (#14606)
The corresponding project was renamed some time ago, but not all places that
used the derived Make variable were updated at the same time as they should
have been.
2022-04-04 09:53:08 +02:00
Manuel de la Pena 46af411d1c
[Foundation] Allow null parameters when creating a NSUrl from a string. (#14603)
The headers do not say that a null parameter is allowed, but the
documentation and tests state otherwise:

https://developer.apple.com/documentation/foundation/nsurl/1572047-urlwithstring

The URL string with which to initialize the NSURL object. Must be a URL that conforms to RFC 2396. This method parses URLString according to RFCs 1738 and 1808.
2022-04-02 15:13:52 -04:00
Rolf Bjarne Kvinge e191c613ce
[Foundation] Enable nullability in NSUrlSessionHandler. (#14597) 2022-04-01 14:48:57 +02:00
Rolf Bjarne Kvinge 1c4a64c0c4
[EventKitUI] Add this framework to Mac Catalyst. (#14374)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-01 14:29:30 +02:00
Rolf Bjarne Kvinge 08978fa4b1
[dotnet] Rename hardcoded 'net6.0' to use a 'DOTNET_TFM' variable instead. (#14524)
This makes things easier for .NET 7.
2022-04-01 13:48:09 +02:00
Rolf Bjarne Kvinge 0887599ccb
[cecil-tests] Enable previously disabled tests. (#14587)
Looks like these might be fixed now.

Fixes https://github.com/xamarin/maccore/issues/2547.
2022-04-01 07:22:27 +02:00
Rolf Bjarne Kvinge 7b16e71349
[tests] Ignore the BindingLibraryDSymCreated test until we've fixed the underlying issue. (#14599) 2022-04-01 07:20:54 +02:00
Rolf Bjarne Kvinge 23737939db
[CarPlay] Ignore this framework on Mac Catalyst. (#14381)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 14:20:50 +02:00
Rolf Bjarne Kvinge 77bac878d6
[IdentityLookupUI] Add this framework to Mac Catalyst. (#14385)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 14:20:08 +02:00
Rolf Bjarne Kvinge e687c20dd6
[AppClip] Add this framework to Mac Catalyst. (#14378)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 13:52:52 +02:00
Rolf Bjarne Kvinge 7cfc86d159
[CoreLocationUI] Add this framework to Mac Catalyst. (#14382)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 12:49:34 +02:00
Rolf Bjarne Kvinge 38528043d1
[AddressBookUI] Ignore this framework on Mac Catalyst. (#14377)
It exists, and is apparently usable, but it's already deprecated (and it's been deprecated on iOS for a while):

"Do not use the AddressBookUI framework in iOS 9 and later. Use the APIs defined in the Contacts UI framework instead."

Ref: https://developer.apple.com/documentation/addressbookui

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 11:17:03 +02:00
Rolf Bjarne Kvinge 209942854f
[WatchConnectivity] Ignore this framework on Mac Catalyst. (#14384)
I'm not sure if WatchConnectivity is of any use on Mac Catalyst,
so until proven it's useful, ignore it.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 10:54:29 +02:00
Rolf Bjarne Kvinge 704006f6db
[HealthKitUI] Add this framework to Mac Catalyst. (#14371)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 10:42:40 +02:00
Rolf Bjarne Kvinge 350913647a
[CoreNFC] Add this framework to Mac Catalyst. (#14383)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 10:42:03 +02:00
Rolf Bjarne Kvinge 18ecf400dc
[xtro] Simplify makefile a bit by using the [IOS|MAC]_DESTDIR variable. (#14578)
This way there's no need for custom code for testing using a system install.
2022-03-31 08:51:16 +02:00
Rolf Bjarne Kvinge 6fa6b75f19
[dotnet] Don't include @(Compile) and @(EmbeddedResource) items in @(BundleResource) items by default. Fixes #14442. (#14571)
Fixes https://github.com/xamarin/xamarin-macios/issues/14442.
2022-03-31 08:17:53 +02:00
Rolf Bjarne Kvinge dea5c1e812
[tests] Fix logic to make generator tests work with a system install. (#14497)
Fixes https://github.com/xamarin/maccore/issues/2549.
2022-03-30 21:36:09 +02:00
Rolf Bjarne Kvinge 5740e372a0
[xharness] Honor the TESTS_USE_SYSTEM environment variable in addition to the --use-system command-line argument. (#14561)
Fixes https://github.com/xamarin/maccore/issues/2561.
2022-03-30 18:59:40 +02:00
Manuel de la Pena e5b8b196f7
[xtro] Fix xtro on dotnet. (#14559)
Use the workloads versions to point to the correct dll path when running in a diff bot than the one were the build was done.
2022-03-30 11:32:25 -04:00
Alexander Köplinger b8c493c3e1
Set IsImplicitlyDefined="true" on the System.Runtime.InteropServices.NFloat.Internal PackageReference (#14532)
* Set IsImplicitlyDefined="true" on the System.Runtime.InteropServices.NFloat.Internal

This unbreaks Central Package Management via https://github.com/microsoft/MSBuildSdks/tree/main/src/CentralPackageVersions which is being worked on for NuGet, see https://github.com/NuGet/Home/issues/6764

* Add test case

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-03-30 10:13:39 +02:00
Rolf Bjarne Kvinge ad1ece2694
[mmptest] Fix TESTS_USE_SYSTEM logic. (#14542)
As long as the variable is set, we're using the system installation for testing.
2022-03-29 15:45:42 -04:00
Rolf Bjarne Kvinge 2af5fc3c56
[monotouch-test] Attempt to fix monotouch-tests on macOS 10.15. (#14520) 2022-03-29 07:51:40 +02:00
Rolf Bjarne Kvinge 50192c9f96
[msbuild] Deduplicate items in ComputeCodesignItems. Fixes #14522. (#14525)
We may end up trying to codesign the same item multiple times when codesigning
universal .NET apps. Avoid this by deduplicating items to codesign.

Fixes https://github.com/xamarin/xamarin-macios/issues/14522.
2022-03-29 07:37:57 +02:00
Rolf Bjarne Kvinge 622a1c9d61
[devops] Keep dependency selection logic together. (#14519) 2022-03-28 20:36:00 +02:00
Rolf Bjarne Kvinge 0802e2c359
[tests] Store symlinks in zips. Fixes #xamarin/maccore@2548. (#14459)
Fixes https://github.com/xamarin/maccore/issues/2548.
2022-03-28 08:59:29 +02:00
Manuel de la Pena d36d87f11e
[CI] Checkout the head ref rather than the merge or a reset, this should fix issues with the test selector. (#14496) 2022-03-25 11:38:52 -04:00
Rolf Bjarne Kvinge ab513555a6
[tests] There's no need to have different logic to compute the source root path on Azure DevOps. (#14485) 2022-03-25 16:38:37 +01:00
Rolf Bjarne Kvinge 321f171744
[tests] Don't try to parse stderr from assetutil. Fixes #xamarin/maccore@2559. (#14478)
Hopefully fixes https://github.com/xamarin/maccore/issues/2559.
2022-03-25 09:00:44 +01:00
Rolf Bjarne Kvinge d95f2d15ad
[dotnet] Use a variable for 'net6.0' instead of hardcoding it. (#14481)
This makes it easier to bump to 'net7.0' when that time comes.
2022-03-24 16:41:29 +01:00
Rolf Bjarne Kvinge 78963700e7
[dotnet] Only add a global nfloat using if we're compiling for C# 10 or later. Fixes #14434. (#14475)
Fixes https://github.com/xamarin/xamarin-macios/issues/14434.
2022-03-24 10:14:16 +01:00
Rolf Bjarne Kvinge d9e3206125
Merge branch 'main' into dotnet-dsyms 2022-03-23 22:24:51 +01:00
Rolf Bjarne Kvinge 18fa252f1d
[msbuild] Show a better error when a bundle identifier isn't provided. Fixes #14283. (#14402)
Fixes https://github.com/xamarin/xamarin-macios/issues/14283.
2022-03-23 16:49:06 +01:00
Rolf Bjarne Kvinge e44d0fd047
[.NET] Rename several DOTNET6_* variables to to DOTNET_*. (#14463)
Also rename DOTNET_VERSION to SYSTEM_DOTNET_VERSION to make it clear what it's
referring to (and to not clash with DOTNET6_VERSION which has now been renamed
to DOTNET_VERSION).

.NET 7 is right around the corner.
2022-03-23 08:07:34 +01:00
Rolf Bjarne Kvinge d886a6d19b [tests] Update tests to cope with app extensions signed at a different moment during the build.
App extensions are now signed when the main app is signed (and not by themselves),
which means that in tests we can't assert that. So remove those asserts, and instead
add asserts to verify that app extensions are signed when the main app is signed.
2022-03-22 16:14:07 +01:00
Rolf Bjarne Kvinge a2c3d7d225 [tests] We can't call dsymutil/strip on static libraries, so mark them as such. 2022-03-22 16:14:07 +01:00
Rolf Bjarne Kvinge a04e653d24 [tests] Augment .NET tests to verify .dSYM presence at the end of a build 2022-03-22 16:14:26 +01:00
Rolf Bjarne Kvinge e5c81564e2 [msbuild/dotnet] Rework how we handle app bundle post processing. Fixes #14067.
Change dSYM generation and native stripping to occur immediately before code signing,
in a newly minted post processing target.

Challenges:

* Both calling 'strip' and 'codesign' on an executable modifies that executable,
  which means that we must make sure to not call 'dsymutil' on the same binary at
  a later point unless it's been rebuilt.
* Thus we must make sure to update 'dsymutil's stamp file whenever we call 'strip'
  and/or 'codesign' on an executable.
* Just like for code signing, we must store the libraries (either static or dynamic)
  we post process in extension/watch/rid-specific projects, so that these libraries
  can be loaded in containing projects and processed there.
* In universal .NET builds, debug symbols are created for the universal app bundle,
  not for each rid-specific version of the app bundle. So I had to add logic to create
  the native symbol lists (MtouchSymbolsList) for each rid-specific build, but then
  collect them and merge those lists for the universal app bundle.

The existing SymbolStrip call we did right after linking the native executable has
been removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/14067.
2022-03-22 16:14:26 +01:00
Rolf Bjarne Kvinge 6c30c3ab22 [msbuild] Save/restore all the NativeReference metadata.
* Save all the NativeReference metadata in binding resource packages.
* Copy all the NativeReference metadata to new items when resolving native references.

This makes it possible to set custom metadata on NativeReferences, and have that
metadata show up when it's needed, which might not be in the same project (for instance
if the native reference is in a binding project, we might want the custom metadata
when we load the native references from the binding project's resource package -
another case is when app extensions have native references, we might want any custom
metadata in the main executable project to know how to handle certain types of native
references).

Also sort the metadata we write to binding resource packages, so that the output
is stable. This required updating the corresponding tests.
2022-03-22 16:14:07 +01:00
Rolf Bjarne Kvinge 7d500da2bf
[msbuild] Rework code signing. (#14387)
The main theme here is that code signing will be done in the outermost
executable project, not in any app extension projects or watch projects, nor
during the RID-specific build of a .NET universal app. This makes codesigning
easier to reason about and other affected logic (such as strip/dsymutil)
easier to handle, in particular for .NET universal apps. Another benefit is
that the differences between the iOS and macOS code bases have been
eliminated.

The first step is to collect all the information we need from the targets
files. Every app bundle (be it app extension, watch app or main app) will add
its own output app bundle (.app/.appex) to the _CodesignBundle item group.
Then every app bundle will load this informarion from referenced app bundles,
and finally store this information on disk (in the 'codesign-bundle.items'
file). This means that in the end the main app bundle will have a list of all
contained app bundles in the app (recursively), in the _CodesignBundle item
group.

Separately we keep a list of other items that need signing, in the
_CodesignItems item group, and we do the same store/load logic for every
contained/contained app bundle (in the 'codesign.items' file, so a the end the
main app bundle will have a list of all the _CodesignItems for all contained
app bundles (recursively).

The previous steps occur in the _CollectCodesigningData and
_StoreCodesigningData targets.

The next step is to use the new ComputeCodesignItems task to compute
everything we need to know for code signing. This task takes over the
responsibility for listing all the *.dylib and *.metallib files, and the
*.framework directories in the app bundles, that need signing (which was
previously done in the targets file). This logic is significantly easier to
write, debug and test in C# than MSBuild.

In addition the ComputeCodesignItems also figures out a stamp file path we use
to determine if something needs (re-)signing. Previously .framework
directories did not have a stamp location, so they'd always end up resigned in
a rebuild, while now we'll automatically skip signing *.framework directories
unless something changed in them.

I've also tried to comment everything thorougly, for the next poor soul having
to deal with any bugs.

Behavioral differences:

* We were always signing *.dylib files for macOS. We're now doing the same
  thing for all platforms.
* We're now always signing *.framework directories for all platforms (like we
  do for *.dylib files), since frameworks are pretty much like dylibs anyways.

I've verified that this works both by running the submission tests and running
and launching a sample project on device from Windows.
2022-03-22 12:53:58 +01:00
Rolf Bjarne Kvinge e369f466f7
[dotnet] Rename the DOTNET6 make variable to DOTNET. (#14441)
This is the follow-up to where the DOTNET variable was renamed SYSTEM_DOTNET.
2022-03-21 15:56:57 +01:00
Rolf Bjarne Kvinge 4fadad76af
[tests] Add better diagnostics for failure to parse json document in AssetTest. (#14439)
Ref: https://github.com/xamarin/maccore/issues/2559
2022-03-21 12:15:36 +01:00
Rolf Bjarne Kvinge 0280c3d9f1
[tests] Augment TestRuntime.IgnoreInCI to detect Azure DevOps. Fixes #2557. (#14440)
Fixes https://github.com/xamarin/maccore/issues/2557.
2022-03-21 12:10:50 +01:00
Rolf Bjarne Kvinge bf05f39f37
[xtro] Unify the <platform>-CHIP.ignore files into a common-CHIP.ignore file. (#14401) 2022-03-21 10:16:07 +01:00
Rolf Bjarne Kvinge d3643414e7
[dotnet] Rename the DOTNET make variable to SYSTEM_DOTNET. (#14416)
This makes it line up with our other make variables (SYSTEM_MSBUILD,
SYSTEM_MONO, SYSTEM_CSC, etc.), and also prepares for removing the version
from the DOTNET6 variable (so that it becomes just DOTNET).
2022-03-17 10:26:59 +01:00
Rolf Bjarne Kvinge 2afb9fc40e
[tests] Print labels after each MSBuild test when running from the command line. (#14428)
The advantage of writing the label after each test is that the test result will also
be printed, which means it's possible to see if any tests failed during the test
run, as opposed to having to wait until the entire test run is completed (which can
take a while) to realize that pretty much every test failed with some silly mistake
which could have been quickly fixed before re-running the tests.
2022-03-17 10:12:32 +01:00
Rolf Bjarne Kvinge ee60f025ba
[tests] Improve an assert message slightly. (#14429) 2022-03-17 10:07:32 +01:00
Rolf Bjarne Kvinge 1c261ff741
[tests] Make a few .NET tests a bit less noisy. (#14430) 2022-03-17 10:02:39 +01:00
Rolf Bjarne Kvinge 3d05542677 [msbuild] Rework code signing.
The main theme here is that code signing will be done in the outermost executable
project, not in any app extension projects or watch projects, nor during the RID-specific
build of a .NET universal app. This makes codesigning easier to reason about and
other affected logic (such as strip/dsymutil) easier to handle, in particular for
.NET universal apps. Another benefit is that the differences between the iOS and
macOS code bases have been eliminated.

The first step is to collect all the information we need from the targets files.
Every app bundle (be it app extension, watch app or main app) will add its own output
app bundle (.app/.appex) to the _CodesignBundle item group. Then every app bundle
will load this informarion from referenced app bundles, and finally store this information
on disk (in the 'codesign-bundle.items' file). This means that in the end the main
app bundle will have a list of all contained app bundles in the app (recursively),
in the _CodesignBundle item group.

Separately we keep a list of other items that need signing, in the _CodesignItems
item group, and we do the same store/load logic for every contained/contained app
bundle (in the 'codesign.items' file, so a the end the main app bundle will have
a list of all the _CodesignItems for all contained app bundles (recursively).

The previous steps occur in the _CollectCodesigningData and _StoreCodesigningData
targets.

The next step is to use the new ComputeCodesignItems task to compute everything we
need to know for code signing. This task takes over the responsibility for listing
all the *.dylib and *.metallib files, and the *.framework directories in the app
bundles, that need signing (which was previously done in the targets file). This
logic is significantly easier to write, debug and test in C# than MSBuild.

In addition the ComputeCodesignItems also figures out a stamp file path we use to
determine if something needs (re-)signing. Previously .framework directories did
not have a stamp location, so they'd always end up resigned in a rebuild, while now
we'll automatically skip signing *.framework directories unless something changed
in them.

I've also tried to comment everything thorougly, for the next poor soul having to
deal with any bugs, as well has adding a comprehensive test for the new task.

Behavioral differences:

* We were always signing *.dylib files for macOS. We're now doing the same thing
  for all platforms.
* We're now always signing *.framework directories for all platforms (like we do
  for *.dylib files), since frameworks are pretty much like dylibs anyways.
2022-03-16 21:00:15 +01:00
Rolf Bjarne Kvinge dfa9ce986a
[xharness] Ignore case when comparing node names. (#14397)
MSBuild is case-insensitive, so xharness needs to be the same way.

This fixes an issue where xharness would not process 'CodeSignEntitlements'
properties, because xharness was looking for 'CodesignEntitlements'
properties.
2022-03-16 20:59:59 +01:00
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