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

5605 Коммитов

Автор SHA1 Сообщение Дата
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
Rolf Bjarne Kvinge 6fe346e004
[tests] Remove some dead code. (#13558) 2021-12-14 17:05:53 +01:00
Rolf Bjarne Kvinge 61bf0a804b
[tests] Remove a few useless Assert.Inconclusive calls at the end of test methods. (#13559)
There's no reason to call Assert.Inconclusive at the end up a test method,
because we won't get that far in the test method if it fails.
2021-12-14 17:05:18 +01:00
Rolf Bjarne Kvinge ed1c769017
[tests] Remove dead code from test that's already ignored (#13555) 2021-12-14 17:04:17 +01:00
Rolf Bjarne Kvinge a93d76304e
[src] Modify some logic for Mac Catalyst that tests the current runtime architecture (Runtime.Arch) to behave like macOS instead (which doesn't check Runtime.Arch). (#13536) 2021-12-14 08:26:14 +01:00
Rolf Bjarne Kvinge d0f33c7931
[msbuild] Fix merging of apps with symlinks to directories. (#13546)
Symlinks to directories are treated the same as other symlinks (as files), not
as directories. This way we don't end up re-creating a directory hierarchy
when we only have to create a symlink.
2021-12-14 08:10:23 +01:00
Rolf Bjarne Kvinge c93cd3a99c
[Metal] Usher the Metal API into the golden age of .NET. (#13533)
* Change all XAMCORE_4_0 conditions to NET conditions.
* Add numerous Release attributes that xtro started complaining about.
* Misc other minor API changes/updates.
2021-12-13 20:40:29 +01:00
Rolf Bjarne Kvinge aa3a17dfc9
[tests] Update the MT4162_dotnet to use new-style .NET availability attributes. Fixes #13517. (#13519)
Fixes https://github.com/xamarin/xamarin-macios/issues/13517.
2021-12-10 08:10:59 +01:00
Rolf Bjarne Kvinge ec94be597e
Use the '.NET 6 MAUI' channel for dotnet/runtime bits. (#13504)
We are in a situation where:

1. .NET MAUI is still in preview
2. We need dotnet/runtime fixes for MAUI, but we don't necessarily want all fixes to go into the .NET 6 service release.

The solution is to simplify use different builds/packs from dotnet/runtime.

Ref: https://github.com/xamarin/xamarin-android/pull/6542
2021-12-10 07:43:03 +01:00
Manuel de la Pena 45340e80f7
[Tests] Fix the retrieval of variables in .Net after quotes were added. Fixes #13516 (#13522)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-12-09 20:28:35 -05:00
Rolf Bjarne Kvinge a94e575806
[tools] Unify Application.link_flags and Application.gcc_flags from mtouch and mmp into Application.CustomLinkFlags. (#13509)
* [tools] Unify Application.link_flags and Application.gcc_flags from mtouch and mmp into Application.CustomLinkFlags.

* [tests] Update mtouch tests according to mtouch changes.
2021-12-09 17:16:45 +01:00
Rolf Bjarne Kvinge 169b851e63 [link sdk] Update test to work on macOS as well. 2021-12-09 16:08:47 +01:00
Rolf Bjarne Kvinge 52072f02e7 [link sdk] Update test according to recent dotnet/runtime changes. 2021-12-09 07:55:51 +01:00
Rolf Bjarne Kvinge 15a7216aa8
[ObjCRuntime] Remove deprecated availability attribute API from .NET. (#13433)
* [ObjCRuntime] Remove deprecated availability attribute API from .NET.

They're quite useful for binding code though, so instead of removing them completely,
make them binding-only attributes (like numerous other binding attributes we have)
for .NET.

* [src] Remove removed attributes from the list of attributes that should be removed by the linker.

* [tests] Update tests to not use the old attributes for .NET.
2021-12-09 07:41:07 +01:00
Manuel de la Pena 94b75d71c0
[CI] Ensure that we do have quotes in a variable with several values. (#13511) 2021-12-08 17:13:26 -05:00
Rolf Bjarne Kvinge b3c6218c5f
[msbuild] Improve logic to clean up the app bundle for macOS and Mac Catalyst apps before signing. (#13479)
There can't be any files in the root directory of the app bundle for macOS and
Mac Catalyst, otherwise code signing will fail. The problem is that Mono will
create a crash report in the current directory if the process crashes, and the
current directory is the root directory of the app bundle, which means that if
running an app crashes, the next build will likely fail because of the crash
report.

We had logic to detect this and remove any crash reports, but our crash report
detection pattern wasn't good enough and let some files through. This PR
updates that pattern, and also improves the code to report warnings for any
other files in the app bundle's root directory.
2021-12-07 21:33:22 +01:00
Rolf Bjarne Kvinge 90b8e89859
[src] Remove System.nint and System.nuint from .NET. Fixes #10508. (#13490)
* Remove System.nint and System.nuint from .NET
* Add support for C#'s nint/nuint types to the generator.
* Accept IntPtr/UIntPtr as target types for BindAs attributes for NSNumber conversions.
* Fix a few APIs to take/return NativeHandle instead of IntPtr.

Fixes https://github.com/xamarin/xamarin-macios/issues/10508.
2021-12-07 21:12:46 +01:00
Rolf Bjarne Kvinge 39bdae2b7f
[monotouch-test] Ignore a few tests in non-ARM64 simulators. (#13487)
* [monotouch-test] Ignore a few tests in non-ARM64 simulators.

Some tests fail when running on an M1, but in a x64_86 mode, so just ignore
those unless we're running on ARM64 (this will currently exclude them on
x86_64 hardware too, but that'll eventually not be a problem anymore when
there's no more x86_64 hardware, and just checking for ARM64 is easier than
checking for x86_64 mode on an ARM64 CPU).

* Make more legacy projects unsafe.
2021-12-07 21:10:39 +01:00
Přemek Vysoký 27cd6f78c3
[xharness] Compare the `TestExecutingResult.TimedOut` flag only (#13498) 2021-12-06 14:13:47 -05:00
Rolf Bjarne Kvinge d7d2409dc0 [tests] Adjust cecil-tests according to nint/nuint changes. 2021-12-03 18:36:36 +01:00
Rolf Bjarne Kvinge 61b897e054 [xtro] Update. 2021-12-03 18:26:22 +01:00
Rolf Bjarne Kvinge d2383796d4
[xharness] Add nullability to the TestProject class. (#13489)
Also simplify some code elsewhere to make that easier.
2021-12-03 18:24:03 +01:00
Rolf Bjarne Kvinge 39ab97113c
[src] Adjust numerous APIs to take/return NativeHandle instead of IntPtr for .NET. (#13488)
* [Foundation] Make numerous CFArray and NSArray APIs take/return NativeHandle instead of IntPtr.

* [src] Fix a lot of other cases of IntPtr -> NativeHandle.

This is just fallout from the CFArray/NSArray in the previous commit.
2021-12-03 07:58:29 +01:00
Rolf Bjarne Kvinge 44feba841e
[dotnet] Check for the x64 version of .NET. (#13481)
Check for the x64 version of .NET to see if it's installed if the default
dotnet location doesn't exist (the x64 version will exist on an ARM64 mac when
installing the x64 version of .NET).

Also allow the .NET unit tests to be executed using any recentish version of
.NET.
2021-12-03 07:56:23 +01:00
Rolf Bjarne Kvinge f8b6699ab2 Merge remote-tracking branch 'origin/main' into arm64-sim 2021-12-02 09:38:36 +01:00
Rolf Bjarne Kvinge 3f44ad5d6c [tests] Fix platform for test to actually make the test work. 2021-12-02 09:02:42 +01:00
Rolf Bjarne Kvinge 5cc92ac564
[src] Add a new ObjCRuntime.NativeHandle type to represent native handles for .NET. Fixes #13126. (#13356)
Add a new struct, ObjCRuntime.NativeHandle, which will be used to represent
native handles for .NET (instead of using IntPtr). The main purpose is to be
able to use 'nint' as a number in API while not being prevented from using
native handles as well.

One example is NSMutableString, which has a constructor that takes a single
'nint capacity' parameter. With this change, we'll also be able to have a
constructor that takes a native handle in .NET - otherwise we'd have two
constructors with the same signature, because a C# 'nint' is just an 'IntPtr'.

This change required numerous changes pretty much everywhere. The work is
split up in commits as well as I was able to, and each commit explains what it
does.

Fixes https://github.com/xamarin/xamarin-macios/issues/13126.
2021-12-02 08:38:39 +01:00
Rolf Bjarne Kvinge 941507525e
[tests] Unify .NET test projects (#13474)
* Make the .NET project files for BundleResources and EmbeddedResources follow
  the pattern of all the other test projects.
* Move the LangVersion and AllowUnsafeBlocks propertieso to the shared project
  file.
2021-12-01 20:00:14 +01:00
Rolf Bjarne Kvinge 9cf5964860 [tests] Update .NET unit tests to be aware that we can build for simulator/arm64 now. 2021-12-01 19:59:38 +01:00
Rolf Bjarne Kvinge 9d79dada8b
[AppKit] Add NSKey back to the .NET profile. (#13477)
It turns out the enum is used a bit more than I thought.

Ref: https://discord.com/channels/732297728826277939/732297808148824115/913810268939759626
2021-12-01 17:30:04 +01:00
Rolf Bjarne Kvinge fcaf5f3c9f
[tests] Fix checking availability for .NET. (#13470)
Change the logic to detect if an API is available to:

* First check if there are any applicable UnavailableOSPlatform attributes,
  and only if an applicable attribute is found, then state that the API is
  unavailable (we can't ascertain that an API is available from an
  UnavailableOSPlatform attribute, only that it's unavailable).
* Once we know there are no applicable UnavailableOSPlatform attributes, we go
  on to check for applicable SupportedOSPlatform attributes, and if one is
  found, then we can say whether the API is available or not.
* If neither attributes were found, and we're building for Mac Catalyst, then
  repeat the two above checks for iOS instead.
* If still nothing, then assume the API is available (while incorrect, it's
  how our attributes are currently implemented).

This fixes introspection showing numerous test failures on older OS versions,
because we were detecting availability wrong - we were assuming that if
there's an UnavailableOSPlatform attribute whose version didn't match the OS
version, that the API was available (test case that proves this logic is
incorrect: OS version = 1.0, API introduced in 2.0, API unavailable in 3.0
- we'd detect that OS version 1.0 < unavailable in 3.0, and say "yay, we're
not unavailable, so we must be available!").
2021-12-01 17:29:20 +01:00
Rolf Bjarne Kvinge f26dedd046 [monotouch-test] Set the AOT define if we're building for ARM64 in the simulator.
Also set DYNAMIC_REGISTRAR if we're targeting the simulator.
2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge b0a4dbfe91 [xharness] Add arm64/simulator variations for introspection and monotouch-test 2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge 8bf7b663be [tests] Build test libraries for [ios|tvos]simulator-arm64
This turned out a bit complicated, because we're lipo'ing together both the simulator
and device slices, and that doesn't work anymore when ARM64 is both a simulator and
a device architecture. The solution is a custom lipo logic that doesn't include the
simulator version of the ARM64 architecture in the final binary.
2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge 78f52e2fc2
[msbuild/tests] Add support for xcframeworks with static libraries in them. (#13459)
* [tests] Create a libtest.xcframework and libtest2.xcframework

* [tests] Make bindings-test and bindings-test2 use an xcframework instead of plain static library

* [msbuild] Add support for xcframeworks with static libraries in them.

* List the frameworks libtest needs.

* [tests] Update .NET unit tests according to test project changes.

* [tests] Add new test to verify that packing an old-style binding project doesn't work.
2021-11-30 18:19:22 +01:00
Rolf Bjarne Kvinge fb11284785
[src] Remove the Xamarin.iOS.dll reference assembly for Mac Catalyst. (#13455)
* [src] Remove the Xamarin.iOS.dll reference assembly for Mac Catalyst.

Xamarin.iOS.dll won't be compatible with Mac Catalyst in .NET 6 (because there
won't be any backwards compatibility), so we don't need the assembly that has
type forwarders to Xamarin.MacCatalyst.dll.

* Bump MonoTouch.Dialog

New commits in migueldeicaza/MonoTouch.Dialog:

* migueldeicaza/MonoTouch.Dialog@4d0e0a9 Remove usages of UIWebView when compiling for Mac Catalyst.

Diff: 5a05c6912e..4d0e0a9a5f

* [tests] There's no NSFileProviderPage in Mac Catalyst.

* [tests] Fix CBUUID link sdk test to work correctly on Mac Catalyst.
2021-11-29 23:14:25 +01:00
Rolf Bjarne Kvinge 2aa21751a6
[dotnet] Show an error if an app developer tries to publish a simulator architecture. (#13462)
* [dotnet] Show an error if an app developer tries to publish a simulator architecture.

* We can't publish a simulator build, so show an error in that case.
* We can't change the default runtime identifier when publishing (to a
  publishable runtime identifier), because by the time we know we're
  publishing, it's too late to change the runtime identifier. This means that
  it'll be required for app developers to specify a runtime identifier when
  publishing to a mobile platform, since the current default runtime
  identifier is for a simulator build.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/12997.

* Fix typo and improve naming.

* [dotnet] Don't use '_UsingDefaultRuntimeIdentifier', it's already used elsewhere in .NET
2021-11-29 23:13:48 +01:00
Rolf Bjarne Kvinge 00482325d1
[src] Add missing availability attributes in a few places. (#13422)
* [src] Add missing availability attributes in a few places.

* [src] Don't add availability attributes to error enums.

* [introspection] Change version check for Mac Catalyst to be 'greater than'.

We have a tests that verifies that the availability attributes for an API
doesn't state that the API was deprecated before or when it was introduced.

This sounds reasonable, except that Apple has introduced and deprecated entire
frameworks in the same Mac Catalyst version (probably because Apple decided to
port an already deprecated framework to Mac Catalyst).

Our test for this scenario was a bit too eager; this change will make it so
that (for Mac Catalyst only), we accept APIs that are introduced and
deprecated in the same Mac Catalyst version (not not APIs that were deprecated
before they were introduced).
2021-11-29 07:58:16 +01:00
Rolf Bjarne Kvinge c02cc7e27d
[introspection] Fix the ApiFrameworkTest.Simlauncher test to fail in case of errors. (#13456)
* Assert at the end of the test if there were any errors.
* Don't run this test for .NET, since we don't use a simlauncher in .NET.
2021-11-26 20:14:38 +01:00
Rolf Bjarne Kvinge 3f9666a8f7
[AppKit] Change NSTextViewDelegate.DraggedCell to use the recommended signature for .NET (#13460)
* [AppKit] Change NSTextViewDelegate.DraggedCell to use the recommended signature for .NET

The 'textView:draggedCell:inRect:event:' selector has been deprecated since
macOS 10.6, so just replace this with the recommended alternative.

* [generator] Make sure code compiles for parameter names that match C# keywords.
2021-11-26 20:02:15 +01:00
Rolf Bjarne Kvinge 19c2765156 [tests][monotouch-test] Adjust code to cope with NativeHandle. 2021-11-26 14:25:21 +01:00
Rolf Bjarne Kvinge ac13861e92 [tests][bgen] Adjust code to cope with NativeHandle. 2021-11-26 14:25:21 +01:00
Rolf Bjarne Kvinge a1d7224c6d [tests][introspection] A few test updates according to the API changes 2021-11-26 14:25:21 +01:00
Rolf Bjarne Kvinge b92f79fe1b [tests][cecil-tests] Add new test to verify the constructors we expose.
Verifies that:

* There shouldn't be any (IntPtr) or (IntPtr, bool) constructors.
* The (NativeHandle) or (NativeHandle, bool) constructors should not be public.
* The constructors correctly chain to the base constructor according to our usual
  pattern: the (IntPtr) ctor must chain to the self/base (IntPtr, bool) constructor
  passing 'false' for the owns parameter.
* The constructors don't have any extra code in them (barring a few exceptions).
2021-11-26 14:25:21 +01:00
Rolf Bjarne Kvinge 2bb5fc88c5
[src] Adjust visibility of numerous (IntPtr) and (IntPtr, bool) constructors (#13444)
* There should be no public (IntPtr) constructor, at most there should be a
  protected one for NSObject subclasses. There should be no such constructors
  for classes that just implement INativeObject.
* There should be no public (IntPtr, bool) constructor at all, they should all
  be internal.
* If changing the visibility or removing the ctor is a breaking change, then
  make it happen for .NET only.
2021-11-26 14:24:05 +01:00
Rolf Bjarne Kvinge b9e8d4869d
[xtro] Don't report missing availability attributes for enums representing errors. (#13445)
* We don't want availability attributes for enums that represent errors,
  because the code would end up unnecessarily complex to avoid warnings.
* We even have other tests to verify as much (cecil tests).
2021-11-26 07:22:58 +01:00
Rolf Bjarne Kvinge 85a9791b51
[tests] Some improvements for the bindings-test2 project for .NET. (#13447)
* Remove the watchOS project, we don't support watchOS for .NET at the moment.
* Rename shared.targets to shared.csproj to match all the other test projects.
* Move a bit more code into the shared project file (shared.csproj).
* Add a Makefile for each platform.
2021-11-26 07:22:34 +01:00
Rolf Bjarne Kvinge d51835b5b3
[AVFoundation] Fix availability for a few enums (#13451)
None of these are deprecated, so no reason for them to not exist in .NET.

Also update the availability attributes according to current headers.
2021-11-26 07:21:30 +01:00
Rolf Bjarne Kvinge 9013c72591
[AppKit] Remove the NSLayoutManager.LayoutOptions property and the NSGlyphStorageOptions enum in .NET. (#13453)
The former has been removed from the headers, so it's thoroughly deprecated,
and the latter is no longer needed anymore since it was only used by the
former.
2021-11-26 07:20:36 +01:00
Rolf Bjarne Kvinge 5ab9883af9
[AppKit] Remove NSAlertType from .NET, it's not used anywhere in our API, and it's deprecated in the headers. (#13454) 2021-11-26 07:20:21 +01:00
Rolf Bjarne Kvinge ce5dd1e61b
[AppKit] Remove NSKey from .NET, it's not used anywhere in our API, nor can I find it in headers. (#13448)
xtro also agrees that it shouldn't exist.
2021-11-25 23:37:48 +01:00
Rolf Bjarne Kvinge cbaead3753
[xtro] Remove unused file. (#13452)
Delete the 'osx.pending' file, it's not used. It looks like it should have
been removed in fffaba2414 (where the *.pending
files for the other platforms were removed).
2021-11-25 23:01:12 +01:00
Rolf Bjarne Kvinge 0c50905fc5
[tests] Fix boolean logic when checking for macOS version between 11.0 and 12.0 (#13446) 2021-11-25 22:35:24 +01:00
Rolf Bjarne Kvinge f52f763fa7 [xtro] Remove support for legacy Mac Catalyst. 2021-11-25 11:48:38 +01:00
Rolf Bjarne Kvinge df4399bbde
[CGImageSource] Change CreateThumbnail to return null if the thumbnail creation fails. (#13443)
Otherwise we'll create a CGImage with a zero Handle, which is usually not the
right thing to do. Still, keep the old behavior for legacy Xamarin for the
sake of backwards compat.
2021-11-25 07:36:24 +01:00
Rolf Bjarne Kvinge f916702568 [xharness] Don't run both legacy and .NET xtro at the same time. 2021-11-25 00:20:22 +01:00
Rolf Bjarne Kvinge 9cba70d183 [xtro] Update annotations. 2021-11-24 17:05:35 +01:00
Rolf Bjarne Kvinge 25b41c7ac3 [xtro] Fix dependencies for the .NET report. 2021-11-24 16:55:13 +01:00
Rolf Bjarne Kvinge 4445606653 [xtro] Run u2todo on the .NET annotations to update annotations according to current API. 2021-11-24 15:39:04 +01:00
Rolf Bjarne Kvinge 0cb2591e1a [xtro] Run autosanitize on the .NET annotations to update annotations according to current API. 2021-11-24 15:39:04 +01:00
Rolf Bjarne Kvinge 70333367a0 [xtro] Adjust the .NET annotations for nfloat and NSWritingDirection move. 2021-11-24 15:39:04 +01:00
Rolf Bjarne Kvinge aac316efbb [xtro] Add .NET annotations. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 14c7909317 [xtro] Have a different map between native and managed enums for .NET and legacy Xamarin.
We've fixed a few managed enum names to match the native counterpart in .NET, which
means we need a different map too.
2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge fc39a0df5b [xtro-sharpie] Detect UnsupportedOSPlatform attributes as a deprecation attribute. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge fa55aab0b2 [xtro] Point to the actual .ignore file location when reporting ?unknown-entry?
This makes the output clearer when we have ignore files in multiple directories.
2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 7e255ddcb5 [xharness] Add support for running xtro in .NET mode. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 234f593511 [xtro] Run on .NET assemblies. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 87c4fb0669 [xtro-report] Honor the input directory in a few places. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 4baa67a07d
[xtro] Improve makefile. (#13424)
* Use proper dependency tracking, so that we'll only rebuild what needs to be rebuilt
  when rebuilding. This required using a few stamp files. It also improves parallel
  builds.
* Remove *.raw files before running xtro-sharpie, and only for the current platform.
  This makes sure rebuilds of just some of the platforms work correctly (because
  the *.raw files for other platforms are still around when needed).
* Build the u2todo project file instead of manually calling csc.
2021-11-24 15:38:10 +01:00
Rolf Bjarne Kvinge 03b352036a
[LocalAuthentication] Adjust code for .NET and fix availability of LAContext.MaxBiometryFailures (#13425)
* LAContext.MaxBiometryFailures is available in macOS, just deprecated, so mark
  it as such.
* Remove deprecated code from .NET.
* Update xtro definitions.
2021-11-24 15:37:56 +01:00
Rolf Bjarne Kvinge 98d7c95020
[MediaPlayer] Remove deprecated/removed API in .NET (#13427)
* [MediaPlayer] Remove deprecated/removed API in .NET

* [tests] Fix monotouch-test according to API changes.
2021-11-24 15:37:23 +01:00
Rolf Bjarne Kvinge 84c147a1db
[tests] Give up on LinkSdkRegressionTest.SpecialFolder on macOS and Mac Catalyst for the Favorites and Fonts folders (#13429)
* [tests] Try to fix LinkSdkRegressionTest.SpecialFolder on macOS 10.15.

* I give up.
2021-11-24 15:37:02 +01:00
Rolf Bjarne Kvinge 2901f7aba6
[tests] Adjust FontTest to cope with broken GameKit/UIKit/fontWithSize on certain macOS versions. (#13428)
Fixes:

    MonoTouchFixtures.UIKit.FontTest
        CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
        CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
            [FAIL] NullFonts :   WithSize
            Expected: not null
            But was:  null
                at MonoTouchFixtures.UIKit.FontTest.NullFonts() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/UIKit/FontTest.cs:line 165
2021-11-24 08:07:30 +01:00
Rolf Bjarne Kvinge ff345ba4eb
[xtro-sanity] Pass the included platforms as command line arguments. (#13420)
This avoids the need to compute them, and makes it possible to have multiple sets
of platforms.
2021-11-22 23:24:25 +01:00
Rolf Bjarne Kvinge 5329b19f62
[introspection] Migrate .NET code to use the new .NET-style availability attributes. (#13363)
* [tools] Extract the logic to parse OSPlatformAttribute platform names to a separate file/class.

* [introspection] Migrate .NET code to use the new .NET-style availability attributes.

This also means using the 'ApplePlatform' enum instead of the 'PlatformName'
enum, because the latter will be removed in .NET.

* [FileProvider] Exclude some deprecated API from .NET.

* [AVFoundation] Adjust availability attribute for AVCaptureStillImageOutput.HighResolutionStillImageOutputEnabled.

* Update tests.
2021-11-22 20:54:07 +01:00
Rolf Bjarne Kvinge b55ee6d521
[xtro] Improve enum check. (#13396)
* Unify the signed and unsigned implementations. We lose some type-safety (because
  we have to use 'object' as the unifying type between long and ulong), but we minimize
  code duplication, so the code becomes easier to maintain.
* Add an additional check for managed enum values that show up in the native header,
  but aren't available on the current platform.
2021-11-22 18:51:12 +01:00
Rolf Bjarne Kvinge 6302878ad5
[runtime] Implement storing the original working directory for later retrieval for .NET. Fixes #13392. (#13403)
This also adds the Runtime.OriginalWorkingDirectory to all platforms.

Fixes https://github.com/xamarin/xamarin-macios/issues/13392.
2021-11-22 18:50:28 +01:00
Rolf Bjarne Kvinge 3c5dfab710
[xtro-sharpie] Add support for specifying the output directory. (#13408)
This makes it possible to have a different output directory for .NET assemblies.
2021-11-22 18:50:17 +01:00
Rolf Bjarne Kvinge 88eb5e1ac8
Rename any *OSX_SDK_VERSION variables to *MACOS_SDK_VERSION. (#13411)
This makes it easier to iterate over all the *_SDK_VERSION variables in
template code, because they're all named using the standard platform names we
use elsewhere.
2021-11-22 18:48:05 +01:00
Rolf Bjarne Kvinge f8305e213f
Bump xharness. (#13406)
To get this fix: 769755cc98
2021-11-22 11:25:51 -05:00
Rolf Bjarne Kvinge 7fb12bc441
[tests] Disable signing in the Xamarin.MTouch.BindingLibraryDSymCreated test. Fixes #13404. (#13405)
The test builds an app that wants to be signed - but that requires signing
certificates. Instead just change the test to not require signing.

Fixes https://github.com/xamarin/xamarin-macios/issues/13404.
2021-11-22 14:18:00 +01:00
Rolf Bjarne Kvinge 8c942aac1c
[xtro-report] Report the html file we created. (#13409) 2021-11-22 08:06:01 +01:00
Rolf Bjarne Kvinge ec045766ca
[AVFoundation] Remove the AVMediaType enum and the AVMediaTypes.TimedMetadata field from .NET. (#13368) 2021-11-19 08:53:51 +01:00
Rolf Bjarne Kvinge eaef8d4da6
[xtro] Fix typo in comment. (#13384) 2021-11-19 08:51:22 +01:00
Rolf Bjarne Kvinge b99f0a7798
[xtro] Rename 'XMAC*'/'XCAT*/ to 'XMACOS*'/'XMACCATALYST*' to follow the OS naming pattern. (#13391)
This makes it easier to use templated code.
2021-11-19 08:13:43 +01:00
Rolf Bjarne Kvinge d1b5507111
[xtro] Skip numerous validations for deprecated API. (#13383)
There are numerous checks that don't make much sense to report for deprecated
API, so skip those. This also required updating a few .ignore and .todo files.
2021-11-18 16:26:30 +01:00
Rolf Bjarne Kvinge 7d7bc8d25d
[tests] Don't run SCNViewTests on a VM. (#13388)
Hopefully fixes this crash:

    0x7fff6fbad5fd - /usr/lib/system/libsystem_platform.dylib : _sigtramp
    0x354861360 - Unknown
    0x7fff71fb9707 - /System/iOSSupport/System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit : C3DEngineContextSetRenderContext
    0x7fff720802c0 - /System/iOSSupport/System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit : -[SCNRenderer _initWithOptions:isPrivateRenderer:privateRendererOwner:clearsOnDraw:context:renderingAPI:]
    0x7fff72126352 - /System/iOSSupport/System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit : -[SCNView _commonInit:]
    0x7fff72126551 - /System/iOSSupport/System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit : -[SCNView initWithFrame:options:]
2021-11-18 15:38:46 +01:00
Rolf Bjarne Kvinge 118bcc148d
[tests] Remove a few unused make variables. (#13375) 2021-11-17 08:05:26 +01:00
Rolf Bjarne Kvinge e08cbbb8a9
[tests] Add the compiler response files from src/ to the .NET test builds. (#13351)
This means that the HAS_<FRAMEWORK> defines will now work in .NET test code
(as it already does in legacy test code).
2021-11-17 08:01:31 +01:00
Rolf Bjarne Kvinge bbb7632e24
[tests] Automatically run/exit tests executed from the command line. (#13360)
This is already the default for macOS apps, but this way it behaves the same
for Mac Catalyst as well.
2021-11-16 18:01:41 +01:00
Rolf Bjarne Kvinge 6d321c9f77
[tests] Don't import nunit.frameworks.target more than once. (#13362)
The nunit.framework.targets file is already imported in the
tests/common/shared-dotnet.targets file, which all these files imports as
well.
2021-11-16 16:46:08 +01:00
Rolf Bjarne Kvinge 769482018c
[tests] Create a binlog for the mtouch tests (#13357) 2021-11-16 14:20:31 +01:00
Rolf Bjarne Kvinge 66e596e9d9
[tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350)
The PlatformName enum will be removed from .NET soon.
2021-11-15 08:06:36 +01:00
Rolf Bjarne Kvinge 7a76bbeb64
[tools] HomeKit was added to Mac Catalyst in 14.0, so mark it as such. (#13333)
* [tools] HomeKit was added to Mac Catalyst in 14.0, so mark it as such.

Fixes this launch crash when executing on macOS 10.15:

    dyld: Library not loaded: /System/iOSSupport/System/Library/Frameworks/HomeKit.framework/Versions/A/HomeKit
      Referenced from: /Users/runner/work/1/s/artifacts/mac-test-package/tests/./linker/ios/dont link/dotnet/MacCatalyst/bin/Debug/net6.0-maccatalyst/maccatalyst-x64/dont link.app/Contents/MacOS/dont link
      Reason: image not found

* [introspection] Skip the default SKView constructor on all platforms, not only macOS.

Fixes a crash on Mac Catalyst.

* Fix SKView skipping logic.
2021-11-15 08:04:56 +01:00
Rolf Bjarne Kvinge a1768573e3
[introspection] Remove a few version checks which are now constant values. (#13348)
* Mac.Is32BitMavericks is always false (we only run on 64-bit macOS), so remove corresponding code.
* Mac.IsElCapitanOrHigher is never used; remove
* Remove a few unused Mac.Version_* fields.
2021-11-15 07:57:39 +01:00
Rolf Bjarne Kvinge ac6f75b55a
[EmbeddedResources] Add helper makefiles for .NET testing. (#13349) 2021-11-12 16:26:42 +01:00
Rolf Bjarne Kvinge a2e2fef0c2
[introspection] Fix macOS 10.15 version checks. (#13315)
The logic seems to want to verify MPSPredicate on maOS 10.14, but not on macOS
10.15+. But checking for macOS 10.14 is always successful on macOS 10.15+,
which means that we can't check for macOS 10.14 before checking macOS 10.15.
So I moved the macOS 10.14 check to after the macOS 10.15 check, but that made
the macOS 10.14 check redundant, because both branches of the condition did
the same thing, so I removed the whole check.

Fixes this introspectionf failure:

    [FAIL] DefaultCtorAllowed :   1 potential errors found in 1387 default ctor validated:
        Default constructor not allowed for MetalPerformanceShaders.MPSPredicate : Could not initialize an instance of the type 'MetalPerformanceShaders.MPSPredicate': the native 'init' method returned nil.
2021-11-11 16:07:51 +01:00
Rolf Bjarne Kvinge 06295499ed
[mtouch/mmp/dotnet-bundler] Rework getting the availability attributes so that it works for .NET as well. (#13327)
* Stop using AvailabilityBaseAttribute, this type will disappear in .NET.
* Handle System.Runtime.Versioning.SupportedOSPlatformAttribute instead of our own availability attributes for .NET.
* Add tests (somewhat hacked together, but they work).
2021-11-10 22:55:12 +01:00
Rolf Bjarne Kvinge a8bf64b053
[CoreServices] Fix FSEventStream to properly pass the managed context to the FSEventStreamCreate method. Fixes #13325. (#13329)
The FSEventStreamCreate method takes a pointer to a structure with context information,
which contains a user-defined pointer value in addition to a few callbacks. Previously
we were passing the GCHandle as a pointer to this structure, which is obviously quite
wrong (as evidenced by a native crash when calling FSEventStreamCreate).

Changes:

* Modify the code to provide the expected context structure instead with the GCHandle
  as a field in that structure.
* Add a release callback to the context structure to release the GCHandle.
    * This avoids the need for storing the GCHandle as a field in the FSEventStream instance.
    * It also avoids also the need for overriding Dispose to release said GCHandle.
* Modify the callback code to use the [UnmanagedCallersOnly] attribute for .NET
  (ref: #10470).

This was a regression introduced in 8c99bdc9ad.

Fixes https://github.com/xamarin/xamarin-macios/issues/13325.
2021-11-10 11:13:28 -05:00
Rolf Bjarne Kvinge f4a5bf2720
[SystemSound] Don't implement the INativeObject interface for .NET. (#13324)
The supposed handle for system sounds is an uint, which does not match the
IntPtr handle INativeObject uses, so remove the INativeObject interface from
the SystemSound class.
2021-11-10 11:41:50 +01:00
Rolf Bjarne Kvinge 1f9b80da49
[tests] Fix macOS 10.15+ version check for Mac Catalyst to actually work. (#13317)
Make needs twice the amount of dollars to do the right thing.
2021-11-09 15:59:56 +01:00
Rolf Bjarne Kvinge 4fb86e70e0
[tests] Fix checking for sub-test failures in packaged macOS tests. (#13318)
Any failure stamp files are deleted before the failing target exists, so
checking for failure stamp files at a later point won't work.
2021-11-09 15:59:14 +01:00
Rolf Bjarne Kvinge bbb7690e1a
[Security] Remove the SslCipherSuite enum from .NET. Fixes #11498. (#13307)
* Remove the SslCipherSuite enum from .NET, it's complicated to implement
  correctly on macOS for both x64 and arm64, and it's also obsolete, so just
  remove it.
* Change the type for NSUrlSessionTaskTransactionMetrics.NegotiatedTlsCipherSuite
  to be TlsCipherSuite instead of SslCipherSuite for .NET (this is in fact the
  correct value according to the headers).

Fixes https://github.com/xamarin/xamarin-macios/issues/11498.
2021-11-08 22:09:47 +01:00
Rolf Bjarne Kvinge e088ceecff
[CoreBluetooth] Use new availability attributes and remove API that isn't in Apple's headers from .NET. (#13293)
* Change all XAMCORE_4_0 defines to NET defines to get the new API version in
  .NET.
* Remove some dead code.
* Change all the old-style [Availability] attributes to new-style [Obsoleted]
  or [Deprecated].
* Adjust tests.
2021-11-08 21:32:18 +01:00
Manuel de la Pena ff6209c844
[Network] Implement all bindings up to Xcode 13.1 (#13135)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-11-08 11:37:47 -05:00
Rolf Bjarne Kvinge 1713d7dd6a
[WatchKit] Remove the WatchKit framework from iOS in .NET. (#13299)
Apple removed it from iOS a few years ago.
2021-11-08 16:17:26 +01:00
Rolf Bjarne Kvinge 02f10a6583
[AppKit] Remove NSMenuView from .NET (it's a 32-bit only type). (#13291) 2021-11-08 16:15:41 +01:00
Rolf Bjarne Kvinge 08c1dca26a
[AppKit/Foundation/UIKit] Use Foundation.NSWritingDirection instead of UIKit.UITextWritingDirection and AppKit.NSWritingDirection for .NET. Fixes #6573. (#13243)
Fixes when building with XAMCORE_4_0:

> uikit.cs(6775,3): error CS0246: The type or namespace name 'UITextWritingDirection' could not be found (are you missing a using directive or an assembly reference?)
> uikit.cs(6597,3): error CS0246: The type or namespace name 'UITextWritingDirection' could not be found (are you missing a using directive or an assembly reference?)
> uikit.cs(6601,41): error CS0246: The type or namespace name 'UITextWritingDirection' could not be found (are you missing a using directive or an assembly reference?)

Fixes https://github.com/xamarin/xamarin-macios/issues/6573.
2021-11-05 08:12:44 +01:00
Rolf Bjarne Kvinge e965cf761e
[CGPDFObject] Make CGPDFObject a subclass of CGPDF[Array|Dictionary|Stream] + a few other fixes. (#13253)
* Make CGPDFObject a common subclass for the CGPDF[Array|Dictionary|Stream]
  classes, and keep the object lifetime code there.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use 'nameof (parameter)' instead of string constants.
* Make any (IntPtr) constructors internal for .NET
* Simplify block creation code a bit.
2021-11-04 16:33:30 +01:00
Manuel de la Pena bd24746226
[Xtro] Fix xtro after a bad commit. (#13271) 2021-11-04 15:20:38 +01:00
Rolf Bjarne Kvinge 2da529c328
[CGImageMetadataTag] Subclass NativeObject + numerous other code updates (#13240)
* [CGImageMetadataTag] Subclass NativeObject + numerous other code updates

* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Use the 'Runtime.GetNSObject<T> (IntPtr, bool)' overload to specify handle
  ownership, to avoid having to call NSObject.DangerousReleaes manually later.
* Remove the (IntPtr) constructor for .NET
* Fix nullability attribute.

* [tests] Don't dispose a property value.

It ends up being the object instance we've stored elsewhere, which we don't
expect to be disposed.
2021-11-04 14:54:06 +01:00
Rolf Bjarne Kvinge 696e7a5679
[ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere. (#13231)
* [ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere.

The PlatformHelper class is deprecated, so implement a new version that isn't
deprecated, and which shares a similar API between all platforms - the Check*
methods includes the name of the platform, because that makes it clearer which
version we're talking about from the call site. There's a quirk though:
there's no separate ChecktvOS or CheckMacCatalyst, because the system version
is the same as for iOS, so we can just use 'iOS'.

For macOS we can now use NSProcessInfo.ProcessInfo.OperatingSystemVersion to
determine the OS version, because it's supported in all versions of macOS we
support for .NET.

Fixes issues such as this when building with XAMCORE_4_0:

> CoreMedia/CMSync.cs(590,11): error CS0103: The name 'PlatformHelper' does not exist in the current context

* Bring back PlatformHelper.CheckSystemVersion, but only for !NET.

* [tests] Remove 32-bit macOS logic, it's long dead.

* [introspection] Implement OS version check using 'NSProcessInfo.ProcessInfo.IsOperatingSystemAtLeastVersion' for macOS.

* [monotouch-test] Use TestRuntime.[Check|Assert]XcodeVersion instead of PlatformHelper.CheckSystemVersion.
2021-11-04 11:13:23 +01:00
Manuel de la Pena ea0ee04f30
[CoreAnimation] Add support for Xcode 13.1 rc. (#13227)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-11-03 18:52:48 -04:00
Manuel de la Pena b328512073
[Tests] Remove not needed usings in the CoreImage & CoreLocation tests. (#13256) 2021-11-03 17:24:44 -04:00
Manuel de la Pena ee3cfa63bb
[Tests] Remove not needed usings in the CoreGraphics tests. (#13255) 2021-11-03 17:13:47 -04:00
Manuel de la Pena 992afaf971
[Tests] Remove not needed usings in the CoreBluetooth and CoreAudioKit tests. (#13252) 2021-11-03 16:50:09 -04:00
Manuel de la Pena 86ac68fc31
[Tests] Remove not needed usings in the CoreData and CoreFoundation tests. (#13254) 2021-11-03 16:48:48 -04:00
Manuel de la Pena 88cf4b0c17
[Tests] Remove not needed usings in the Contacts tests. (#13250) 2021-11-03 16:42:06 -04:00
Manuel de la Pena 44a1b37abf
[Tests] Remove not needed usings in the Compression tests. (#13249) 2021-11-03 16:38:08 -04:00
Manuel de la Pena 8e62275615
[Tests] Remove not needed usings in the CoreAnimation tests. (#13251) 2021-11-03 16:37:28 -04:00
Manuel de la Pena 26a90c9ab3
[Tests] Remove not needed usings in the BGTasks tests. (#13248) 2021-11-03 16:37:14 -04:00
Manuel de la Pena 0a4a6736e9
[Tests] Remove not needed usings in the AVFoundation tests. (#13247) 2021-11-03 16:35:51 -04:00
Manuel de la Pena 42fcb4f1c5
[Tests] Remove not needed usings in the Network tests. (#13232) 2021-11-03 10:34:34 -04:00
Manuel de la Pena 69be49194e
[Tests] Remove not needed usings in the AudioToolboc tests. (#13234) 2021-11-03 10:34:02 -04:00
Manuel de la Pena 70936c3fcd
[Tests] Remove not needed usings in the AudioUnit tests. (#13235) 2021-11-03 10:33:42 -04:00
Manuel de la Pena 3b47f94f94
[Tests] Remove not needed usings in the Foundation tests. (#13233) 2021-11-03 10:33:17 -04:00
Manuel de la Pena f732d4faee
[PdfKit] Add missing enum. (#13198) 2021-11-02 10:42:43 -04:00
Manuel de la Pena 8e0a7c8b52
[QuickLook] Add missing selectors for Xcode 13.1 (#13200) 2021-11-02 10:42:20 -04:00
Rolf Bjarne Kvinge 545a4874f8
[SecIdentity] Subclass NativeObject + numerous other code updates (#13149)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Use the 'Runtime.GetNSObject<T> (IntPtr, bool)' overload to specify handle
  ownership, to avoid having to call CFObject.CFRelease manually later.
* Use Array.Empty<T> instead of creating an empty array manually.
* Remove the (IntPtr) constructor for .NET.
2021-11-02 07:48:55 +01:00
Rolf Bjarne Kvinge 8e150c5bfe
[xharness] Bump to the latest version of Microsoft.DotNet.XHarness.iOS.Shared (1.0.0-prerelease.21527.2). (#12899)
* [xharness] Bump to the latest version of Microsoft.DotNet.XHarness.iOS.Shared (1.0.0-prerelease.21479.1).

* [xharness] Handle an exceptional condition when we fail to enumerate simulators.

* [xharness] Use new xharness API to select which simulators to use.

This also required bumping xharness.

* Bump again.

* Bump yet again.

* [xharness] Bump and fix according to API break.

* [xharness] Stop the listener before cancelling it.

Cancelling it doesn't do anything if the listener has connected, and that's
usually the case. This prevents subsequent logic from reading incomplete logs.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-11-02 07:43:07 +01:00
Rachel Kang 911f729377
[Foundation] Updates for Catalyst (#13199) 2021-11-01 23:14:20 -04:00
Manuel de la Pena 19a20ff522
[AppKit] Fix intro tests on monterey. (#13187) 2021-11-01 20:34:25 -04:00
Rachel Kang 157ee20da6
Merge branch 'main' into cat_corelocation 2021-10-30 14:51:50 -04:00
Manuel de la Pena 7b786db642
[AVFoundation] Fix intro issues in monterey. (#13182) 2021-10-29 17:32:22 -04:00
dotnet-maestro[bot] 48ef9469af
[main] Update dependencies from dotnet/installer (#13093)
* Update dependencies from https://github.com/dotnet/installer build 20211022.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21522.1

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21522.16

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21523.8

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21524.1

* Add a dependency to Microsoft.NETCore.App.Ref.

That way we match what XA did here: 16c1226dde

It also makes Maestro update our NuGet.config for us, which additional feeds we seem
to need to build.

* [dotnet] Use all the sources in the NuGet.config when installing workloads.

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21525.3

* Add dependency on Microsoft.AspNetCore.App.Ref.

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21526.10

* [tests] Disable the implicit FSharp.Core reference.

Fixes this:

    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103: Unable to find a stable package FSharp.Core with version (>= 6.0.1)
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 792 version(s) in dotnet-tools [ Nearest version: 6.0.2-beta.21519.1 ]
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 46 version(s) in dotnet-public [ Nearest version: 6.0.0 ]
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in xamarin-impl
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-aspnetcore-ae1a6cb-1
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-aspnetcore-ae1a6cb
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-runtime-4822e3c-1
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-runtime-4822e3c-2
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-runtime-4822e3c-4
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-runtime-4822e3c-5
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in Dotnet arcade
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in dotnet6
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in macios-dependencies

* [tests] Use a specific FSharp.Core version.

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21527.11

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-29 18:46:00 +02:00
Rachel Kang 66f4898211
Update based on feedback 2021-10-29 12:42:07 -04:00
Chris Hamons 2d278e4712
[msbuild] Fix dSYM generation of iOS binding projects (#13112)
- Fixes https://github.com/xamarin/xamarin-macios/issues/13096
- This was broken in https://github.com/xamarin/xamarin-macios/pull/10304
2021-10-29 10:20:44 -05:00
Manuel de la Pena 2cc31dcb9c
[MailKit] Fix intro in monterey. (#13169) 2021-10-29 11:06:14 -04:00
Rachel Kang 00d6cf3483
Merge pull request #13178 from rachelkang/cat_coreml
[CoreML] Updates for Catalyst
2021-10-29 10:18:00 -04:00
Rolf Bjarne Kvinge f0c8738966
[tests] Add an Xcode 13.1 version check in WKPreferencesTest. (#13170)
Fixes this test failure on macOS 10.14:

    MonoTouchFixtures.WebKit.WKPreferencesTest
        [FAIL] TextInteractionEnabledTest :   Getter
            Expected: No Exception to be thrown
            But was:  <Foundation.ObjCException: NSInvalidArgumentException: -[WKPreferences setTextInteractionEnabled:]: unrecognized selector sent to instance 0x7fa228f12640
                at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend_bool(intptr,intptr,bool)
                at WebKit.WKPreferences.set__OldTextInteractionEnabled (System.Boolean value) [0x0002c] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/mac/mobile/WebKit/WKPreferences.g.cs:482
                at WebKit.WKPreferences.set_TextInteractionEnabled (System.Boolean value) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/WKWebKit/WKPreferences.cs:32
                at MonoTouchFixtures.WebKit.WKPreferencesTest+<>c__DisplayClass0_0.<TextInteractionEnabledTest>b__0 () [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/WebKit/WKPreferencesTest.cs:19
                at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
                at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395
                --- End of stack trace from previous location where exception was thrown ---
                at NUnit.Framework.Internal.ExceptionHelper.Rethrow (System.Exception exception) [0x00006] in <d392db2fb3d64f4fa564a7b744fc7801>:0
                at NUnit.Framework.Internal.Reflect.DynamicInvokeWithTransparentExceptions (System.Delegate delegate) [0x00013] in <d392db2fb3d64f4fa564a7b744fc7801>:0
                at NUnit.Framework.Internal.ExceptionHelper.RecordException (System.Delegate parameterlessDelegate, System.String parameterName) [0x00067] in <d392db2fb3d64f4fa564a7b744fc7801>:0 >
2021-10-29 16:07:53 +02:00
Rolf Bjarne Kvinge f9ae3bd9a0
[monotouch-test] Fix a comparison to work with both C# nint and System.nint. (#13155) 2021-10-29 16:03:57 +02:00
Rachel Kang 5d6df6804b
Add ignore file 2021-10-28 15:58:34 -04:00
Rachel Kang c8465dbc4b
[CoreML] Updates for Catalyst 2021-10-28 15:58:12 -04:00
Rachel Kang 3c31e98c97
[CoreLocation] Updates for Catalyst 2021-10-28 15:09:40 -04:00
Manuel de la Pena 03960831d5
[Chip] Removing intro failins in monterey. (#13143) 2021-10-28 11:19:52 -04:00
Rolf Bjarne Kvinge 02431b9fc8
[.NET] Move the nfloat type to the ObjCRuntime namespace for .NET. (#13092)
Also move the NMath type from the System namespace to the ObjCRuntime namespace.

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2021-10-28 11:06:31 +02:00
Rolf Bjarne Kvinge 8f1e650bea
[tests] Allow for F# project files (*.fsproj) in generic make logic. (#13137) 2021-10-28 11:04:29 +02:00
Manuel de la Pena c2e2ac8b40
[AVFoundation] Make the notification change for xamcore 4 (#13134)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-27 15:06:17 -04:00
Manuel de la Pena 40db84a71e
[WebKit] Add methods removed by Apple. (#13133)
Apple removed methods without deprecating and did not add them back
after a rdar was reported. We can implement those methofs using the new
ones.
2021-10-27 15:04:44 -04:00
Alex Soto 7021b3890d
Bump macios to Xcode 13.1 SDKs (#13123) 2021-10-26 13:58:37 -04:00
Rolf Bjarne Kvinge b70e6f4674
Submodule MonoTouch.Dialog. (#13058)
* Submodule MonoTouch.Dialog.

Submodule MonoTouch.Dialog, so that we can easily build it using .NET. This
submodule will become redundant when/if we publish a .NET version of
MonoTouch.Dialog, but until that happens we need it at least for our own test
suites.

This also means we have to copy our NuGet.config and global.json files to the
MonoTouch.Dialog project directory so that we point msbuild to use our local
build.

New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@cbda703 [Touch.Client] Use MonoTouch.Dialog from a submodule. (#109)

Diff: 3345db2f4e..cbda703583

* Use relative path for submodule.

And fix indentation and set the branch name.

* Don't use 'RootTestsDirectory' when it might not be defined yet.

* [tests] Our test projects don't need to reference MonoTouch.Dialog directly.

The projects get the MonoTouch.Dialog reference indirectly through the
Touch.Client project reference.

* [tests] Only validate unique errors in the .NET unit tests.

* [tests] No need to reference System.Json anymore, that's handled directly in the MonoTouch.Dialog project.

* [tests] Reference nunit.framework.targets so we get a workaround for an NUnit issue everywhere.

* [msbuild] Only try to create a package if we're able to create an app bundle.

This fixes an issue where a library project would try (and fail) to create a
package when 'CreatePackage=true' (which could be set for the executable
project, but inherited by the library project since the executable project
depends on it).

* [tests] Adjust PackTest.BindingXcFrameworksProject to not set the AssemblyName property.

MSBuild ends up being very confused when the project we're trying to build
depends on other projects, because AssemblyName is set for all the projects
being build, and MSBuild complains about ambiguous projects:

> error: Ambiguous project name 'bindings-xcframework-test'
2021-10-26 08:18:34 +02:00
Manuel de la Pena aca9bb0046
[WebKit] Add support for Xcode 13.1 rc. (#13052)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-25 20:13:00 -04:00
Chris Hamons ab5c0c6b56
[net6] Fix ILStrip'ed apps to actually work again (#13098)
* [net6] Fix ILStrip'ed apps to actually work again

- In a late minute change to the ILStrip PR (https://github.com/xamarin/xamarin-macios/pull/12563) a change to support XVS support broke execution of Apps that were stripped
- Applications were broken because none of the stripped assemblies were actually copied into the bundle
- However, the tests still passed, because all assemblies that were there had no IL (zero assemblies total)

Now why did this happen?
- The stripped assemblies were changed to return via an msbuild Output Element
- Output Element can return an Property or ItemGroup, depending if you use the PropertyName or ItemName attributes
- Unfortunately I used PropertyName, when I expected an ItemGroup. So I silently had a property created instead.
- Thus zero items were added to the list of files to copy into the bundle
- Which was undetected as the test did not confirm files were copied in, and manual tests were not run so late into the PR (3 weeks after PR was opened)

How was it fixed?
- Correctly using ItemName on Output created a valid item group to reference
- However, that still failed with an absurdly confusing error:

 PATH/Microsoft.NET.Publish.targets(277,5): error MSB3024: Could not copy the file FILE to the destination file PATH, because the destination is a folder instead of a file. To copy the source file into a folder, consider using the DestinationFolder parameter instead of DestinationFiles.

- After a splunking through netcore targets, I found the metadata on these assemblies references really matters. Without it, they are not processed correctly at all.
- Thus, I updated ILStripBase to clone the existing metadata when changing the original assembly reference to the stripped path
- Finally, I corrected the test to assert that required files are copied in. I also manually ran our device test.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-25 11:31:42 -05:00
Rachel Kang 5d09fd774e
Merge pull request #13080 from rachelkang/cat_corewlan
[CoreWLAN] Updates for Catalyst
2021-10-25 10:44:47 -04:00
Rachel Kang 8ab022e8f0
Merge pull request #13097 from rachelkang/cat_uikit
[UIKit] Updates for Catalyst
2021-10-25 10:44:20 -04:00
Rolf Bjarne Kvinge dbe31e91df
[CFType] Subclass NativeObject + a few other code updates (#13086)
* Subclass NativeObject to reuse object lifetime code. This isn't for CFType
  itself, but all its subclasses.
* Add a public default constructor to maintain compat, but remove it for XAMCORE_4_0.
* Add an internal (IntPtr, bool) constructor to follow the NativeObject pattern.
* Enable nullability and fix code accordingly.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fastest and least memory hungry option).
* Use 'nameof (parameter)' instead of string constants.
2021-10-25 15:19:00 +02:00
Rachel Kang e8c066b123
[UIKit] Updates for Catalyst 2021-10-22 17:28:32 -04:00
Rachel Kang 3b1df5b27f
Merge pull request #13076 from rachelkang/cat_printcore
[PrintCore] Updates for Catalyst
2021-10-22 11:14:20 -04:00
Rachel Kang 410237ff14
Merge pull request #13056 from rachelkang/xcode13.0-intentsui-b1-b4
[IntentsUI] Update bindings for Xcode13.0 betas 1, 4
2021-10-22 11:02:05 -04:00
Rolf Bjarne Kvinge af23d61926
[runtime] Fix a toggle ref deadlock when retaining objects. Fixes #13066. (#13071)
The deadlock goes like this:

1. Thread A holds the framework_peer_release_lock lock, and tries to lock the
   refcount_mutex lock.
2. Thread B holds the refcount_mutex, and is waiting for the GC to complete
3. Thread C is trying to lock the framework_peer_release_lock while running
   the GC.

The fix is in thread A, by not doing anything at all with the
framework_peer_release_lock lock locked.

The code contains extensive comments explaining the situation and the solution.

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

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2021-10-22 09:05:07 +02:00
Rachel Kang f708a4e9da
[CoreWLAN] Updates for Catalyst 2021-10-21 16:03:25 -04:00
Rolf Bjarne Kvinge a862d505de
[CFBundle] Subclass NativeObject + numerous other code updates (#13041)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create native
  strings (the fastest and least memory hungry option).
* Use 'nameof (parameter)' instead of string constants.
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle  == IntPtr.Zero) instead of manually checking for IntPtr.Zero and throwing
  ObjectDisposedException.
* Use CFArray helper methods to create arrays (and implement some helper methods
  that didn't exist).
* Add a few tests for the new CFArray helper methods.
2021-10-21 18:04:08 +02:00
Rachel Kang f1ff6ae0cb
Merge pull request #13062 from rachelkang/cat_security
[Security] Updates for Catalyst
2021-10-21 10:49:30 -04:00
Rachel Kang 39ca46b58f
[PrintCore] Updates for Catalyst 2021-10-21 10:36:54 -04:00
Rachel Kang 9bb7267b72
[UserNotifications] Updates for Catalyst (#13057) 2021-10-21 10:12:48 -04:00
Rachel Kang a392357eb0
[Security] Updates for Catalyst 2021-10-20 17:34:11 -04:00
Rolf Bjarne Kvinge 808419f3c3
[tests] Fix the name of monotouchtest. (#13042)
Fix the name of monotouchtest, so that the app/executable is found by the
makefile when trying to execute the test.
2021-10-20 21:17:55 +02:00
Rachel Kang 56b454a8cb
[IntentsUI] Update bindings for Xcode13.0 betas 1,4 2021-10-20 14:33:42 -04:00
Rachel Kang 861c40dbe4
Merge pull request #12990 from rachelkang/cat_networkextension
[NetworkExtension] Updates for Catalyst
2021-10-19 12:26:48 -04:00
Rachel Kang 4c2c4a38d4
Merge pull request #12978 from rachelkang/cat_executionpolicy
[ExecutionPolicy] Updates for MacCatalyst
2021-10-19 10:24:55 -04:00
Rachel Kang 8670f235c5
Merge pull request #12980 from rachelkang/cat_ituneslibrary
[iTunesLibrary] Updates for MacCatalyst
2021-10-19 10:24:34 -04:00
Rachel Kang 9dd375f179
Merge pull request #12991 from rachelkang/cat_videotoolbox
[VideoToolbox] Updates for Catalyst
2021-10-19 10:24:10 -04:00
Rachel Kang 3eea624ebb
Merge pull request #12971 from rachelkang/cat_medialibrary
[MediaLibrary] Update MacCatalyst Support
2021-10-19 10:23:41 -04:00
Alex Soto 78c367749a
[xcode13.1-rc] Bump macios to use Xcode 13.1 RC (#13025) 2021-10-19 09:30:44 +02:00
Rolf Bjarne Kvinge 60c20decf0
[tests] Fix LinkSdkRegressionTest.SpecialFolder on macOS 10.14. (#13004) 2021-10-19 08:16:21 +02:00
Rolf Bjarne Kvinge 6d065a7dcc
[tests] Minor fixes wrt executing packaged macOS tests. (#12982)
* Don't execute .NET tests in the 'legacy' targets (it's wasteful because
  we're already executing those .NET tests elsewhere).
* Fix reporting failures in the legacy tests.
2021-10-18 07:30:36 +02:00
Rolf Bjarne Kvinge 56892d996d
[src] Rename MAC_* variables to MACOS_* variables. (#12998)
This makes it easier to iterate over the platforms we're building for, because
we can use "macOS" to compute the variable names we're interested in (like we
already can for iOS, tvOS, watchOS and MacCatalyst).
2021-10-18 07:24:37 +02:00
Rachel Kang 72dc7f5d01
[NetworkExtension] Updates for Catalyst 2021-10-14 12:11:10 -04:00
Rachel Kang 6041aad59b
[VideoToolbox] Updates for Catalyst 2021-10-13 16:40:09 -04:00
Rachel Kang a8b0c29cc2
[iTunesLibrary] Updates for MacCatalyst 2021-10-12 17:25:07 -04:00
Rachel Kang d657af6ba9
[ExecutionPolicy] Updates for MacCatalyst 2021-10-12 14:59:39 -04:00
Rachel Kang 6e43ee83f1
[MediaLibrary] Update MacCatalyst Support 2021-10-11 14:38:17 -04:00
Rolf Bjarne Kvinge 3c2c3d062d
[generator] Fix the return type for blocks returning a type we've bound as an INativeObject. (#12941)
* Create all INativeObject subclasses using 'Runtime.GetINativeObject<T>' instead
  of 'new T ()'. Although it's somewhat slower, it automatically handles any IntPtr.Zero
  handles, and it also makes the generator code simpler. If something turns out to
  be a performance problem, we can always add custom static creation methods (like
  some of the existing types already have).

* This makes it so that the zero pointer check logic in the generator isn't necessary
  anymore.

* The most important part is where we use IntPtr as the marshalling type for returned
  INativeObjects in blocks (instead of the INativeObject class - which doesn't make
  sense really, because I have no idea how that's marshalled).

Example:

```diff
diff --git a/build/dotnet/ios/generated-sources/ObjCRuntime/Trampolines.g.cs b/build-new/dotnet/ios/generated-sources/ObjCRuntime/Trampolines.g.cs
index 97e58f3a91b..8a40748de8b 100644
--- a/build/dotnet/ios/generated-sources/ObjCRuntime/Trampolines.g.cs
+++ b/build-new/dotnet/ios/generated-sources/ObjCRuntime/Trampolines.g.cs
@@ -214,7 +214,7 @@ namespace ObjCRuntime {
    } /* class NIDAVAudioEngineManualRenderingBlock */
    [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
    [UserDelegateType (typeof (global::AVFoundation.AVAudioIONodeInputBlock))]
-   internal delegate global::AudioToolbox.AudioBuffers DAVAudioIONodeInputBlock (IntPtr block, uint frameCount);
+   internal delegate IntPtr DAVAudioIONodeInputBlock (IntPtr block, uint frameCount);
    //
    // This class bridges native block invocations that call into C#
    //
@@ -223,11 +223,11 @@ namespace ObjCRuntime {
      [Preserve (Conditional = true)]
      [global::System.Diagnostics.CodeAnalysis.DynamicDependency ("Handler")]
      [MonoPInvokeCallback (typeof (DAVAudioIONodeInputBlock))]
-     static unsafe global::AudioToolbox.AudioBuffers Invoke (IntPtr block, uint frameCount) {
+     static unsafe IntPtr Invoke (IntPtr block, uint frameCount) {
        var descriptor = (BlockLiteral *) block;
        var del = (global::AVFoundation.AVAudioIONodeInputBlock) (descriptor->Target);
        AudioToolbox.AudioBuffers retval = del (frameCount);
-       return retval;
+       return retval.GetHandle ();
      }
    } /* class SDAVAudioIONodeInputBlock */
    internal sealed class NIDAVAudioIONodeInputBlock : TrampolineBlockBase {
@@ -249,7 +249,7 @@ namespace ObjCRuntime {
      [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
      unsafe global::AudioToolbox.AudioBuffers Invoke (uint frameCount)
      {
-       var ret = invoker (BlockPointer, frameCount);
+       var ret = Runtime.GetINativeObject<global::AudioToolbox.AudioBuffers> (invoker (BlockPointer, frameCount), false);
        return ret!;
      }
    } /* class NIDAVAudioIONodeInputBlock */
```
2021-10-11 19:13:17 +02:00
Rachel Kang f6b344946c
[PushKit] Update PushKit MacCatalyst (#12957) 2021-10-08 16:17:05 -04:00
Rolf Bjarne Kvinge 4f613f4c9d
[xharness] Don't copy xharness.[css|js] to the output directory when they're already in the output directory. (#12958)
The problem is that cleaning the project would then remove these files, which
would break the next build.
2021-10-08 16:31:52 +02:00
Rolf Bjarne Kvinge 6d8ef62705
[AVFoundation] Fix a few issues with AudioUnit. (#12954)
* Add an (IntPtr, bool) constructor so that AudioUnit works with Runtime.GetINativeObject.
* Keep track of ownership, so that AudioUnit doesn't free the native resources
  when it doesn't own them.
* Update a test to verify that calling 'AVAudioIONode.AudioUnit' multiple
  times and disposing the result between them works (this fails if AudioUnit
  doesn't keep track of ownership).
2021-10-08 07:52:40 +02:00
Rolf Bjarne Kvinge b9de02c457
[introspection] Skip verifying the objc_msgSend[Super]_stret on all platforms. (#12939)
Now that macOS runs on ARM64 (and also the simulators soon), we need to have to same logic for all platforms.

Fixes:

    Introspection.iOSApiPInvokeTest
        [FAIL] Could not find the field 'objc_msgSend_stret' in /usr/lib/libobjc.dylib
        [FAIL] Could not find the field 'objc_msgSendSuper_stret' in /usr/lib/libobjc.dylib
        [FAIL] SymbolExists :   2 errors found in 5300 functions validated: objc_msgSend_stret, objc_msgSendSuper_stret
            Expected: 0
            But was:  2
                at Introspection.ApiPInvokeTest.SymbolExists() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/introspection/ApiPInvokeTest.cs:line 182
2021-10-07 20:15:54 +02:00
Rachel Kang 9ebf14e85b
Merge pull request #12936 from rachelkang/xcode13.0-appkit-b1-b2-b3-b4-b5
[AppKit] Update Xcode 13.0 bindings for betas 1,2,3,4,5
2021-10-07 13:14:59 -04:00
Rolf Bjarne Kvinge 694ec2d0b3
[tests] Ignore TemplateProjectTest.CreateAppBundleDependsOnTest when the specified platform isn't included in the build. (#12933) 2021-10-07 09:10:16 +02:00
Rolf Bjarne Kvinge 6b27debb63
[tests] Bump our generic min macOS version to 10.14 for .NET tests. (#12938)
Fixes this when running our test suites on macOS 10.14:

    dyld: Library not loaded: /System/Library/Frameworks/AuthenticationServices.framework/Versions/A/AuthenticationServices
      Referenced from: /Users/runner/work/1/s/artifacts/mac-test-package/tests/./introspection/dotnet/macOS/bin/Debug/net6.0-macos/osx-x64/introspection.app/Contents/MacOS/introspection
      Reason: image not found
    make[2]: *** [exec-mac-dotnet-x64-introspection] Abort trap: 6
2021-10-07 09:09:46 +02:00
Rolf Bjarne Kvinge f12d09f405
[msbuild] Share the CompileEntitlements task implementation between iOS and macOS. (#12946) 2021-10-07 08:17:50 +02:00
Rolf Bjarne Kvinge afff63f04d
[tests] Fix make variables usage in template code. (#12940) 2021-10-06 18:54:27 +02:00
Rolf Bjarne Kvinge 63de01c21c
[tests] Fix packaging of Xamarin.Mac tests. (#12776)
I recently deleted the generated makefile support for building and running our
test suites. It turned out that it was used for building the packaged
Xamarin.Mac tests, so it wasn't as unused as I thought.

So fix the building and packaging of Xamarin.Mac tests to not use the
(non-existent) makefile targets, but instead replicate it with manual make
code.

Also take the opportunity to add packaging and execution of the .NET versions
of these test suites we execute on other macOS versions (both for macOS and
the Mac Catalyst).

* [devops] Use stricter matching when finding the Xamarin.Mac pkg link.

Otherwise the branch name in any package could end up matching the pattern we
were looking for:

	XM_PACKAGE=https://bosstoragemirror.blob.core.windows.net/wrench/tests-package-xamarin-mac-tests/15759261d425ae08494b0a26862a0b1356c5f8ec/5268864/package/Microsoft.iOS.Bundle.15.0.101-ci.tests-package-xamarin-mac-tests.68.pkg

is just clearly wrong.
2021-10-06 08:10:07 +02:00
Chris Hamons dade24c63a
Catalyst changes for CoreAnimation, CoreFoundation, and AVKit (#12926) 2021-10-05 16:42:37 -05:00
Manuel de la Pena 67e1ca5459
[Metal] Add support for xcode 13 beta5 . (#12875)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-05 13:32:48 -04:00
Rolf Bjarne Kvinge f1e4cbcfcd
[tests] Modify a few test directories with multiple projects to have the projects in subfolders. (#12921)
This fixes a problem where the build from the different projects could stomp
on eachother in the obj/bin folders. It's technically possible to make this
work by setting up custom [Base][Intermediate][OutputPath] properties in the
project files, but the simplest solution is to just make sure there's no more
than a single project per directory.
2021-10-05 18:06:35 +02:00
Chris Hamons 9230c798a9
[UIKit] Add Catalyst support (#12809) 2021-10-05 11:04:44 -05:00
Rachel Kang 517fbd9a02
[AppKit] Update Xcode 13.0 bindings for betas 1,2,3,4,5 2021-10-05 11:59:49 -04:00
Chris Hamons a300dfc56b
[msbuild] Add ILStrip'ing for net6 applications. Fixes #11445. (#12563)
- Controlled by EnableAssemblyILStripping which defaults to true
- Integration test included

Before - https://gist.github.com/chamons/c7886f7bacbc2e5ac5966e4251d13e71
After - https://gist.github.com/chamons/148e1bef22fa336f953f3d02dcf20667

859,136 -> 527,872 managed

Fixes https://github.com/xamarin/xamarin-macios/issues/11445.
2021-10-05 09:43:22 -05:00
Rolf Bjarne Kvinge b772397b63
[msbuild] Share the BTouch task implementation between iOS and macOS. (#12873) 2021-10-04 08:18:47 +02:00
Rolf Bjarne Kvinge 62bdd683cf
[dotnet] Add support for 'dotnet pack'. Fixes #12631. (#12900)
Add support for 'dotnet pack', by:

1. Add a workaround for the fact that as soon as a project has a
   'NativeReference' item, .NET's MSBuild logic wants to include a
   'Native.$(AssemblyName).manifest' file in the NuGet. This obviously breaks,
   because we don't create such a file, so we work around it by removing the
   file in question from the corresponding item groups.

2. Add any binding resource packages to the NuGet.

3. Add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/12631.
2021-10-04 07:43:55 +02:00
Rolf Bjarne Kvinge 43d894da15
[msbuild/tools] Augment the CreateBindingResourcePackage to support creating a zipped binding resource package. (#12868)
Augment the CreateBindingResourcePackage to support creating a zipped binding
resource package (which is just a zipped version of the binding resource
package). This can either be manually chosen by the new 'Compressed' property,
or automatically detected (create a zipped version when there's a symlink in
the binding resource package).

The default is to not create a zipped version in legacy Xamarin, and
automatically detect for .NET.

The problem this is trying to solve is when creating a NuGet package - NuGet
doesn't handle symlinks correctly and it's not possible to create a NuGet with
symlinks. Instead we need to create a zipfile with all the binding resources.
The default has been chosen so that we automatically create a zip file when
it's required for .NET, while still maintaining old behavior with legacy
Xamarin.
2021-10-01 08:40:01 +02:00
Rolf Bjarne Kvinge 4c9e2668b5
[tests] Add more special cases for random network errors on CI. (#12879)
Ref: https://github.com/xamarin/maccore/issues/2304
2021-10-01 08:36:40 +02:00
Rolf Bjarne Kvinge 26771dfefa
[xharness] Remove iOS 32-bit simulator support, current Xcodes don't support it. (#12880)
Our existing tests that claimed to run iOS 32-bit tests were really executing
in 64-bit mode.
2021-10-01 08:33:18 +02:00
Rolf Bjarne Kvinge 7bd39ff873
[tests] Make sure interdependent-binding-projects builds with our workaround for NUnit bugs in .NET. (#12881) 2021-10-01 08:31:31 +02:00
Rolf Bjarne Kvinge 403bc2e774
[tests] Add a test to verify that AppDomain.CurrentDomain.BaseDirectory is always something. Fixes #12687. (#12885)
Fixes https://github.com/xamarin/xamarin-macios/issues/12687.
2021-10-01 08:29:56 +02:00
Chris Hamons 3ffabb1daa
[AppKit] Add Catalyst attributes (#12863) 2021-09-30 09:57:10 -05:00
Rolf Bjarne Kvinge 9286bfb793
[msbuild/dotnet] Compile project-level assets in the outer build for multi-rid builds. Fixes #12410. (#12847)
We don't need to compile project-level assets for every RuntimeIdentifier in
multi-rid builds, we can instead compile them just once in the outer build.

There is also a correctness issue here: we can't compile assets more than once
and expect to get the exact same compiled result every time (in particular
actool seems to be adding random bytes in to the compiled output), and this
creates a problem when trying to merge the different runtime-specific compiled
output into a universal binary.

We accomplish this by:

* Processing these assets in the outer build, before we execute the
  rid-specific inner builds.
* Store the paths to the assets we've processed in a file.
* In the inner builds, we read that file, and remove any matches from the
  corresponding item group.
* Make sure to copy the compiled assets to the app bundle at the end of the
  outer build.

These are the assets we currently handle this way:

* BundleResource
* ImageAsset
* InterfaceDefinition
* SceneKitAsset
* Collada
* TextureAtlas
* CoreMLModel

Also:

* Add a new test case (AppWithResource) that contains all these different
  types of assets.
* Add support for the ScnTool task on Mac Catalyst (which the new test case
  revealed was missing).

Fixes https://github.com/xamarin/xamarin-macios/issues/12410.
2021-09-30 08:25:10 +02:00
Rolf Bjarne Kvinge 2417377017
[tests] Fix a few nullability warnings. (#12872) 2021-09-30 08:21:43 +02:00
Chris Hamons af416003f1
[Foundation] Add attributes and fix ignores for Catalyst (#12854) 2021-09-29 10:18:01 -05:00
Rolf Bjarne Kvinge cd2867d44c
[msbuild] Share the Metal[Lib] task implementations between iOS and macOS. (#12851) 2021-09-29 07:55:55 +02:00
Rolf Bjarne Kvinge 3d182c5c54
[Metal] Fix a few issues in MTLDevice. (#12861)
* MTLCopyAllDevices returns a retained object, so we need to release it.
* MTLCopyAllDevicesWithObserver returns an observer (no need to provide one). This
  means we can obsolete the 'ref NSObject' overload (the API doesn't make sense),
  and instead add an 'out NSObject' overload.
* The returned observer from MTLCopyAllDevicesWithObserver is retained, so we must
  release it.
* The returned array from MTLCopyAllDevicesWithObserver is a retained object, so
  we need to release it.
* Simpify the supporting block code for the calls to MTLCopyAllDevicesWithObserver.
* Clean up the block we passed to MTLCopyAllDevicesWithObserver.
2021-09-29 07:54:42 +02:00
Rolf Bjarne Kvinge 7dc2d9af61
[msbuild] Sign Xamarin.iOS.Tasks.dll and Xamarin.Mac.Tasks.dll. Fixes #9835. (#12831)
We need to strongname our MSBuild assemblies, so that different versions
can be loaded side-by-side (one example being having both a legacy and a
.NET project in the same solution).

This required setting a version for Xamarin.iOS.Tasks.dll and
Xamarin.Mac.Tasks.dll, otherwise strong-naming won't work properly (all
versions of an assembly would have the same identity).

Also sign the corresponding test assemblies, since they poke into the
internals of the task assemblies.

Fixes https://github.com/xamarin/xamarin-macios/issues/9835.
2021-09-28 17:31:35 +02:00
Manuel de la Pena b20ca55943
[Foundation] Remove warning due to the Equals accepting a null value. (#12839)
Removes the following warning during the builds:

```
warning CS8767: Nullability of reference types in type of parameter 'host' of 'bool NSHost.Equals(NSHost host)' doesn't match implicitly implemented member 'bool IEquatable<NSHost>.Equals(NSHost? other)' (possibly because of nullability attributes)
```

Test was added to ensure that we did not throw an exception.
2021-09-28 08:11:07 -04:00
Manuel de la Pena 339936f457
[Tests] Fix cecil tests. (#12853)
-  Added the marshaling attr and a test to ensure it is ok.
- Fix the cecil MarshalAs test to not skip over types when checking.
    This revealed multiple tests failures that needed fixing.

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

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-09-28 08:09:23 -04:00
Rolf Bjarne Kvinge 6bf39bacfa
[tests] Simplify the test code for the .NET unit tests. (#12842)
As more tests have been written, helper methods have been added, so this is
just making existing code use newer helper methods.
2021-09-27 15:55:30 +02:00
Rolf Bjarne Kvinge e2d1777cc7
[dotnet] Show an error if we must link, but linking has been disabled. Fixes #12372. (#12832)
For executable projects, we must run the linker (otherwise we won't produce
something that can be executed).

We'll enable the linker by default in these cases, but if the developer has
manually disabled the linker (if the linker fails to execute for any reason,
it will suggest that the developer disables it), then we should show an error
explaining why.

Fixes https://github.com/xamarin/xamarin-macios/issues/12372.
2021-09-27 07:28:10 +02:00
Manuel de la Pena ad673ae731
[CoreMedia] Add support for xcode13 (#12770)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-09-24 18:19:49 -04:00
Rolf Bjarne Kvinge 4d5616687a
[dotnet] Fix an issue where we wouldn't re-link if some files changed. (#12794) 2021-09-24 13:20:03 +02:00
Rolf Bjarne Kvinge 5318a2b9fa
[msbuild] Make the CompileAppManifestTaskBase.AppManifest property an ITaskItem. (#12804)
So that any input app manifest is copied to Windows when doing remote builds.
2021-09-23 18:46:37 +02:00
Rolf Bjarne Kvinge 83de23f6b4
[tests] Build interdependent-binding-projects for macOS now, there's a corresponding macOS Touch.Client project. (#12817) 2021-09-23 16:20:18 +02:00
Rachel Kang 70dd0d31fa
[Intents] Update bindings for Xcode 13.0 betas 1 through 5 (#12771)
* "[Intents] Update bindings for Xcode 13.0 betas 1 through 5"

* Update based on feedback

* Update based on feedback

* Update based on feedback
2021-09-21 20:30:56 -04:00
Chris Hamons 65f0e4c614
Some Catalyst API annotations and corrections (#12677)
- Part of https://github.com/xamarin/xamarin-macios/issues/10216
- This includes most of the smaller SDKs.
2021-09-21 14:17:52 -05:00
Rolf Bjarne Kvinge c4a67e585c
[msbuild/tools] Add a better error message for when we fail to convert between iOS and macOS versions for Mac Catalyst. (#12767)
New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@9e6e29f [Xamarin.MacDev] Return valid iOS/macOS versions when converting betweeen iOS and macOS versions for Mac Catalyst.

Diff: 41d91e0de0..9e6e29f2a4
2021-09-21 16:19:04 +02:00
TJ Lambert e16d8fe1fe
[Dotnet] Enable the Test to check for Dotnet Attributes (#12745)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-09-20 15:13:53 -04:00
Chris Hamons a6eb528197
[net6][msbuild] Set SelfContained for AppExtensions sooner to fix publishing (#12703)
This PR resolves a crash when running the linker on publishing iOS extensions.

The crash would occur here in failing to resolve corelib.

The reason this would fail was System.Private.CoreLib.dll was not in input_assemblies.

This was because we were passes the set of reference assemblies not the expected 'real' ones, and those do not include CoreLib.

After a bunch of digging, this was because _ComputeManagedRuntimePackAssembliesIfSelfContained target was not being set as a condition of _ComputeAssembliesToPostprocessOnPublish.

_ComputeManagedRuntimePackAssembliesIfSelfContained happened to be the place these were added, and wasn't being set since it has a condition of $(SelfContained) == 'true'

Now confusingly SelfContained WAS being set to true, but only in the targets file, which was too late, as it was checked in a 'global' property group outside of a target.

This means we'd fail to set SelfContained until after the condition, and not run.

This was verified by setting /p:SelfContained=true to true.

I also looked at removing the condition above, since https://github.com/dotnet/runtime/issues/54406 is fixed, however this caused project that didn't set RuntimeIdentifier to fail.
2021-09-20 09:40:41 -05:00
Rolf Bjarne Kvinge 499a69e772
[dotnet] Enable default compile items for binding projects. Fixes #12532. (#12758)
Enable default compile items for binding projects, and just exclude any api definition
and core source from any automatically included files.

Fixes https://github.com/xamarin/xamarin-macios/issues/12532.
2021-09-20 13:41:20 +02:00
Rolf Bjarne Kvinge cb93a8e66a
[tests] Fix a thread synchronization issue in the generator tests. (#12775)
Properly synchronize access to the current writer in the generator tests'
ThreadStaticTextWriter class.

Should fix this random failure:

    Error Message:
     System.NullReferenceException : Object reference not set to an instance of an object.
    Stack Trace:
       at Xamarin.Tests.ThreadStaticTextWriter.WriteLine(String value) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/generator/BGenTool.cs:line 478
     at System.IO.TextWriter.SyncTextWriter.WriteLine(Object value)
     at System.Console.WriteLine(Object value)
     at Xamarin.Tests.BGenTool.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/generator/BGenTool.cs:line 235
     at Xamarin.Tests.BGenTool.AssertExecute(String message) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/generator/BGenTool.cs:line 207
     at GeneratorTests.BGenTests.BuildFile(Profile profile, Boolean nowarnings, Boolean processEnums, IEnumerable`1 references, String[] filenames) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/generator/BGenTests.cs:line 780
     at GeneratorTests.BGenTests.BuildFile(Profile profile, Boolean nowarnings, Boolean processEnums, String[] filenames) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/generator/BGenTests.cs:line 766
     at GeneratorTests.BGenTests.BuildFile(Profile profile, String[] filenames) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/generator/BGenTests.cs:line 756
     at GeneratorTests.BGenTests.VSTS970507() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/generator/BGenTests.cs:line 650
2021-09-20 13:39:24 +02:00
Rolf Bjarne Kvinge a96c28b979
[msbuild] Call the generator using a response file. (#12756)
Fixes this warning:

> Xamarin.Shared.targets(992,3): warning MSB6002: The command-line for the "BTouch" task is too long. Command-lines longer than 32000 characters are likely to fail. Try reducing the length of the command-line by breaking down the call to "BTouch" into multiple calls with fewer parameters per call.
2021-09-20 07:40:57 +02:00
Rolf Bjarne Kvinge 728347ad63
[dotnet] Remove watchOS code and from our .NET support. (#12764)
It's not tested, and thus has probably already bitrotted. If we add support
for watchOS to .NET in the future, it would likely be easier to start from
scratch (copying some of the other platforms), than having incomplete and
bitrotted code.
2021-09-20 07:40:03 +02:00
Rolf Bjarne Kvinge f7a3619974
[tests] Fix warning about unused variable. (#12762) 2021-09-17 16:01:48 +02:00
Rolf Bjarne Kvinge 04548c7da0
[msbuild/dotnet] Include font files by default in .NET apps, and implement a way to automatically register them. Fixes #12536. (#12752)
* Automatically include *.ttf, *.ttc and *.otf in .NET projects as BundleResource
  items (if these files are found within the Resources/ subdirectory).
* Add support for a 'RegisterFont' metadata on BundleResource items, where if set
  to 'true', we'll register the font file in the Info.plist as required by the target
  platform.
* Add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/12536.
2021-09-17 10:18:09 +02:00
Rolf Bjarne Kvinge 3ab8e4ab61
[tests] Re-generate test[-system].config after .NET bumps. (#12759) 2021-09-17 09:57:14 +02:00
Alex Soto e2d05da816
[TVUIKit] Update bindings to Xcode 13 Beta 5 (#12722)
* [TVUIKit] Update bindings to Xcode 13 Beta 5

* Apply feedback

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-09-16 19:03:48 -04:00
Manuel de la Pena 2a2bc2560e
[Xtro] Allow to run xtro with some platforms ignored. (#12742) 2021-09-16 16:08:36 -04:00
Rolf Bjarne Kvinge 298d423cf1
[xharness] Don't generate makefiles anymore. (#12751)
We either use the html web page, or for .NET tests there are custom makefile
logic.

This avoids having to maintain the makefile generation to keep up with our new
tests, and it fixes numerous warnings like this:

    Makefile-mac.inc:56: warning: overriding recipe for target 'build-mac-modern-macOS'
    Makefile-mac.inc:41: warning: ignoring old recipe for target 'build-mac-modern-macOS'
    Makefile-mac.inc:59: warning: overriding recipe for target 'clean-mac-modern-macOS'
    Makefile-mac.inc:44: warning: ignoring old recipe for target 'clean-mac-modern-macOS'
    Makefile-mac.inc:62: warning: overriding recipe for target 'exec-mac-modern-macOS'
    Makefile-mac.inc:47: warning: ignoring old recipe for target 'exec-mac-modern-macOS'
    Makefile-mac.inc:65: warning: overriding recipe for target 'run-mac-modern-macOS'
    Makefile-mac.inc:50: warning: ignoring old recipe for target 'run-mac-modern-macOS'
2021-09-16 17:23:07 +02:00
Rolf Bjarne Kvinge d142a3756f
[tests] Relax a few special folder checks for tvOS even more. Fixes #12640. (#12748)
Hopefully fixes https://github.com/xamarin/xamarin-macios/issues/12640.
2021-09-16 15:36:06 +02:00
Rolf Bjarne Kvinge a78700bb40
[tests] Add additional test to try to narrow down #xamarin/maccore@2443. (#12384) 2021-09-16 15:00:06 +02:00
Rolf Bjarne Kvinge 79eb633fab
[tests] Fix (a)synchronous F# code. (#12738)
MonoTouch.NUnit.UI.MacRunner.MainAsync will try to invoke things on the main
thread, and at the same time execute a runloop, and if the runloop isn't
executing on the main thread, we end up with a deadlock, where we keep waiting
on the main thread to process stuff enqueued by the background thread, while
the main thread is waiting for the background thread to finish.

Solve this by fixing the F# code to call
MonoTouch.NUnit.UI.MacRunner.MainAsync on the main thread.
2021-09-16 09:43:29 +02:00
Sebastien Pouliot 2691791ad2
[corefoundation] Optimize `CFArray` (#12740)
The added test case has not shown any major performance enhancement,
anything (if) is lost in the noise.

Beside the performance the change has two small size advantages
* `Create` does not call another method (less metadata)
* `GetCount` is now the p/invoke `CFArrayGetCount`

Before

// * Summary *

BenchmarkDotNet=v0.12.1.1528-nightly, OS=macOS Big Sur 11.5.2 (20G95) [Darwin 20.6.0]
Intel Core i7-4790K CPU 4.00GHz (Haswell), 1 CPU, 8 logical and 4 physical cores
  [Host] : Mono 6.12.0 (2020-02/3cf59ad33da), X64

Job=InProcess  Toolchain=InProcessEmitToolchain  IterationCount=3
LaunchCount=1  WarmupCount=3

| Method | Length |        Mean |       Error |    StdDev |
|------- |------- |------------:|------------:|----------:|
| Create |      0 |    255.4 ns |    53.68 ns |   2.94 ns |
| Create |      1 |    343.0 ns |     8.55 ns |   0.47 ns |
| Create |     16 |    443.8 ns |    30.54 ns |   1.67 ns |
| Create |    256 |  1,898.4 ns |   246.80 ns |  13.53 ns |
| Create |   4096 | 40,503.2 ns | 5,395.81 ns | 295.76 ns |

// * Legends *
  Length : Value of the 'Length' parameter
  Mean   : Arithmetic mean of all measurements
  Error  : Half of 99.9% confidence interval
  StdDev : Standard deviation of all measurements
  1 ns   : 1 Nanosecond (0.000000001 sec)

// ***** BenchmarkRunner: End *****
Global total time: 00:00:33 (33.26 sec), executed benchmarks: 5

After

// * Summary *

BenchmarkDotNet=v0.12.1.1528-nightly, OS=macOS Big Sur 11.5.2 (20G95) [Darwin 20.6.0]
Intel Core i7-4790K CPU 4.00GHz (Haswell), 1 CPU, 8 logical and 4 physical cores
  [Host] : Mono 6.12.0 (2020-02/3cf59ad33da), X64

Job=InProcess  Toolchain=InProcessEmitToolchain  IterationCount=3
LaunchCount=1  WarmupCount=3

| Method | Length |        Mean |       Error |   StdDev |
|------- |------- |------------:|------------:|---------:|
| Create |      0 |    246.3 ns |    55.49 ns |  3.04 ns |
| Create |      1 |    341.1 ns |    18.13 ns |  0.99 ns |
| Create |     16 |    425.4 ns |    34.97 ns |  1.92 ns |
| Create |    256 |  1,741.1 ns |   298.87 ns | 16.38 ns |
| Create |   4096 | 40,333.6 ns | 1,646.70 ns | 90.26 ns |

// * Legends *
  Length : Value of the 'Length' parameter
  Mean   : Arithmetic mean of all measurements
  Error  : Half of 99.9% confidence interval
  StdDev : Standard deviation of all measurements
  1 ns   : 1 Nanosecond (0.000000001 sec)

// ***** BenchmarkRunner: End *****
Global total time: 00:00:31 (31.68 sec), executed benchmarks: 5
2021-09-16 08:39:16 +02:00
Rolf Bjarne Kvinge c2a531259f
[introspection] Skip VideoToolbox classes in the ApiCMAttachmentTest on tvOS devices. (#12695)
They crash on device.
2021-09-16 08:25:29 +02:00
Rolf Bjarne Kvinge 5b4301f129
[tests] Add .NET makefiles for bindings-test. (#12712) 2021-09-16 08:20:35 +02:00
Rolf Bjarne Kvinge 811384f7d2
[msbuild] Fix parsing extra bundler arguments where a space separates the name and value of the argument. (#12731)
Fix parsing extra bundler arguments where a space separates the name and the
value of the argument, like this: '--xml file.xml' (as opposed to
'--xml:file.xml' or '--xml=file.xml').

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1385946.
2021-09-16 08:17:33 +02:00
Rachel Kang b9cde5eeea
Merge pull request #12601 from rachelkang/xcode13.0-coreimage-b1-b3
[CoreImage] Update Xcode 13.0 bindings betas 1 and 3
2021-09-15 13:56:26 -04:00
Rolf Bjarne Kvinge 892f0caac2
[dotnet-linker] Remove workaround for a dotnet/runtime issue wrt the AOT compiler. (#12528)
* [dotnet-linker] Remove workaround for a dotnet/runtime issue wrt the AOT compiler.

The dotnet/runtime issue has been fixed.

Ref: https://github.com/dotnet/runtime/issues/55733

* [tests] Set the _BundlerVerbosity property instead of MtouchExtraArgs/MonoBundlingExtraArgs to increase verbosity.

This fixes a problem where a test project would try to set the
MtouchExtraArgs/MonoBundlingExtraArgs properties, and it would fail because
the MtouchExtraArgs/MonoBundlingExtraArgs properties were already set from the
command line (and in MSBuild, properties that are set from command line
arguments can't be changed later).

In particular we have logic to pass --dlsym:+nunit.framework.dll for
monotouch-test, and that would just be ignored.
2021-09-15 18:10:30 +02:00
Manuel de la Pena 124dc24bea
[AVFoundation] Add support for xcode 13 beta 5. (#12550)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-09-15 11:37:21 -04:00
Rolf Bjarne Kvinge 2a3bb286f0
[src] Fix the library for a few P/Invokes. (#12715)
This matters because we use the library defined by the P/Invoke to determine
which frameworks to link with, and if we get it wrong, things like this may
happen:

    Undefined symbols for architecture arm64:
      "_AudioObjectGetPropertyData", referenced from:
          wrapper_managed_to_native_AudioUnit_AudioUnit_AudioObjectGetPropertyData_uint_AudioUnit_AudioObjectPropertyAddress__uint__intptr__uint__uint_ in Xamarin.MacCatalyst.dll.o

because we though that the AudioObjectGetPropertyData function was in the
AudioUnit framework, and not in CoreAudio where it really is, and thus we
didn't link with the CoreAudio framework.

Also add an introspection test to verify that the library our P/Invokes point
to is correct.
2021-09-15 11:05:59 +02:00
Rolf Bjarne Kvinge 1192cd6975
[tests] Fix creation of IntPtr to work on a 32-bit system. (#12713) 2021-09-15 09:29:10 +02:00
Alex Soto 8bc4fc645c
[UIKit] Update bindings to Xcode 13 Beta 5 (#12706)
* [UIKit] Update bindings to Xcode 13 Beta 5

* Fix tvOS availability

* Apply feedback

* Add UIPointerAccessory and feedback

* Fix typo

* Fix availability

* Apply feedback and fix library field lookup
2021-09-14 16:31:45 -04:00
Rachel Kang f1e8f010a1
Fix xtro failures by removing catalyst todo and ignore files 2021-09-13 14:42:23 -04:00
Rachel Kang 040db106c0
Merge branch 'main' into xcode13.0-coreimage-b1-b3 2021-09-13 12:29:04 -04:00
Rolf Bjarne Kvinge 71d2edbc80
[tests] Add debug spew to try to track down random test failure in NSMutableDictionary2Test.AddEntries. (#12711)
Ref: https://github.com/xamarin/maccore/issues/1605
2021-09-13 17:13:40 +02:00
Manuel de la Pena f1611df154
[CoreVideo] Add support for Xcode 13 beta3. (#12257)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2021-09-13 11:09:26 -04:00
Rolf Bjarne Kvinge f75a7b5074
[tests] Add perf test for calling Marshal.AllocHGlobal/FreeHGlobal. (#12696)
Also add a 'SupportedOSPlatformVersion' value to the .NET perftest project
file, to cope with recent changes in our .NET support.

Ref: https://github.com/dotnet/runtime/issues/58939.
2021-09-13 16:14:37 +02:00
Rolf Bjarne Kvinge 9a7000fa18
[tests] Adjust BaseOptimizeGeneratedCodeTest.SetupBlockPerfTest to cope for a slower .NET on tvOS. (#12697) 2021-09-13 16:14:17 +02:00
Rolf Bjarne Kvinge 28102a55b7
[xharness] Set the EnableSGenConc value for all project configurations. (#12698)
* Update to use EnableSGenConc instead of MtouchEnableSGenConc (either works,
  the former is the new future).
* Set EnableSGenConc as a top-level property, so we make sure it's set no
  matter how the project is executed.

This makes it so that this setting work for .NET projects, where we're not using project configurations.
2021-09-13 16:13:59 +02:00
Rolf Bjarne Kvinge 7f1d62ca13
[xharness] Skip some device variations for .NET. (#12699)
Skip:

* Any Thumb variation (Thumb code isn't supported anymore in .NET).
* Any AssemblyBuildTarget variation (compiling assemblies to dylibs [fastdev]
  or frameworks - neither is supported/implemented for .NET).

This trims down the test list a bit.
2021-09-13 16:13:36 +02:00
Rachel Kang fba8fe61dc
Merge branch 'main' into xcode13.0-coreimage-b1-b3 2021-09-10 18:00:51 -04:00
Rachel Kang 66a28266a4
Add missing changes 2021-09-10 17:57:35 -04:00
Rolf Bjarne Kvinge aadd53249f
[msbuild] Improve E7082 error message. (#12689) 2021-09-10 22:02:30 +02:00
Rolf Bjarne Kvinge f559399f19
[tests] Improve makefiles for .NET's dont link test. (#12690)
This makes it identical to the 'link sdk' and 'link all' makefiles.
2021-09-10 21:19:11 +02:00
Rolf Bjarne Kvinge 033ebd7f84
[tests] Import nunit.framework.targets in more .NET test projects. (#12691)
This is to set the -dlsym:-nunit.framework.dll option, because nunit.framework.dll
contains a P/Invoke to a function that doesn't exist.

For some reason this is more of a problem in tvOS projects than iOS projects
(although it happens for iOS projects as well).
2021-09-10 21:07:09 +02:00
Rachel Kang e75c4e36a3
Fix CIRawFilter intro issues
from Sebastien: "most filters are key-based natively (not-NSObject subclasses)) and we expose them as C# _user-type_ CIFilter-subclasses in recent years _most_ filters have also been exposed natively as protocols (not classes), we expose them as `*Protocol` interface types `CIRAWFilter` is a special case, it's a native `CIFilter` subclass so we're not using [CoreImageFilter] and [CoreImageFilterProperty] attributes to define it which also means we cannot use the "extra" tests to validate the filter properties. So we skip it here. Do not fear it's still tested, like any _normal_, NSObject subclass we have bound :-)"
2021-09-10 14:31:02 -04:00
Rachel Kang 08cc749359
[CoreImage] Update bindings for Xcode 13.0 beta 1 and 3 2021-09-10 14:09:43 -04:00
Manuel de la Pena 42dd6cea65
[XKit] Update for xcode13 beta 5. (#12610)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-09-10 12:16:55 -04:00
Rolf Bjarne Kvinge ce7b876dcf
[tests] Fix building fsharplibrary using the makefile. (#12676)
F# projects aren't named *.csproj.
2021-09-10 13:59:45 +02:00
Rolf Bjarne Kvinge 07f83a8815
[CoreFoundation] The native 'dispatch_queue_create_with_target' function is actually called 'dispatch_queue_create_with_target$V2'. (#12666)
Apple does this in their headers:

    #define DISPATCH_ALIAS_V2(sym)	 __asm__("_" #sym "$V2")

    dispatch_queue_t
    dispatch_queue_create_with_target(const char *_Nullable label,
    		dispatch_queue_attr_t _Nullable attr, dispatch_queue_t _Nullable target)
    		DISPATCH_ALIAS_V2(dispatch_queue_create_with_target);

Which means that the native compiler will call
'dispatch_queue_create_with_target$V2' when the source code says to call
'dispatch_queue_create_with_target'.

The only place I've run into this problem, is when building for tvOS (device),
and targetting exactly tvOS 10.0 (neither earlier or later), in which case the
linker fails:

    Undefined symbols for architecture arm64:
      "_dispatch_queue_create_with_target", referenced from:
          wrapper_managed_to_native_CoreFoundation_DispatchQueue_dispatch_queue_create_with_target_string_intptr_intptr in Xamarin.TVOS.dll.o

I filed this as a feedback with Apple some time ago [1], and Apple resolved it
as by design, saying "These symbols are renamed, please use the SDK."

Now I ran into it again with .NET, and it's become a bit more important, since
tvOS 10.0 is the earliest tvOS version we support, which means it'll be more
likely that customers use _exactly_ 10.0 as their target tvOS version. So I
looked into it again, and as far as I can tell, we can just call the '$V2'
variant instead of the original name everywhere.

Apple does the same thing for two other functions, but we haven't bound any of
those, so this only affects 'dispatch_queue_create_with_target' for us.

[1]: Bug ID 48076044: Can't reference 'dispatch_queue_create_with_target' when min tvOS version is exactly 10.0
2021-09-09 15:05:29 +02:00
Rolf Bjarne Kvinge cb998a3589
[msbuild/dotnet] Don't use the built-in publishing logic in .NET to copy frameworks to the app bundle. Fixes #12369. (#12656)
.NET/MSBuild don't handle symlinks properly [1], which means that we can't ask
.NET to copy frameworks to the app bundle, since frameworks may contain
symlinks.

In our case, the symptom was that instead of copying symlinks, the file the
symlink pointed to was copied instead, and then codesign complained about
invalid bundle format when we tried to sign the framework.

We fix this by having our own target (_CopyFrameworksToBundle) to copy
frameworks to the app bundle (instead of adding all the files in the
frameworks to the ResolvedFileToPublish item group), and then using 'ditto' to
copy the frameworks.

In order to create a test case for this, I also made the macOS and Mac
Catalyst versions of the XTest framework use symlinks:

* Create a proper XTest framework bundle hierarchy for macOS and Mac Catalyst
  by using the typical symlink structure (actual files in the Versions/A
  subdirectory, and then symlinks pointing into that directory).
* Create a separate Info.plist for each platform for XTest.framework, since
  using an otherwise correct framework makes tooling (such as codesign)
  complain if the Info.plist isn't correct too.

This made our existing tests show the bug.

Finally I had to fix signing frameworks where the executable is a symlink.

We were first resolving symlinks for the input - say we had an
Example.framework/Example symlink to Example.framework/Versions/A/Example -
and then checking the parent directory if it's a framework. The parent
directory of 'Example.framework/Versions/A/Example' is 'A', which did not meet
our framewrok condition (if it ends with '.framework').

The fix is to adjust the logic to resolve symlinks after checking if the input
is a framework or not.

[1]: https://github.com/dotnet/msbuild/issues/6821

Fixes https://github.com/xamarin/xamarin-macios/issues/12369.
2021-09-09 09:11:25 +02:00
Rolf Bjarne Kvinge 444e7dfcd9
[msbuild] Don't require an Info.plist for .NET builds. (#12661)
We either have defaults or MSBuild properties for the most important values that
were previously required to be in the Info.plist, so now it doesn't make sense anymore
to require an Info.plist, when for simple cases it will just be an empty file.

This allows us to simplify some of our test projects and remove a few empty Info.plist files.
2021-09-09 09:08:04 +02:00
Rolf Bjarne Kvinge b3c2b548de
[link sdk] Ignore XmlSerializationTest.Bug1820_GenericList on device due to a linker bug. (#12667) 2021-09-09 09:04:51 +02:00
Rolf Bjarne Kvinge 770b9c5d27
[tests] Adjust a few introspection checks to work on iOS 11.4.1 (#12668)
I ran into these failures when running on an iOS 11.4.1 device (iPhone 7 / A1778).
2021-09-09 09:00:20 +02:00
Chris Hamons 97e2e00b59
[xtro] Improve detection of Catalyst missing API by fixing xtro (#12626)
- macCatalyst was being missed as it is not all lower case
- Extend tv and watch 'act like iOS if not listed' to catalyst
2021-09-08 16:31:44 -05:00
Filip Navara 3010172bb5
Update CryptoTest for .NET 6 (#12658)
* Update CryptoTest for .NET 6

* Update tests/linker/ios/link sdk/CryptoTest.cs

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-09-08 18:03:52 +02:00
Filip Navara f28db5491e
Relax the tvOS special folder checks to make them pass both on dotnet and legacy. Fixes #12640. (#12659)
Fixes https://github.com/xamarin/xamarin-macios/issues/12640.
2021-09-08 17:59:40 +02:00
Rolf Bjarne Kvinge a968598af0
[tests] Add test case for making sure we have the right bundle identifier when executing DetectSigningIdentity. Fixes #12051. (#12655)
Add test case to verify that we pass the right bundle identifier to
DetectSigningIdentity when we're using a partial app manifest to set the
bundle identifier.

This proves that #12051 is already fixed.
2021-09-08 15:46:59 +02:00
Rolf Bjarne Kvinge 24ea02759f
[dotnet] Support SupportedOSPlatformVersion. Fixes #12336. (#12638)
* Add support for the SupportedOSPlatformVersion MSBuild property, and write
  it to the Info.plist for the corresponding minimum OS version.
* If there are any minimum OS version in the Info.plist, we'll now show an
  error if it doesn't match SupportedOSPlatformVersion.

This unfortunately means that if there's any minimum OS version in any
Info.plist, then that will most likely have to be moved to the
SupportedOSPlatformVersion property (or removed entirely if that's the right
choice), since it's unlikely to match the default value for
SupportedOSPlatformVersion. However, this was deemed to be the best option for
the future (it's a one-time pain during migration).

Also add new tests, update existing tests, and update the templates.

Fixes https://github.com/xamarin/xamarin-macios/issues/12336.
2021-09-08 09:20:05 +02:00
Rolf Bjarne Kvinge a0fe8c08ba
[msbuild] Add a public target/property to make customers able to add to the PartialAppManifest item group in their own targets. Fixes #12336. (#12645)
Also add a test.

Fixes https://github.com/xamarin/xamarin-macios/issues/12336 (for the second time).
2021-09-08 09:16:57 +02:00
Rolf Bjarne Kvinge e707c7cda8
[tests] Remove assert that fails on M1 on Rosetta. (#12641)
Fixes this error when running on M1 (and Rosetta):

    MonoTouchFixtures.CoreFoundation.BundleTest.TestGetBundleIdNull : 0.9134 ms
        [FAIL] TestIsArchitectureLoadable :   arm64 Expected => false
            Expected: False
            But was:  True
                at MonoTouchFixtures.CoreFoundation.BundleTest.TestIsArchitectureLoadable() in xamarin-macios/tests/monotouch-test/CoreFoundation/BundleTest.cs:line 375
2021-09-07 18:52:53 +02:00
Rolf Bjarne Kvinge 88cf80da2d
[xharness] Remove legacy Mac Catalyst support. (#12642)
We're going .NET all the way.

This simplifies xharness a little bit, and speeds up our test run somewhat.
2021-09-07 18:35:33 +02:00
dotnet-maestro[bot] 8bfa57704f
[main] Update dependencies from dotnet/installer (#12571)
* Update dependencies from https://github.com/dotnet/installer build 20210826.20

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21426.20

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21427.35

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21428.23

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21430.3

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21431.4

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21451.9

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21419.1 -> To Version 6.0.100-preview.6.21430.2 (parent: Microsoft.Dotnet.Sdk.Internal

* [tests] Adjust path changes for tvOS

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21452.10

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21419.1 -> To Version 6.0.100-preview.6.21430.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Looks like macOS/dotnet is not quite the legacy build (which works)

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21453.10

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21419.1 -> To Version 6.0.100-preview.6.21452.4 (parent: Microsoft.Dotnet.Sdk.Internal

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21454.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21419.1 -> To Version 6.0.100-preview.6.21452.4 (parent: Microsoft.Dotnet.Sdk.Internal

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21454.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21419.1 -> To Version 6.0.100-preview.6.21452.4 (parent: Microsoft.Dotnet.Sdk.Internal

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.2.21425.12 -> To Version 6.0.100-rc.2.21456.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21419.1 -> To Version 6.0.100-preview.6.21452.4 (parent: Microsoft.Dotnet.Sdk.Internal

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2021-09-07 12:26:14 +02:00
Rolf Bjarne Kvinge 69b95172b3
[xharness] Unify the list of test projects for .NET between iOS and macOS. (#12469)
* [xharness] Unify the list of test projects for .NET between iOS and macOS.

* [xharness] Don't enable all .NET tests if .NET is enabled.

Some tests (such as device tests) have additional checks that must be honored as well.

* [xharness] If a test is ignored, then it doesn't matter what the corresponding build task is doing.

A build task can be shared between multiple tests, and it can be building for
another (enabled) test. This happens for iOS 32-bits and 64-bits simulator:
the app is built once, but have two different tests running.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-09-06 15:23:41 +02:00