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

5085 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot 0a88e5964c
[tests][intro] Fix introspection when running on MacCatalyst 15 (macOS12) (#12403) 2021-08-11 20:05:13 -04:00
Sebastien Pouliot cc3b88c2ed
[tests][linker] Re-enable the metadata reducer test case for dotnet (#12404)
It's been enabled (on dotnet side) for a while, even in debug.

Fix https://github.com/xamarin/xamarin-macios/issues/9612
2021-08-11 14:52:35 -04:00
Rachel Kang ebec4f33dc
Merge branch 'main' into xcode13.0-quicklookui-b1 2021-08-11 11:21:09 -04:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Rolf Bjarne Kvinge 46afe81149
[dotnet] Add support for 'dotnet publish'. Fixes #11807. (#12397)
* Add support for 'dotnet publish'.
* Add support for a 'PkgPackagePath' for macOS and Mac Catalyst, an MSBuild
  property to specify the resulting .pkg path, to reflect the existing
  'IpaPackagePath' (for iOS and tvOS).
* Fix MSBuild logic that uses 'IpaPackagePath'. Looks like nobody has ever
  used this...
* Add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/11807.
2021-08-11 10:01:16 +02:00
Rolf Bjarne Kvinge 104ab12bdd
[dotnet/msbuild] Fix publishing user frameworks and dynamic libraries from binding projects. (#12396)
We extract frameworks from third-party libraries when running the linker, and
we need to store this information on disk and the reload it after the linker
has executed, and add it to the existing MSBuild variables that keep track of
the user frameworks and dynamic libraries that have to be copied to the app
bundle.

Fixes the framework-test tests.
2021-08-11 09:58:00 +02:00
Rolf Bjarne Kvinge 5b23ea83b1
[monotouch-test] Use unique file names to avoid issues when multiple proceseses of monotouch-test are running simultaneously. Fixes #xamarin/maccore@2461. (#12395)
Fixes https://github.com/xamarin/maccore/issues/2461.
2021-08-11 09:52:02 +02:00
Manuel de la Pena 0d5d94da41
[OSLog] Add support for xcode13 beta4. (#12392) 2021-08-10 23:12:16 -04:00
Sebastien Pouliot a20d417bf7
[dotnet][linker] Enable the sealer optimization (#12009)
when (by default)
* the interpreter is not enabled (since new code might subclass or override the members analyzed at build time)
* building for release

Reverts c56b893b68
Fix https://github.com/xamarin/xamarin-macios/issues/9573

Notes

* Even if possible (in metadata) there is no point in setting `final` on
a method if we remove `virtual`. This match ILLink version of the sealer
and makes the same test pass on both.

* Don't apply optimization on non-AOT builds, e.g. simulators, since some
features (like XML serialization) checks for
`RuntimeFeature.IsDynamicCodeSupported` and that requires some types
to be subclassed thru SRE
2021-08-10 16:01:30 -04:00
Rachel Kang 194d7c4c89
Merge branch 'main' into xcode13.0-quicklookui-b1 2021-08-10 13:25:53 -04:00
Manuel de la Pena 687b3b9d08
[SystemConfiguration] Add support for xcode13 beta4. (#12393) 2021-08-10 10:16:05 -04:00
Manuel de la Pena c5573db360
[OpenGL] Add support for xcode 13 beta4. (#12394) 2021-08-10 10:15:34 -04:00
Rolf Bjarne Kvinge 9273704267
[xtro] Ignore Obsoleted enums in EnumCheck. (#12390)
Treat [Obsoleted] enums as [Obsolete] enums: ignore them. This makes it
possible to remove a few ignored entries.
2021-08-10 13:40:25 +02:00
Rolf Bjarne Kvinge 7b286adb47
[tests] Add a .NET version of framework-test to our test list. (#12373) 2021-08-10 07:40:00 +02:00
Rolf Bjarne Kvinge 15ace257ab
[msbuild] Delete any Mono crash dump files in the root app bundle before codesigning. Fixes #12320. (#12332)
This is what happens:

1. Mono will write crash dumps in the current directory:
   57bfe47451/src/mono/mono/utils/mono-state.c (L302-L322)
2. The current directory is by default the root of the app bundle.
3. If there are any files in the root of the app bundle for macOS or Mac
   Catalyst, 'codesign' will fail ("unsealed contents present in the bundle
   root").

This leads to the following sequence of events:

1. App developer builds & runs a Mac Catalyst app.
2. The app crashes for some reason.
3. Mono creates a crash dump (in the root directory of the app bundle).
4. The app developer changes something in the project and tries again.
5. The build fails, because 'codesign' fails.

Avoid this by deleting any crash dump files from the root of the app bundle
before signing the app.
2021-08-10 07:39:00 +02:00
Manuel de la Pena ae77aed7e8
[Security] Add Xcode 13 beta 4 support. (#12365) 2021-08-09 21:30:14 -04:00
Rachel Kang 80de25c252
Add missing using and remove todo 2021-08-09 12:44:54 -04:00
Sebastien Pouliot cffd57d681
[cecil] Update all package references to the latest 0.11.4 (#12379) 2021-08-09 10:18:16 -04:00
Rolf Bjarne Kvinge 6232edc9ed
[monotouch-test] Ignore ReadingListTest.DefaultReadingList. (#12383)
This test adds entries to the global reading list in Safari, and there's no
API for the test to clean up after itself, so the reading list becomes an
endless list of entries after a whlie.

Beside the fact that this is somewhat annoying for people who actually use
their reading lists, it can also can end up consuming a significant amount of
space on the hard drive, because Safari will download each site to be
available offline.
2021-08-09 14:51:44 +02:00
Rolf Bjarne Kvinge baaa08eb00
[tests] Fix typo in error message. (#12370) 2021-08-09 09:49:51 +02:00
Rolf Bjarne Kvinge 4371133cf7
[dotnet] Remove workaround for private symbols for AOT. (#12334)
* [dotnet] Remove workaround for private symbols for AOT.

* [tools] Make Application.AotArguments a list of string.

This is just a simple refactoring to make Application.AotArguments a list of
strings instead of a comma-separated list of values.

* [tools] Only use direct-icalls when linking mono statically.

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

* [mtouch] Fix aot arguments comparison.

* [tests] Adjust mtouch test according to mtouch changes.

* [tests] Add minimum OS version to the Mac Catalyst variation of the MySimpleApp test case.
2021-08-09 09:45:58 +02:00
Sebastien Pouliot ecad9d9667
[tests][intro] Fix Phase tests on macOS 12 and iOS devices (#12376)
It's a `Phase` vs `PHASE` lookup that make the tests checking for
fields fail.

```
FieldExists: 3 errors found in 6603 fields validated: PHASESpatialCategoryDirectPathTransmission, PHASESpatialCategoryEarlyReflections, PHASESpatialCategoryLateReverb
```
2021-08-06 16:28:04 -04:00
Rachel Kang e45969fb08
Merge pull request #12337 from rachelkang/xcode13.0-quicklook-b1-b2-b3-b4
[QuickLook] Update bindings for Xcode 13.0 beta 1,2,3,4
2021-08-06 12:27:08 -04:00
Sebastien Pouliot 22ccf2e81b
[generator] Use new `CFArray.StringArrayFromHandle` instead of the existing `NSArray` API (#12368)
This is another example that p/invokes are much faster than calling
selectors.

Beside the generator the manual bindings were updated to use the newer
API and the old one was decorated as `[Obsolete]`.

|                        Method |          name |                value |            Mean |           Error |        StdDev |
|------------------------------ |-------------- |--------------------- |----------------:|----------------:|--------------:|
| CFArray_StringArrayFromHandle |         empty |                   () |        123.9 ns |        68.92 ns |       3.78 ns |
| NSArray_StringArrayFromHandle |         empty |                   () |      1,422.6 ns |        25.83 ns |       1.42 ns |
| CFArray_StringArrayFromHandle |           few |    (  (...).") [108] |      1,885.2 ns |        46.37 ns |       2.54 ns |
| NSArray_StringArrayFromHandle |           few |    (  (...).") [108] |      8,530.0 ns |       594.40 ns |      32.58 ns |
| CFArray_StringArrayFromHandle | large_mutable |    ((...)) [8419330] | 15,821,101.0 ns | 4,803,631.19 ns | 263,303.23 ns |
| NSArray_StringArrayFromHandle | large_mutable |    ((...)) [8419330] | 22,823,871.9 ns | 6,589,380.43 ns | 361,186.18 ns |
| CFArray_StringArrayFromHandle |       mutable |   (   (...)9e") [54] |        867.4 ns |        59.23 ns |       3.25 ns |
| NSArray_StringArrayFromHandle |       mutable |   (   (...)9e") [54] |      4,939.6 ns |       203.28 ns |      11.14 ns |

note: `NSArray.StringArrayFromHandle` was already using (p/invoke-based)
`CFString.FromHandle` instead of (selector-based) `NSString.FromHandle`
to create the managed `string` instances inside the `string[]`.
2021-08-06 09:17:48 -04:00
Rolf Bjarne Kvinge 6d078c2ac8
[tests] Add debug spew to track down #xamarin/maccore@2414. (#12354) 2021-08-06 09:45:55 +02:00
Rolf Bjarne Kvinge b06baea3c8
[tests] Merge the Main function into the AppDelegate class in numerous tests. (#12356)
Also use a non-obsolete overload of UIApplication.Main.

This shrinks our code and file count a bit.
2021-08-06 09:44:58 +02:00
Rolf Bjarne Kvinge 013054a48c
[tests] Add .NET version of the fsharp test. (#12359)
Partial fix for https://github.com/xamarin/xamarin-macios/issues/10217.
2021-08-06 09:29:30 +02:00
Sebastien Pouliot 77defde89e
[corefoundation] Fix minimum version on MacCatalyst (#12361)
There's no need in having availability attributes for versions earlier
than the current minimum.

Re-enable the `Introduced` test for _legacy_ Catalyst as it's fine since
it use the older attributes. It's still not possible to enable it for
`NET` until all manual bindings are updated.
2021-08-05 19:19:26 -04:00
Manuel de la Pena 244232d52d
[NearbyInterction] Add support for xcode 13 beta 4. (#12351) 2021-08-05 15:29:00 -04:00
Rachel Kang 5b72769db2
Merge branch 'main' into xcode13.0-quicklook-b1-b2-b3-b4 2021-08-05 10:03:43 -04:00
Manuel de la Pena 0ffed970d6
[NetworkExtension] Add Xcode 13 beta 4 support. (#12352) 2021-08-05 09:41:43 -04:00
Rolf Bjarne Kvinge 576dbb9b35
[msbuild/dotnet] Don't overwrite the 'CreateAppBundleDependsOn' property, only add to it. Fixes #12325. (#12346)
Fixes https://github.com/xamarin/xamarin-macios/issues/12325.
2021-08-05 08:17:44 +02:00
Manuel de la Pena 818198b789
[MLCompute] Add support for Xcode 13 beta 4. (#12348) 2021-08-05 01:02:27 -04:00
Manuel de la Pena 41253c3636
[ModelIO] Add Xcode 13 beta4 support. (#12349) 2021-08-04 22:40:05 -04:00
Manuel de la Pena 9aef167b19
[PHASE] Add suppport for Xcode13 beta 2. (#12098) 2021-08-04 22:38:03 -04:00
Sebastien Pouliot fa5f323c88
[tests][intro] Fix protocol results for macOS 12 beta (#12347)
IOW move some custom checks from iOS to the base class that also
covers macOS.
2021-08-04 16:40:14 -04:00
Rolf Bjarne Kvinge a91e34f01b
[xharness] Automatically inline Imports to a "shared.csproj" when cloning projects. Fixes #12316 and #12277. (#12322)
This way we process the shared.csproj that we use in our .NET test projects.
The main effect is that we'll clone any project references included in the
shared.csproj, which will fix #12316. On another hand, it means that we'll
add/remove defines in referenced projects, which fixes #12277.

It also allows us to put more code in the "shared.csproj" files.

Fixes https://github.com/xamarin/xamarin-macios/issues/12316.
Fixes https://github.com/xamarin/xamarin-macios/issues/12277.
2021-08-04 18:13:02 +02:00
Rachel Kang 142e71780a
[QuickLookThumbnailing] Update bindings for Xcode 13.0 beta 1 (#12338) 2021-08-04 10:12:56 -04:00
Manuel de la Pena 62eec286db
[MetricKit] Add support for Xcode 13 beta4. (#12326)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-08-04 10:12:29 -04:00
TJ Lambert 68a5091cfa
[AuthenticationServices] Updates for Xcode13 Beta3 (#12203)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-08-04 10:11:26 -04:00
TJ Lambert 9a6c0753ac
[SoundAnalysis] Updates for Xcode13 Beta1 (#12181)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-08-04 10:09:46 -04:00
Rolf Bjarne Kvinge 82af982bd0
[dotnet] Handle an absolute PublishDir. Fixes #12041 and #12224. (#12333)
Properly compute the path where to put the app bundle and its files, relative
to the publish directory. The _AppBundlePath variable contains the path to the
app bundle relative to the project directory, but we need it relative to the
publish directory for .NET.

Fixes https://github.com/xamarin/xamarin-macios/issues/12041.
Fixes https://github.com/xamarin/xamarin-macios/issues/12224.
2021-08-04 15:12:24 +02:00
Sebastien Pouliot b39f3ac92d
[xcode13] Fix catalyst intro tests on macOS 12 (#12339)
Move a few macOS special cases into base class so they will apply to
Catalyst too.
2021-08-04 08:48:47 -04:00
Sebastien Pouliot dac58e4115
[objcruntime] Enable nullable on `Selector` class (#12340)
This requires a small change to the generator since `Selector.FromHandle`
can return `null` but it does not means the invoked API can (and we are
interested in the later).

Fixed up existing API returning potentially `null` `Selector`, IOW adding
the missing `[NullAllowed]` on them and updating xtro.
2021-08-04 08:47:53 -04:00
Rolf Bjarne Kvinge ad7d08a63d
Always create binlogs during the build. (#12331)
On CI we'll collect all the binlogs in the repository and make them available
for post-build analysis if need be, so this will make it easier to diagnose
build problems.
2021-08-04 09:30:16 +02:00
Rachel Kang 75b150ef5f
[QuickLook] Update bindings for Xcode 13.0 beta 1,2,3,4 2021-08-03 16:37:56 -04:00
Rachel Kang fda13f2e05
[SceneKit] Update bindings for Xcode13.0 beta 1 & beta 2 (#12121)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-08-03 13:19:10 -04:00
Rachel Kang 3d0ac38b2f
[PassKit] Update bindings for Xcode 13.0 beta 1, 2 (#12299) 2021-08-03 13:17:27 -04:00
TJ Lambert 6ae2ca062b
[HomeKit] Updates for Xcode13 Beta 1-2 (#12092)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-08-03 12:47:43 -04:00
Rolf Bjarne Kvinge b9c12e5fb0
[introspection] Make green on .NET/Mac Catalyst. Fixes #10215. (#12329)
* [introspection] Ignore the ApiAvailabilityTest.LegacyAttribute test on Mac Catalyst as well.

* [introspection] #10883 only applies to Mac Catalyst for legacy Xamarin.

* [xharness] introspection is now green on .NET/Mac Catalyst
2021-08-03 17:58:10 +02:00
Rolf Bjarne Kvinge 18a9a90450
[xharness] Gracefully handle any exceptions that may occur when parsing build logs. (#12318)
* [xharness] Gracefully handle any exceptions that may occur when parsing build logs.

Fixes a harness exception:

    Harness exception for 'monotouch-test': System.ArgumentException: '', hexadecimal value 0x1D, is an invalid character.
    at System.Xml.XmlEncodedRawTextWriter.InvalidXmlChar (System.Int32 ch, System.Char* pDst, System.Boolean entitize) [0x00026] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:1420
    at System.Xml.XmlEncodedRawTextWriter.WriteCDataSection (System.String text) [0x00251] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:1370
    at System.Xml.XmlEncodedRawTextWriter.WriteCData (System.String text) [0x0012a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:470
    at System.Xml.XmlEncodedRawTextWriterIndent.WriteCData (System.String text) [0x00007] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlEncodedRawTextWriter.cs:1750
    at System.Xml.XmlWellFormedWriter.WriteCData (System.String text) [0x00029] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlWellFormedWriter.cs:771
    at Microsoft.DotNet.XHarness.iOS.Shared.XmlResults.TestReportGenerator.WriteFailure (System.Xml.XmlWriter writer, System.String message, System.IO.TextReader stderr) [0x00031] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/TestReportGenerator.cs:41
    at Microsoft.DotNet.XHarness.iOS.Shared.XmlResults.NUnitV3TestReportGenerator.GenerateFailure (System.Xml.XmlWriter writer, System.String title, System.String message, System.IO.TextReader stderr) [0x0030e] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/NUnitV3TestReportGenerator.cs:122
    at Microsoft.DotNet.XHarness.iOS.Shared.XmlResults.XmlResultParser.GenerateFailureXml (System.String destination, System.String title, System.String message, System.IO.TextReader stderrReader, Microsoft.DotNet.XHarness.Common.XmlResultJargon jargon) [0x00033] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/XmlResultParser.cs:226
    at Microsoft.DotNet.XHarness.iOS.Shared.XmlResults.XmlResultParser.GenerateFailure (Microsoft.DotNet.XHarness.iOS.Shared.Logging.ILogs logs, System.String source, System.String appName, System.String variation, System.String title, System.String message, System.IO.TextReader stderrReader, Microsoft.DotNet.XHarness.Common.XmlResultJargon jargon) [0x000a4] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/XmlResultParser.cs:248
    at Xharness.Jenkins.TestTasks.RunTest.BuildAsync () [0x00274] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/RunTest.cs:74
    at Xharness.Jenkins.TestTasks.RunTest.ExecuteAsync () [0x000d8] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/RunTest.cs:99
    at Xharness.Jenkins.TestTasks.TestTasks.RunInternalAsync () [0x00226] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/TestTask.cs:283

* Fix missing parenthesis in message.
2021-08-03 12:00:35 +02:00
Rolf Bjarne Kvinge 12cf14662f
[monotouch-test] Resolve symlinks in paths before comparing them. (#12321)
Fixes this test failure on device:

    [FAIL] CurrentDirectory :   Current directory at launch
      Expected string length 97 but was 89. Strings differ at index 1.
      Expected: "/private/var/containers/Bundle/Application/4824129A-8668-4CD9..."
      But was:  "/var/containers/Bundle/Application/4824129A-8668-4CD9-9280-7F..."
2021-08-03 07:36:26 +02:00
TJ Lambert f3758812ec
[Localization] Removing Test with Ignore File (#12258)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-08-02 20:43:30 -04:00
Manuel de la Pena 0ca2038d7f
[LocalAuthentication] Add support for Xcode 13 beta 4. (#12301) 2021-08-02 16:59:52 -04:00
Manuel de la Pena 0f15240c9f
[FileProvider] Add support for Xcode13 beta 4. (#12300)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-08-02 12:12:51 -04:00
Rolf Bjarne Kvinge d506a13466
[monotouch-test] Teach HealthKit tests about new HKQuantityTypeIdentifiers/HKCategoryTypeIdentifiers. (#12317)
Fixes these test failures:

    MonoTouchFixtures.HealthKit.CategoryTypeIdentifier
    	[FAIL] EnumValues_22351 : AppleWalkingSteadinessEvent could not be created: System.ArgumentNullException: Value cannot be null.
    Parameter name: hkCategoryTypeIdentifier
      at ObjCRuntime.NativeObjectExtensions.GetNonNullHandle (ObjCRuntime.INativeObject self, System.String argumentName) [0x00003] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/INativeObject.cs:27
      at HealthKit.HKObjectType.GetCategoryType (Foundation.NSString hkCategoryTypeIdentifier) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/HealthKit/HKObjectType.g.cs:111
      at HealthKit.HKCategoryType.Create (HealthKit.HKCategoryTypeIdentifier kind) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/HealthKit/HKObjectType.cs:26
      at MonoTouchFixtures.HealthKit.CategoryTypeIdentifier.EnumValues_22351 () [0x001fd] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/HealthKit/CategoryTypeIdentifierTest.cs:115
      at MonoTouchFixtures.HealthKit.CategoryTypeIdentifier.EnumValues_22351 () [0x0024f] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/HealthKit/CategoryTypeIdentifierTest.cs:120

    MonoTouchFixtures.HealthKit.QuantityTypeIdentifier
    	[FAIL] EnumValues_22351 : AppleWalkingSteadiness could not be created: System.ArgumentNullException: Value cannot be null.
    Parameter name: hkTypeIdentifier
      at ObjCRuntime.NativeObjectExtensions.GetNonNullHandle (ObjCRuntime.INativeObject self, System.String argumentName) [0x00003] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/INativeObject.cs:27
      at HealthKit.HKObjectType.GetQuantityType (Foundation.NSString hkTypeIdentifier) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/HealthKit/HKObjectType.g.cs:162
      at HealthKit.HKQuantityType.Create (HealthKit.HKQuantityTypeIdentifier kind) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/HealthKit/HKObjectType.cs:19
      at MonoTouchFixtures.HealthKit.QuantityTypeIdentifier.EnumValues_22351 () [0x0017a] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/HealthKit/QuantityTypeIdentifierTest.cs:87
      at MonoTouchFixtures.HealthKit.QuantityTypeIdentifier.EnumValues_22351 () [0x001cc] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/HealthKit/QuantityTypeIdentifierTest.cs:92

Also make these tests show all failing enum values at once, instead of having
to run the test after adding each new case.
2021-08-02 17:41:51 +02:00
Manuel de la Pena e20c7b2179
[Tests] Fix the tests.sln (#12310) 2021-07-30 13:42:54 -04:00
Rachel Kang af2fea2f82
[Photos] Update bindings for Xcode 13.0 beta 1 and beta 2 (#12163)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-07-30 12:33:59 -04:00
Rolf Bjarne Kvinge 3766cf8fa2
[monotouch-test] Use the same timezone for the calendar as we do for the time (UTC) in CalendarTest.DateComponentsTest. Fixes #xamarin/maccore@2481. (#12304)
Fixes https://github.com/xamarin/maccore/issues/2481.
2021-07-30 16:02:36 +02:00
Rolf Bjarne Kvinge 9274e5a4f0
[tests] Share more helper make logic in MySimpleApp. (#12296) 2021-07-30 10:21:16 +02:00
Rolf Bjarne Kvinge 6253a88198
[monotouch-test] Give up in CaptiveNetworkTest.TryCopyCurrentNetworkInfo. Fixes #12278. (#12291)
Don't presume to be able to figure out whether we should get back network info
or not, so just remove the corresponding assert.

Fixes https://github.com/xamarin/xamarin-macios/issues/12278.
2021-07-30 09:52:32 +02:00
Manuel de la Pena 6dfdcf8401
[CoreLocation] Add support for Xcode 13 beta 4. (#12298) 2021-07-29 19:59:38 -04:00
Manuel de la Pena dab0f2ed9a
[HealthKit] Add support for xcode13 beta4. (#12184) 2021-07-29 11:11:39 -04:00
Rolf Bjarne Kvinge a6c7c12474
[src] Add AppKit to Mac Catalyst. (#12268)
* A lot of availability attribute updates.
* Some conditional "#if !__MACCATALYST__" in manual binding files.
* xtro updates.
* Misc other minor tweaks.
2021-07-29 16:17:51 +02:00
Rolf Bjarne Kvinge 63f28c0c5c
[dotnet/msbuild] Fix packaging and archiving support in .NET. Partial fix for #10413. (#12244)
* Rearrange some MSBuild logic so that the packaging/archiving code for macOS
  can also be used for Mac Catalyst.
* Make the .NET build logic package/archive when requested to do so.
* Add tests.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/10413.
2021-07-29 15:33:08 +02:00
Rolf Bjarne Kvinge 3d822de007
[runtime] List all assemblies in TRUSTED_PLATFORM_ASSEMBLIES as pass it to MonoVM/CoreCLR. Fixes #12265. (#12272)
List all the assemblies in the app bundle and pass them to MonoVM/CoreCLR's in
the TRUSTED_PLATFORM_ASSEMBLIES initialization property.

This way CoreCLR knows where to find System.Private.CoreLib.dll for fat apps
(it's in the runtimeidentifier-specific subdirectory, and by default CoreCLR
will only look next to libcoreclr.dylib).

Fixes https://github.com/xamarin/xamarin-macios/issues/12265.
2021-07-29 07:45:24 +02:00
Manuel de la Pena 38140f2cce
[Xcode13] Bump for Xcode 13 beta4. (#12273) 2021-07-28 16:58:00 -04:00
Manuel de la Pena f7c6e8ab6b
[xtro] Append the lines and then sort them to get everything grouped better. (#12274) 2021-07-28 16:18:00 -04:00
Manuel de la Pena 3336910dd8
[Xtro] If the sanitizer removed all selectors, remove the file. (#12256)
A new check was added to ensure that empty .todo files are not added,
yet when the sanitizer removes all lines we get an error per empty file.

Since we are auto-sanitizing, we want to remove those empty files.
2021-07-28 11:21:56 -04:00
Rolf Bjarne Kvinge 9dcc4d07b4
[runtime] Fix the arguments to the managed main function when using CoreCLR. Fixes #12219. (#12239)
Also add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/12219.
2021-07-28 17:12:29 +02:00
VS MobileTools Engineering Service 2 c5e60a1462
[Localization] Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 5018259 (#12220) 2021-07-28 09:57:35 -05:00
Rolf Bjarne Kvinge d24b2203af
[monotouch-test] No need to ignore NSTimeZoneTest.All_28300 anymore. (#12241) 2021-07-28 15:01:28 +02:00
dotnet-maestro[bot] 68476989f4
[main] Update dependencies from dotnet/installer (#12245)
* Update dependencies from https://github.com/dotnet/installer build 20210727.4

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.1.21376.3 -> To Version 6.0.100-rc.1.21377.4

Dependency coherency updates

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

* Bump Mono.Cecil from 0.11.3 to 0.11.4.

* [dotnet-linker] Reference Mono.Cecil 0.11.4 directly.

Works around https://github.com/mono/linker/issues/2173.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-07-28 09:46:36 +02:00
Rolf Bjarne Kvinge 2ca8970122
[tests] Add a .NET version of introspection for Mac Catalyst. (#12039)
* [tests] Add a .NET version of introspection for Mac Catalyst.

It shows a lot of failures (so it's disabled by default), but this way we can
at least start to fix the failures.

* [xharness] Always ignore the new test.

* [xharness] Ignored projects should be ignored.
2021-07-28 09:39:29 +02:00
Rolf Bjarne Kvinge c202ba4a93
[generator] Skip protocols that aren't available on the current platform. (#12208)
That way we can do this in api definitions:

    [BaseType (typeof (NSObject))]
    interface MyType : MyProtocol { }

    [Protocol]
    [NoMacCatalyst]
    interface MyProtocol {}

instead of this:

    [BaseType (typeof (NSObject))]
    interface MyType
    #if __MACOS__
        : MyProtocol
    #endif
    {
    }

    [Protocol]
    [NoMacCatalyst]
    interface MyProtocol {}

for a type that implements a protocol on macOS, but not on Mac Catalyst.
2021-07-28 09:35:41 +02:00
Rolf Bjarne Kvinge 6a40d45337
[AppKit/Foundation] Numerous API adjustments. (#12243)
* Merged a MonoMac-only version of NSMutableCharacterSet + a non-MonoMac version
  of NSMutableCharacterSet into a single definition.
* Add a few [NullAllowed] where new API triggered xtro warnings (I either had to
  add more ignores to xtro, or fix the issues - I decided to fix the issues).
* Remove numerous "#if MONOMAC" blocks and switched to availability attributes.
* Merged a MonoMac-only list of NSWindow fields and a non-MonoMac list of NSWindow
  fields into a single definition (which was quite useless because NSWindow is only
  present on macOS, so the non-MonoMac list was just dead code). 
* Misc other availability attribute additions/fixes.
2021-07-28 09:18:48 +02:00
Rolf Bjarne Kvinge 25f19ae78a Merge remote-tracking branch 'origin/main' into dotnet-archive 2021-07-28 09:18:19 +02:00
Rolf Bjarne Kvinge 7986b2f2af
[dotnet] Globalization works for Mac Catalyst now. Fixes #11392. (#12247)
Fixes https://github.com/xamarin/xamarin-macios/issues/11392.
2021-07-28 09:12:22 +02:00
Rolf Bjarne Kvinge 600ce3290b
[monotouch-test] Adjust CalendarTest.DateComponentsTest to use a specific time zone. (#12249)
Hopefully avoids random test failures like https://github.com/xamarin/maccore/issues/2471#issuecomment-887517838.
2021-07-28 09:08:52 +02:00
Rolf Bjarne Kvinge 7260f267d9
[tests] Remove workaround for #dotnet/runtime@47120, it's been fixed. (#12253) 2021-07-28 09:08:13 +02:00
Rolf Bjarne Kvinge 08dba89c98
[tests] Add dummy variable to put System.Runtime.CompilerServices.Unsafe.dll next to the test assembly. (#12251)
Otherwise this happens when running tests from within the IDE:

error BI0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
  at System.ReadOnlySpan`1[T].op_Implicit (T[] array) [0x00000] in <16786cfd571c4686983021cfcee42fb4>:0
  at System.Reflection.TypeLoading.CoreTypes..ctor (System.Reflection.MetadataLoadContext loader, System.String coreAssemblyName) [0x0003d] in <49552709e6e14610b2a2f34b9d5f4c52>:0
  at System.Reflection.MetadataLoadContext..ctor (System.Reflection.MetadataAssemblyResolver resolver, System.String coreAssemblyName) [0x00046] in <49552709e6e14610b2a2f34b9d5f4c52>:0
  at BindingTouch.Main3 (System.String[] args) [0x00e91] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/btouch.cs:454
  at BindingTouch.Main2 (System.String[] args) [0x00007] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/btouch.cs:199
  at BindingTouch.Main (System.String[] args) [0x00002] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/btouch.cs:91
  at System.Environment.get_StackTrace () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/Environment.cs:316
  at ErrorHelper.ShowInternal (System.Exception e) [0x0010f] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/error.cs:175
  at ErrorHelper.Show (System.Exception e, System.Boolean rethrow_errors) [0x00089] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/error.cs:125
  at BindingTouch.Main (System.String[] args) [0x0000d] in /Users/rolf/work/maccore/msbuild/xamarin-macios/src/btouch.cs:93
  at Xamarin.Tests.BGenTool.Execute () [0x000a1] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTool.cs:228
  at Xamarin.Tests.BGenTool.AssertExecute (System.String message) [0x00001] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTool.cs:207
  at GeneratorTests.BGenTests.BuildFile (Xamarin.Tests.Profile profile, System.Boolean nowarnings, System.Boolean processEnums, System.Collections.Generic.IEnumerable`1[T] references, System.String[] filenames) [0x000ab] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTests.cs:764
  at GeneratorTests.BGenTests.BuildFile (Xamarin.Tests.Profile profile, System.Boolean nowarnings, System.Boolean processEnums, System.String[] filenames) [0x00001] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTests.cs:750
  at GeneratorTests.BGenTests.BuildFile (Xamarin.Tests.Profile profile, System.String[] filenames) [0x00001] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTests.cs:740
  at GeneratorTests.BGenTests.IgnoreUnavailableProtocol () [0x00001] in /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/generator/BGenTests.cs:636
  at System.Reflection.RuntimeMethodInfo.InternalInvoke (System.Reflection.RuntimeMethodInfo , System.Object , System.Object[] , System.Exception& ) [0x00000] in <08f46039e5064c628bf7795f9b970b7b>:0
  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 /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Reflection/MethodBase.cs:53
  at NUnit.Framework.Internal.Reflect.InvokeMethod (System.Reflection.MethodInfo method, System.Object fixture, System.Object[] args) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.MethodWrapper.Invoke (System.Object fixture, System.Object[] args) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Commands.TestMethodCommand.InvokeTestMethod (NUnit.Framework.Internal.TestExecutionContext context) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod (NUnit.Framework.Internal.TestExecutionContext context) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute (NUnit.Framework.Internal.TestExecutionContext context) [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork () [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread () [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Execution.WorkItem.Execute () [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at NUnit.Framework.Internal.Execution.TestWorker.TestWorkerThreadProc () [0x00000] in <be0e2b70ca254bb684417cccea7d5290>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/thread.cs:74
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:968
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:899
  at System.Threading.ThreadHelper.ThreadStart () [0x00008] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/thread.cs:111
2021-07-28 09:00:29 +02:00
Rolf Bjarne Kvinge 2900ccb173
[xharness] Bump timeout for the .NET unit tests. (#12240)
Adding more and more tests make the tests take longer and longer...
2021-07-27 15:46:03 +02:00
Sebastien Pouliot 1fa43189b5
[generator] Do not generate `BindingImplOptions.Optimizable` when code snippets are provided (#12165)
unless the snippet-based attribute also set the `Optimizable` property.

IOW this is now required to _opt-in_ (to optimize) instead of default,
with no ~easy~ way to turn it off.

Re-enabled each of the `[Dispose]` cases after protecting the required
extra calls they make.

Fix https://github.com/xamarin/xamarin-macios/issues/12150

* Add test for [Dispose] and SnippetAttribute subclasses

* Opt-in all [*Snippet] to be optimizable

This is exactly what we have been shipping for years (no changes).

Unlike [Dispose] there is no change in the generated code or the
optimizations.

Future snippets should come with tests - which is _normal_ for any
manual code (which they are) added to the SDK
2021-07-27 09:36:22 -04:00
Rolf Bjarne Kvinge d22cf7da8c [dotnet] Add unit tests for archiving, package creation and ipa creation. 2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 1f8c7130f4
[xtro] Improve the auto-sanitizer. (#12226)
Now with support for auto-sanitizing todo files.
2021-07-27 07:46:04 +02:00
Rolf Bjarne Kvinge 0549af9736
[dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. (#12211)
* Add support for the interpreter everywhere.
* Add support for the AOT compiler everywhere we didn't support it before,
  because the interpreter needs it (at least System.Private.CoreLib.dll must
  be AOT-compiled when using the interpreter).
* Do FullAOT compilation on Mac Catalyst/ARM64 if we're not using the
  interpreter, since we can't use the JIT.
* Fix monotouch-test to be green on Mac Catalyst/ARM64.

Fixes https://github.com/xamarin/xamarin-macios/issues/11724.
Fixes https://github.com/xamarin/xamarin-macios/issues/11421.
2021-07-27 07:39:43 +02:00
Rolf Bjarne Kvinge 52ad560f3b
[monotouch-test] Make CalendarTest.TestOrdinality location-agnostic. Fixes #xamarin/maccore@2471. (#12192)
Modifying the test to use UTC datetimes instead of local datetimes + specify
the timezone for the NSCalendar to make the results predictable everywhere and
at all times.

Fixes https://github.com/xamarin/maccore/issues/2471.
2021-07-27 07:37:15 +02:00
Sebastien Pouliot 2032f4a09a
[tests] Fix introspection results on iOS 15 beta 3 devices (#12232) 2021-07-26 20:31:13 -04:00
Sebastien Pouliot 13b1b3c45a
[tests][macos] Fix protocol failures for introspection on beta 3 (#12233) 2021-07-26 20:29:05 -04:00
Sebastien Pouliot b02f7c8e66
[tests] Fix introspection on macOS 12 (#12234)
This was fixed for iOS 15 but also happens on macOS 12 so the case
was moved into the common, shared test sources.
2021-07-26 20:23:12 -04:00
TJ Lambert 149434de3e
[SafariServices] Update to Xcode13 beta1 (#12102) 2021-07-26 17:29:17 -05:00
Rolf Bjarne Kvinge c0651c92b1
[dotnet] Put the 'createdump' executable in the app bundle when using CoreCLR. Fixes #11432. (#12210)
So that CoreCLR can create crash dumps.

Fixes https://github.com/xamarin/xamarin-macios/issues/11432.
2021-07-26 16:16:10 +02:00
Rolf Bjarne Kvinge 478b58897f
[AppKit/Foundation] Sprinkle some null allowed. (#12201) 2021-07-26 09:19:48 +02:00
Rolf Bjarne Kvinge 561ffb7663
[AppKit/UIKit/Foundation] Use NSWritingDirection from Foundation. Partial fix for #6573. (#12199)
Make the NSWritingDirection enum from Foundation the main version, and
deprecate the others (AppKit.NSWritingDirection,
UIKit.UITextWritingDirection).

This makes things a bit easier with Mac Catalyst, which ships both AppKit and UIKit.

Ref: https://github.com/xamarin/xamarin-macios/issues/6573
2021-07-26 09:10:41 +02:00
Sebastien Pouliot 0ba858a5c1
[corespotlight] Fix API not available on Catalyst (#12186)
Headers were only decorated with `ios(15.0)`
Testing on macOS 12 b3, as a Catalyst app, shows they are not available.
2021-07-23 22:07:44 -04:00
Sebastien Pouliot a9d5a71cb3
[coremotion] Remove API not available on Catalyst 15 (#12207) 2021-07-23 22:03:00 -04:00
Sebastien Pouliot 5c93260ca4
[gamekit] Remove `isPresentingFriendRequestViewController` from Catalyst (#12206)
* [gamekit] Remove `isPresentingFriendRequestViewController` from Catalyst

The selector is not annotated by itself (wrt Catalyst) but it maps to
`presentFriendRequestCreatorFromViewController` which is not available
on Catalyst. That part is clear in the headers

```diff
+#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
+/**
+ *  presentFriendRequestCreatorFromViewController:
...
+#elif TARGET_OS_OSX
+/**
+ *  presentFriendRequestCreatorFromWindow:
```
2021-07-23 21:58:19 -04:00
TJ Lambert 62a9fd98c4
[SensorKit] Updates for Xcode13 Beta1
No updates for Beta 2 or 3
2021-07-23 14:16:28 -05:00
TJ Lambert a27a58aa29
[UserNotifications] Updates for Xcode13 beta 3 (#12130) 2021-07-23 14:13:32 -05:00
Rachel Kang 24acd2da84
Merge pull request #12152 from rachelkang/xcode13.0-storekit-b1
[StoreKit] Update bindings for Xcode 13.0 beta 1
2021-07-23 12:10:46 -04:00
Manuel de la Pena de862502ae
[CoreData] Add support for Xcode 13 beta 3. (#12183) 2021-07-23 11:24:19 -04:00
Rachel Kang cc48a3c45c
Merge branch 'main' into xcode13.0-storekit-b1 2021-07-23 11:08:00 -04:00
Rolf Bjarne Kvinge a010778b30
[dotnet] Add support for implicit namespace imports. Fixes #12084. (#12173)
* [dotnet] Add support for implicit namespace imports. Fixes #12084.

Also update our templates to remove any using statements for implicitly imported
namespaces.

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

* [monotouch-test] Fix compilation error due to implicit namespace causing type conflict.

Fixes these errors:

    xamarin-macios/tests/monotouch-test/ImageIO/MutableImageMetadataTest.cs(54,54): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
    xamarin-macios/tests/monotouch-test/ImageIO/MutableImageMetadataTest.cs(54,88): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
    xamarin-macios/tests/monotouch-test/ImageIO/ImageMetadataTest.cs(40,54): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
    xamarin-macios/tests/monotouch-test/ImageIO/ImageMetadataTest.cs(40,88): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
2021-07-23 15:07:03 +02:00
Rolf Bjarne Kvinge 0f62f57ac9
[link sdk] Fix incorrect test logic in HttpClientHandlerTest for Mac Catalyst. Fixes #xamarin/maccore@2472. (#12179)
Fixes https://github.com/xamarin/maccore/issues/2472.
2021-07-23 09:10:11 +02:00
Rolf Bjarne Kvinge 60fa8c90fe
[monotouch-test] Check a few more permissions that sometimes make the app crash due to a TCC violation on Mac Catalyst. (#12134)
* [monotouch-test] Check a few more permissions that sometimes make the app crash due to a TCC violation on Mac Catalyst.

* [monotouch-test] Adjust CaptureDeviceTest to only verify camera permission for Audio+Video, any other value is not supported by the OS.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-07-23 09:08:25 +02:00
Sebastien Pouliot 0344624f75
[corelocation] Update annotations to to fix intro on macOS 12 beta 3 (#12167)
Headers only mention iOS 15.

It does not make sense on tvOS (does not move much) and it's not on
Mac (or Catalyst) as validated with macOS 12 beta 3.
2021-07-22 15:41:19 -04:00
Rolf Bjarne Kvinge 1b357204ee
[dotnet/msbuild] Add support for using LLVM to build .NET apps. Fixes #11379. (#12136)
Fixes https://github.com/xamarin/xamarin-macios/issues/11379.
2021-07-22 15:49:22 +02:00
Rolf Bjarne Kvinge c898f19f18 [monotouch-test] Improve the MTLDeviceTest to work on Mac Catalyst. 2021-07-22 10:37:28 +02:00
Rolf Bjarne Kvinge 676a8bb90d [monotouch-test] Fix some formatting and add assert messages 2021-07-22 10:36:21 +02:00
Rolf Bjarne Kvinge bdbf642b6f [tests] Add a MyInterpretedApp test solution 2021-07-22 10:36:21 +02:00
Rolf Bjarne Kvinge 76c8461764
[main] Update dependencies from dotnet/installer (#12064)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer

- **Subscription**: df3e6147-3e41-4928-6775-08d8f479343c
- **Build**: 20210720.12
- **Date Produced**: 7/21/2021 6:57 AM
- **Commit**: d7279fc09fcfb108c5fb97fa290dbbb11c4c441b
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 6.0.100-preview.7.21330.1 to 6.0.100-rc.1.21370.12][1]
  - **Microsoft.NET.ILLink.Tasks**: [from 6.0.100-preview.6.21329.2 to 6.0.100-preview.6.21370.1][2]

[1]: 823ff33...d7279fc
[2]: f549b4e...6eae019

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 6.0.100-preview.6.21329.2 to 6.0.100-preview.6.21370.1 (parent: Microsoft.Dotnet.Sdk.Internal)
2021-07-22 10:32:32 +02:00
VS MobileTools Engineering Service 2 042cd714fe
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 4945304 (#12079)
First group of translated resx files coming from OneLocBuild!
2021-07-21 17:34:51 -05:00
Manuel de la Pena adc002be4c
[CHIP] Add support fox Xcode 13 beta 3. (#12143) 2021-07-21 13:04:49 -04:00
Manuel de la Pena cd050316cc
[CoreBluetooth] Add Xcode 13 beta 3 support. (#12153) 2021-07-21 13:03:05 -04:00
Rolf Bjarne Kvinge de7f08d642
[tests/dotnet] Add .NET/Mac Catalyst test projects for dont link, link sdk and link all. (#12154)
* Add proper .NET project files for dont link, link sdk and link all. This
  includes a Mac Catalyst variant, and adding helpful Makefile targets for
  simple execution.

* Adjust various tests to work with Mac Catalyst.

* Add the new Mac Catalyst variants to xharness.

This is a partial fix for #10833.
2021-07-21 17:16:03 +02:00
Rolf Bjarne Kvinge f521537e0a
[AppKit/UIKit] Share the implementation of some classes between AppKit and UIKit. (#12161)
* [AppKit/UIKit] Merge the definitions of NSTextLayoutOrientationProvider.

It looks like this might be a breaking change for macOS, but the macOS
definition had only a [Model] attribute, which won't make the generator
generate any public API.

* [AppKit/UIKit] Merge the definitions of NSTextContainer.

* [AppKit/UIKit] Merge the definitions of NSExtendedStringDrawing.
2021-07-21 14:52:19 +02:00
Rolf Bjarne Kvinge 5c30c015c3 Merge remote-tracking branch 'origin/main' into darc-main-2c3dc6cd-c245-4d20-9461-75a98d067b3b 2021-07-21 10:12:01 +02:00
Rolf Bjarne Kvinge b082e6b8aa
[AppKit/UIKit] Share the implementation of some classes between AppKit and UIKit. (#12146)
* [src] Share the NSTextStorage[Delegate] implementations between AppKit and UIKit.

* [AppKit/UIKit] Merge the definitions of NSCollectionLayoutAnchor.

* [AppKit/UIKit] Merge the definitions of the NSCollectionLayout* classes.

* [AppKit/UIKit] Merge the definitions of NSDataAsset.

* [AppKit/UIKit] Merge the definitions of NSShadow.

* [AppKit/UIKit] Merge the definitions of NSTextTab.

* Update xtro.
2021-07-21 10:08:17 +02:00
Rolf Bjarne Kvinge b4dd54bbce [dont link] Ignore the Calendar tests on Mac Catalyst. 2021-07-21 09:32:12 +02:00
Manuel de la Pena eec8246603
Merge branch 'main' into xcode13.0-storekit-b1 2021-07-20 13:18:27 -07:00
Manuel de la Pena 1bdf96d422
Merge branch 'main' into dotnet-linker-tests 2021-07-20 13:17:47 -07:00
Manuel de la Pena c138cce7ba
[ImageIO] Add support for Xcode 13 beta 3. (#12145) 2021-07-20 15:42:56 -04:00
Manuel de la Pena 4d329df138
[GameController] Add support for xcode 13 beta3. (#12144)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-07-20 15:39:39 -04:00
Rachel Kang bd4c627746
[StoreKit] Update bindings for Xcode 13.0 beta 1 2021-07-20 11:36:36 -04:00
Rolf Bjarne Kvinge 28989758ba [link sdk] The SpecialFolder.ProgramFiles path may or may not exist. 2021-07-20 15:54:48 +02:00
Rolf Bjarne Kvinge c7fe2fefd5 [link sdk] Adjust the Bug2000_NSPersistentStoreCoordinator test to create file in a temporary directory.
It would create a file in the current directory, which is the root directory of the app bundle.

This would work in the simulator (because the directory is read-write), fail
on device (because the directory is read-only), and cause rebuilds to fail
with Mac Catalyst (because the directory is read-write the test would succeed,
but it would write files in the root directory of the app bundle, which is not
allowed for macOS apps, and thus codesign would fail when rebuilding the app).

So change the test to create any files in a temporary directory, and adjust it
to always expect the file to be created.

And just in case also delete the file at the end of the test.
2021-07-20 15:54:48 +02:00
Rolf Bjarne Kvinge b890b2b248 [xharness] Add .NET/Mac Catalyst versions of dont link, link sdk and link all. 2021-07-20 15:54:48 +02:00
Rolf Bjarne Kvinge 82b1331210 [xharness] Rewrite the 'RootTestsDirectory' property when cloning a project. 2021-07-20 15:54:48 +02:00
Rolf Bjarne Kvinge 56baf35c79 [tests] Adjust 'link all' to work on Mac Catalyst. 2021-07-20 15:54:48 +02:00
Rolf Bjarne Kvinge ad50c76a88 [tests] Add proper .NET project files for dont link, link sdk and link all tests.
This includes adding a Mac Catalyst variation as well, and adding helpful Makefile
targets for simple execution.

This is a partial fix for #10833.
2021-07-20 15:54:48 +02:00
Rolf Bjarne Kvinge 813b47c5f6 [tests] Make the copy-dotnet-config rule work with paths with spaces, and copy to the linker test directories as well. 2021-07-20 15:54:47 +02:00
Rolf Bjarne Kvinge 7e37fe622e [monotouch-test] Adjust HttpClientHandler tests.
Adjust HttpClientHandler tests to cope with
https://github.com/dotnet/runtime/issues/50859 and
https://github.com/xamarin/xamarin-macios/issues/11392.
2021-07-20 14:54:02 +02:00
Rolf Bjarne Kvinge f90a2f5c75 [monotouch-test] Adjust HttpClientHandler tests to cope with https://github.com/dotnet/runtime/issues/55986. 2021-07-20 14:54:02 +02:00
Rolf Bjarne Kvinge 793b7bb706 [monotouch-test] Make HttpClientTest.EnsureModifiabilityPostSend accept a InvalidOperationException inside a TargetInvocationException for .NET. 2021-07-20 14:54:02 +02:00
Rolf Bjarne Kvinge ab10456117 [monotouch-test] Ignore NSTimeZoneTest.All_28300 on Mac Catalyst.
Due to https://github.com/dotnet/runtime/issues/55941.
2021-07-20 14:54:02 +02:00
Rolf Bjarne Kvinge a3f9519ed1 Merge remote-tracking branch 'origin/main' into HEAD 2021-07-20 14:53:57 +02:00
Rolf Bjarne Kvinge 3c38f8ccd6
[dotnet] Enable autorelease pools for threadpools. Fixes #11750. (#12060)
Fixes https://github.com/xamarin/xamarin-macios/issues/11750.
2021-07-20 14:34:37 +02:00
Rolf Bjarne Kvinge e9c8b50e53
[xharness] Handle exceptions that occur while listing device candidates gracefully. (#12133)
This fixes a problem where the html report wouldn't be re-generated if there
was a problem loading a device (which for instance could happen if xharness
was unable to create a required simulator).
2021-07-20 12:19:31 +02:00
Rolf Bjarne Kvinge 80d2bfa252
[src] Share the NSTextAttachment[Container] implementations between AppKit and UIKit. (#12135)
* [src] Share the NSTextAttachment[Container] implementations between AppKit and UIKit.

* Use shared definition of UIImage/NSImage.
2021-07-20 08:00:35 +02:00
Sebastien Pouliot 2e57729fc2
[corefoundation] Update `CFArray` and make it public (#12003)
* Make `CFArray` public so it can be used for bindings, including 3rd party bindings
* Subclass `NativeObject` to remove some boilerplate code
* Most members are `internal` until needed
* Add nullability annotations

The next step is to make the same kind of optimization done on `NSString`
vs `CFString` by preferring faster p/invokes over calling selectors while
keeping generated code identical.

Also
* Make more methods internal so we can potentially rename them (when the NSArray variants becomes obsolete)
* Add CFArray to the attachment tests
2021-07-19 18:10:44 -04:00
Rolf Bjarne Kvinge c0a7bf5a0d Merge remote-tracking branch 'origin/main' into dotnet-llvm 2021-07-19 17:07:57 +02:00
Rolf Bjarne Kvinge e968a93282
[monotouch-test] Create a shared.csproj for all the .NET monotouch-test project files. (#12128)
* [monotouch-test] Create a shared.csproj for all the .NET monotouch-test project files.

Also complete the logic to build metal files, so that it works on Mac Catalyst as well.

* [monotouch-test] Add helper makefiles.

* [monotouch-test] Fix the RootTestsDirectory in the csproj.

* [monotouch-test] Add empty ItemGroup for xharness to put stuff in.

* [monotouch-test] Set DYNAMIC_REGISTRAR in each csproj, because xharness needs to be able to unset it.

* [monotouch-test] Exclude tests that don't work with AOT from Mac Catalyst/ARM64.

* [monotouch-test] Use 'ComputedPlatform' instead of 'Platform' to determine whether we're building for a device or not.

'Platform' can be anything, while we know the value of 'ComputedPlatform'. And
since 'ComputedPlatform' is computed after the csproj is read, we need to
delay the computation until later (thus in a separate target).
2021-07-19 16:43:22 +02:00
Manuel de la Pena 7ea2524ce6
[Xcode13] Bump xcode 13 to beta 3. (#12137) 2021-07-19 09:03:20 -04:00
Manuel de la Pena a96421fde0
[CoreWLan] Add XCode13 beta 1 support. (#12103)
Added support for MacCatalyst and cleaned the backlog.


Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-07-19 09:02:47 -04:00
Rolf Bjarne Kvinge dba3bf30b1
[AppKit/UIKit] Share the implementation of some classes between AppKit and UIKit. (#12131)
* [src] Share [I]NSCollectionLayoutVisibleItem implementation between AppKit and UIKit.

* [src] Share several NSLayout* implementations between AppKit and UIKit.
2021-07-16 18:24:50 +02:00
Rolf Bjarne Kvinge f292635e48 [tests] Add helper makefiles for building monotouch-test and MySimpleApp in .NET from the command line. 2021-07-16 17:11:14 +02:00
Rolf Bjarne Kvinge ca607b3e86
[tests] Fix warning about unused variable. (#12117) 2021-07-16 16:27:26 +02:00
Rolf Bjarne Kvinge ef0a179610
[Foundation] Sprinkle [NullAllowed]. (#12119) 2021-07-16 16:16:00 +02:00
Rolf Bjarne Kvinge 8b3d572ff3
[xtro] Rebuild xtro-sharpie when any of the sources change (#12120) 2021-07-16 16:15:45 +02:00
Rolf Bjarne Kvinge 7c30f55359 [xharness] Add test case for running monotouch-test with LLVM on .NET on device. 2021-07-16 14:50:55 +02:00
Rolf Bjarne Kvinge 7ac3417ee9
[dotnet/templates/tests] Update template code. (#12109)
* Move the templates to a common subdirectory.
* Add .NET unit test to verify that all the templates build and that they have
  no warnings.
* Modify the template code to:
   * Use the UIApplication.Main overload that takes a Type.
   * Use top-level statements for the Main method to simplify code.
   * Remove a few unnecessary usings.

Partial fix for #12085.
2021-07-14 17:58:31 +02:00
Rolf Bjarne Kvinge fc8fb4818c
[runtime] Set the current directory to the root directory of the app bundle for all platforms in .NET. (#12104)
To have consistent behavior in .NET, set the current directory to the root of
the app bundle for all platforms.

This is a breaking change for legacy Xamarin.Mac, which used to set the
current directory to the Contents/Resources subdirectory, but there's a simple
workaround for customers that depend on the old behavior (change it in Main
themselves), and I believe the consistent experience across platforms warrants
this change.

Note that we already had a breaking change here for macOS/.NET: we were
(unintentionally) setting the current directory to the Contents/MonoBundle
directory, which neither matched mobile platforms, nor the legacy Xamarin.Mac
behavior.

This solves the problem of what to do for Mac Catalyst apps, because there's
no need to choose between the macOS or the mobile behavior, since they're the
same.

This required changing the launch of macOS apps using CoreCLR to pass the full
path to the entry assembly, since the entry assembly isn't in the current
directory anymore.
2021-07-14 17:42:49 +02:00
TJ Lambert a202354c71
[IOSurface] Updates for Xcode13 Beta 1 (#12096) 2021-07-13 12:57:57 -05:00
TJ Lambert ecd8dccccf
[GameKit] Updates for Xcode13 Beta 1-2 (#12091) 2021-07-13 12:44:35 -05:00
Rolf Bjarne Kvinge 78e2251671
[xharness] Don't fail when trying to set a RuntimeIdentifier if there isn't already a RuntimeIdentifier in the csproj. (#12105) 2021-07-13 18:51:03 +02:00
Rolf Bjarne Kvinge 423bd571ec Merge remote-tracking branch 'origin/main' into darc-main-2c3dc6cd-c245-4d20-9461-75a98d067b3b 2021-07-13 14:30:18 +02:00
Rolf Bjarne Kvinge 236626f3a5 Merge remote-tracking branch 'origin/main' into darc-main-2c3dc6cd-c245-4d20-9461-75a98d067b3b 2021-07-13 00:36:45 +02:00
Rolf Bjarne Kvinge ba3f7bf1ca [monotouch-test] Expand the ignored tests when we don't have culture data.
Fixes this test failure:

    [FAIL] Embedded : System.Globalization.CultureNotFoundException : Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
        en is an invalid culture identifier.
        at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) in System.Private.CoreLib.dll:token 0x60027b4+0x2f
        at System.Globalization.CultureInfo..ctor(String name) in System.Private.CoreLib.dll:token 0x60027b3+0x0
        at EmbeddedResources.ResourcesTest.Embedded() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/EmbeddedResources/ResourcesTest.cs:line 44
        at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Private.CoreLib.dll:token 0x6004f05+0x6a
2021-07-13 00:01:45 +02:00
Rolf Bjarne Kvinge cfcedfbe53 [monotouch-test] Use CultureInfo.InvariantCulture instead of 'en-US' to parse invariant numbers.
Fixes this test failure:

	[FAIL] FloatingPointStretTrampolineTest : System.Globalization.CultureNotFoundException : Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
        en-US is an invalid culture identifier.
           at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) in System.Private.CoreLib.dll:token 0x60027b4+0x2f
           at System.Globalization.CultureInfo..ctor(String name) in System.Private.CoreLib.dll:token 0x60027b3+0x0
           at MonoTouchFixtures.ObjCRuntime.FloatingPointStretTrampolines.ParseString(String str) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs:line 640
           at MonoTouchFixtures.ObjCRuntime.FloatingPointStretTrampolines.Test_CGRect_IntPtr(NSString str) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs:line 664
        --- End of stack trace from previous location ---
           at MonoTouchFixtures.ObjCRuntime.TrampolineTest.FloatingPointStretTrampolineTest() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs:line 242
           at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Private.CoreLib.dll:token 0x6004f05+0x6a
2021-07-12 23:59:50 +02:00
Rolf Bjarne Kvinge 9207b5940e
[tests] Fix the Native*ReferencesApp tests to have an Info.plist with a minimum OS version. (#12099)
* We need to specify a minimum OS version, because otherwise we'll pick the
  latest OS version we support, and at least for macOS, we might very well try
  to execute on earlier OS versions, leading to confusing failures like this:

    Xamarin.Tests.DotNetProjectTest.BuildAndExecuteNativeReferencesTestApp("NativeDynamicLibraryReferencesApp",MacOSX,"osx-x64"): Contains magic word
        Expected: String containing "dc8bd019-bea2-4c86-92dc-dda22e2e6b88"
        But was: "dyld: Library not loaded: /System/Library/Frameworks/CHIP.framework/Versions/A/CHIP
        Referenced from: /Users/builder/azdo/_work/1/s/xamarin-macios/tests/dotnet/NativeDynamicLibraryReferencesApp/macOS/bin/Debug/net6.0-macos/osx-x64/NativeDynamicLibraryReferencesApp.app/Contents/MacOS/NativeDynamicLibraryReferencesApp
        Reason: image not found

* We only need a minimum OS version (for now at least) in the Info.plist, so
  remove everything else.
2021-07-12 23:05:35 +02:00
TJ Lambert 26a8abe76e
using swift names (#12095)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-07-12 11:18:02 -05:00
Manuel de la Pena cd1145d169
[xtro] Do not allow to leave empty todo files in xtro. (#12090)
To avoid things like the ones fixed in https://github.com/xamarin/xamarin-macios/pull/12088 we add a new
test to ensure that todo files do have content.
2021-07-12 09:44:11 -04:00
TJ Lambert 7ad807a4c3
initial changes (#12094)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-07-09 17:55:49 -05:00
Rachel Kang be3b440c23
[Speech] Update bindings for XCode 13.0 beta 1 (#12086) 2021-07-09 16:02:12 -04:00
Rachel Kang 7b167e26ef
[xtro] Remove empty .todo files (#12088)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-07-09 15:00:42 -04:00
Rachel Kang 924c006f3c
[iTunesLibrary] Update bindings for Xcode 13.0 beta 1 (#12038)
* [iTunesLibrary] Update bindings for Xcode 13.0 beta 1

* Move existing property back to original location

* Fix message and remove unnecessary Introduced tags

* Fix typo in deprecation message

* Delete empty .todo file
2021-07-09 10:42:15 -05:00
TJ Lambert 956828f0c4
[AutomaticAssessmentConfiguration] Updates for Xcode13 beta1 (#12070)
* initial changes for AutomaticAssessmentConfiguration

* forgot a selector

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-07-08 13:01:35 -05:00
Rachel Kang ac5c1577e1
[MapKit] Update bindings for Xcode 13.0 beta 1 and beta 2 (#12081) 2021-07-07 17:29:43 -04:00
Rachel Kang baeb041d96
[Accounts] Update bindings for Xcode 13.0 beta 1 (#12024)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-07-07 17:26:39 -04:00
Rachel Kang 9ca0942116
[Accessibility] Update bindings for Xcode 13.0 beta 1 (#11998)
Co-authored-by: Rachel Kang <rachelkang@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-07-07 17:25:31 -04:00
TJ Lambert ab151a7430
initial updates for xcode 13 beta 1 (#12074)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-07-07 15:36:26 -05:00
TJ Lambert 10b2f36fa5
[EventKit] Updates for Xcode13 Beta1 (#12022)
* initial changes for EventKit Xcode13 Beta1

* adding delegate

* fixing delegates

* removing NoMacCatalyst from MONOMAC

* removing rest of monomac maccatalysts

* Apply suggestions from code review

Co-authored-by: Alex Soto <alex@alexsoto.me>

* there was one more EKVirtualConferenceURLDescriptor

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2021-07-01 18:25:58 -05:00
Manuel de la Pena d99235db4e
[CHIP] Add support for Xcode13 beta2. (#12025)
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2021-06-30 20:18:41 -04:00
TJ Lambert 0bfb7450a0
[ReplayKit] Updates for Xcode13 Beta 1 (#12026)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-06-30 11:10:37 -04:00
Rolf Bjarne Kvinge ebf6c13bd1
[dotnet] Add support for universal apps. (#11983)
Add support for universal / fat apps for iOS, macOS and Mac Catalyst.

We detect if we need to build a universal app by checking if `RuntimeIdentifiers` (plural) is set, and in that case we do a complete inner build for every `RuntimeIdentifier`, and then once those inner builds are done, we merge the resulting .app bundles together (using a new MSBuild task called `MergeAppBundles`).

When merging app bundles together, we'll run into files that exist in both apps. Depending on the file type, we do different things:

* MachO flies: lipo'ed together.
* Managed assemblies: we do a binary comparison, if the assemblies are different, we put them in a RID-specific subdirectory. At runtime we know to look for assemblies in this directory.
* runtimeconfig.bin, icudt.dat: put in a RID-specific subdirectory.
* Info.plist: computed in the outer (fat) build, the one from the inner build is ignored.
* Other files: for identical files we just copy one, otherwise we show an error.

If we run into files that are different between apps, but we should handle somehow, then we'll have to decide on a case-to-case basis what to do.

Some code shuffling was required to increase code sharing between the tools/ code, the msbuild/ code, and tests.

I've also added support for a default `RuntimeIdentifier`.

Fixes https://github.com/xamarin/xamarin-macios/issues/10294.
Fixes https://github.com/xamarin/xamarin-macios/issues/10861.
2021-06-29 11:38:04 +02:00
Alex Soto e2a92c1b07
[xcode13] Bump PR to Xcode 13 Beta 2 (#12017)
Update tests regarding the deprecated fields and classes.

Co-authored-by: Rachel Kang <rachelkang@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-06-28 17:54:52 -04:00
TJ Lambert 32402490b6
[GameController] Updates for Xcode13 beta1 (#12014)
* Initial changes for xcode13 GameController beta1

* syntax and name change

* name change and adding async

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-06-28 10:37:42 -05:00
Rolf Bjarne Kvinge 8aff15a4f0 [tests] Don't run parallel make in tests/common/TestProjects/ComplexAssembly, it may cause make to deadlock. 2021-06-25 08:26:01 +02:00
Rolf Bjarne Kvinge 31b48eb8a1 [tests] Copy more supporting files for building monotouch-test with .NET. 2021-06-24 17:16:50 +02:00
Rolf Bjarne Kvinge 2f65937d27 [tests] Remove BOM in new file. 2021-06-24 14:23:23 +02:00
Rolf Bjarne Kvinge 9a406d2e9b [tests] Fix makefile for ComplexAssembly to do nothing on a rebuild.
* Don't use a fake target, it'll always be executed.
2021-06-24 14:22:41 +02:00
Rolf Bjarne Kvinge 82fc13efbc [tests] Fix assertions regarding errors after recent changes. 2021-06-24 14:16:14 +02:00
Rolf Bjarne Kvinge 4914136930
[tools/tests] Fix units in logging message. (#12005) 2021-06-24 08:39:22 +02:00
TJ Lambert 7130a5a0b1
initial changes for Xcode13 UniformTypeIdentifiers Beta1 (#12008)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-06-23 16:27:51 -05:00
TJ Lambert c4d5433a63
[VideoSubscriberAccount] Updates for Xcode13 Beta 1 (#11977)
* initial changes

* removing maccatalyst from the sources

* adding issue link

* getting closer, I think

* adding ignore

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-06-23 12:55:08 -05:00
Rolf Bjarne Kvinge 5ecb7ae337 [msbuild] List all files causing errors. 2021-06-23 18:38:46 +02:00
Rolf Bjarne Kvinge 70d0f86099 Merge remote-tracking branch 'origin/main' into HEAD 2021-06-23 18:38:43 +02:00
Manuel de la Pena 1f84aaa9b4
[CoreSpotlight] Add Xcode13 beta1 support. (#11986) 2021-06-23 11:45:40 -04:00
Manuel de la Pena d11852e02c
[CoreVideo] Add support for Xcode13 beta 1. (#11997)
Added new APIs from Xcode13, add missing ones that have been added in
catalyst and enabled nullable in the manual code.
2021-06-22 21:52:07 -04:00
TJ Lambert 6898920c72
[PDFKit] Updating Xcode13 Beta 1 (#11987)
* Initial changes xcode13 PDFKit beta 1

* adding to PdfDocumentWriteOptionKeys

* adding availability

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-06-22 10:58:32 -05:00
Manuel de la Pena 0e07b989bd
[CoreText] Add support for Xcode13 beta1. (#11993) 2021-06-22 11:50:56 -04:00
Rolf Bjarne Kvinge 2f1667e593 [tests] Remove MSBuildSDKsPath from the environment before invoking make which may call 'dotnet build'. 2021-06-22 16:52:27 +02:00
TJ Lambert 621aaef776
[PhotosUI] Xcode13 PhotosUI beta1 (#11945)
* initial changes for Xcode13 PhotosUI beta1

* fixing syntax and types

* forgot this header

* removing advice and adding unavailable MacCatalyst

* adding ignore file to pass xtro

* adding async

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-06-22 09:32:31 -05:00
Manuel de la Pena c778e6be3b
[CoreLocationUI] Add new framework for Xcode13 beta1. (#11979) 2021-06-21 12:10:13 -04:00
Rolf Bjarne Kvinge f1cc00ce3a [tests] Update tests according to the actual error messages. 2021-06-21 11:45:50 +02:00
Rolf Bjarne Kvinge 718d9548a3 [tests] Improve error reporting when SetUp fails in MergeAppBundleTaskTest. 2021-06-21 11:45:21 +02:00
Rolf Bjarne Kvinge bc9e007343 [tests] Updated list of not-yet-localized error messages. 2021-06-21 11:36:45 +02:00
Rolf Bjarne Kvinge 62865cb9b1 Merge remote-tracking branch 'origin/main' into HEAD 2021-06-21 11:36:34 +02:00
Rolf Bjarne Kvinge 6b78a86849
Bump min watchOS simulator to 6.0. (#11981)
* Bump min watchOS simulator to 6.0.

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

* Try to keep using the iOS 12 simulator for watchOS 8.0

* [introspection] Fix running on watchOS 6.0.

* [AVFoundation] Adjust availability of AVPlayerWaitingDuringInterstitialEventReason.
2021-06-21 07:42:58 +02:00
Manuel de la Pena 4bc32a94ec
[CoreLocation] Add xcode13 beta 1 support. (#11965) 2021-06-18 14:05:43 -04:00
Manuel de la Pena 8d2d06b843
[CFNetwork] Add Xcode13 beta 1 support. (#11966) 2021-06-18 14:04:37 -04:00
Sebastien Pouliot 3590070f6b
Revert "[tests] Preserve a required method in System.Private.CoreLib to work around a bug in .NET 6. (#10426)" (#11974)
This reverts commit 29727d6a8d.

https://github.com/dotnet/runtime/issues/46908 was fixed and the other part of the workaround was removed in PR#11958
2021-06-18 13:10:48 -04:00
Rolf Bjarne Kvinge aaf8d70573
[tests] Add/fix makefiles for .NET projects (#11982)
Add and fix makefiles for .NET test projects to make them easy to test from
the command line.
2021-06-18 18:26:33 +02:00
Sebastien Pouliot 785bbbe481
[tests][dotnet] Clear packages before building test apps (#11978)
to make sure the latest locally build nuget are used

Also document `make strip-dotnet` as a time-saver to analyze the binary
assemblies produced for dotnet
2021-06-18 09:33:08 -04:00
Rolf Bjarne Kvinge 91311a0d55 [dotnet] Implement support for multiple RuntimeIdentifiers.
* Do an inner build per RuntimeIdentifier.
* In the outer build, execute the new MergeAppBundles task to
  merge the resulting app bundles from the inner builds.
2021-06-18 10:34:35 +02:00
Rolf Bjarne Kvinge 4f8e9a872e [tests] Add new tests for merging app bundles 2021-06-18 10:34:35 +02:00
Rolf Bjarne Kvinge e1f31c60b6 [tests] Quote parameters containing semicolons when passed to 'dotnet build' 2021-06-18 10:34:35 +02:00
Rolf Bjarne Kvinge 724d0fe1b3 [dotnet] Set a default RuntimeIdentifier and validate that we get a valid RuntimeIdentifier. Fixes #10861.
Also add tests:

* Remove RuntimeIdentifier from a few sample projects. These projects should
  continue to build just fine.
* Add tests for invalid RuntimeIdentifiers.

Fixes https://github.com/xamarin/xamarin-macios/issues/10861.
2021-06-18 10:34:35 +02:00
Rolf Bjarne Kvinge 5955cd1c92 [tests] Add a complex test library project with resources and app configs. 2021-06-18 10:34:35 +02:00
Rolf Bjarne Kvinge 9a9562c06e [tests] Add unified simple test app for all platforms we support.
This makes writing tests a bit easier, since we can use the same test project name
for all platforms.
2021-06-18 10:24:28 +02:00
Sebastien Pouliot b4dcee199b
Revert "[tests][monotouch-test] Ignore NSTimeZoneTest / All_28300 on dotnet as it hangs" (#11975)
This reverts commit 5fdd4e2dec.
2021-06-17 20:53:26 -04:00
Manuel de la Pena 85ce924296
[CoreHaptics] Add support for Xcode13 beta1. (#11963) 2021-06-17 15:15:07 -04:00
Manuel de la Pena 0ecf405464
[CoreMotion] Add Xcode13 beta1 support. (#11968) 2021-06-17 15:08:27 -04:00
Rolf Bjarne Kvinge 0c1c1a7bff
[tools] Fix quoting quotes in StringUtils.QuoteForProcess. (#11949)
* [tools] Fix quoting quotes in StringUtils.QuoteForProcess.

Previously quoting a string with a quote:

    a"b

would result in:

    "a\"""b"

There are way too many quotes there.

We'll now get:

    "a\"b"

which is correct.

* Add unit test.
2021-06-17 18:23:59 +02:00
Manuel de la Pena 242b8895c9
[CoreML] Add support for Xcode13 beta 1. (#11967) 2021-06-17 11:03:34 -04:00
Rolf Bjarne Kvinge 9278ee1610
[monotouch-tests] Use a LinkDescription item to specify extra linker description files (#11948)
* It's easier to fix up the path to the linker description in xharness when
  cloning project files. This way maybe we'll be able to remove the [hardcoded
  logic in xharness][1] to handle ${ProjectDir}.
* .NET doesn't understand the ${ProjectDir} syntax, so this makes it possible
  to build these projects from the command line.

[1]: b2297d610d/src/Microsoft.DotNet.XHarness.iOS.Shared/Utilities/ProjectFileExtensions.cs (L1268)
2021-06-17 09:02:21 +02:00
Manuel de la Pena aed792397c
[CloudKit] Add support for Xcode13 beta1. (#11961) 2021-06-16 21:26:56 -04:00
Manuel de la Pena b2cb149d2d
[Contacts] Add support for Xcode13 beta1. (#11962) 2021-06-16 21:26:26 -04:00
Sebastien Pouliot f5896c1414
[dotnet] Change default http handler to NSUrlSessionHandler (#11956)
Also allow `SocketsHttpHandler` on dotnet
2021-06-16 19:50:09 -04:00
Sebastien Pouliot 643cb41436
[tests][intro] Fix failures when executed on iOS 15 beta1 devices (#11960) 2021-06-16 19:49:00 -04:00
Sebastien Pouliot c5170b1331
[dotnet][tests] Remove workaround for dotnet/runtime #46908 (#11958) 2021-06-16 19:47:42 -04:00
Sebastien Pouliot e19591f47b
[tests][generator] Remove references to iAd.framework types (#11953)
TL&DR: They were removed from headers so we can't use them for our tests.

Long Story:

To avoid app being rejected the selectors must be removed from the app.
This means the removal of the `[Export]` and `[Bind]` attributes inside
the platform assemblies. That, in turn, makes the binding generator
unable to create bindings for those types.

If some 3rd party bindings extended those types then they also need to
remove them (they will not be able to submit with the symbols anyway).
Stubs can be used, whether or not binary compatibility is provided for
the 3rd party bindings consumers.

Fix https://github.com/xamarin/xamarin-macios/issues/11947
2021-06-16 14:58:45 -04:00
Sebastien Pouliot 0649960dc3
Use `CFString` instead of `NSString` to get a handle from a (.net) `System.String` (#11946)
This is possible because both types are toll-free bridged [0].

How ?

* Renamed `CFString.LowLevelCreate` to `CreateNative` so it match `NSString` API
* Make it public so it can be used for generated/3rd party bindings
* Added a _safe_ `CFString.ReleaseNative` matching `NSString` API
* Update generator to use the new API (instead of the NSString version)
* Update manual bindings (using older API) to use the new API (few in PrintCore)

Why ?

It's no secret that p/invoke (C) are faster than calling a selector
(ObjC). In most cases we do not have a choice what to call... but in a
few, but commonly used, cases we can pick the fastest call.

In this case the difference is larger than the previous case [1] since there's
two call (create and release) involved.

|                 Method |          name |                value |        Mean |       Error |    StdDev |
|----------------------- |-------------- |--------------------- |------------:|------------:|----------:|
| NSString_CreateRelease |         empty |                      |  4,936.1 ns |   349.08 ns |  19.13 ns |
| CFString_CreateRelease |         empty |                      |    243.1 ns |    10.30 ns |   0.56 ns |
| NSString_CreateRelease |   long_string | ????(...)???? [4096] |  8,270.3 ns |   837.09 ns |  45.88 ns |
| CFString_CreateRelease |   long_string | ????(...)???? [4096] |  3,212.4 ns |   213.73 ns |  11.72 ns |
| NSString_CreateRelease |   short_7bits |              Bonjour |  4,858.5 ns | 1,671.67 ns |  91.63 ns |
| CFString_CreateRelease |   short_7bits |              Bonjour |    242.5 ns |    18.36 ns |   1.01 ns |
| NSString_CreateRelease |  short_accent |               Québec |  4,990.1 ns |   343.96 ns |  18.85 ns |
| CFString_CreateRelease |  short_accent |               Québec |    377.6 ns |    15.96 ns |   0.87 ns |
| NSString_CreateRelease |   short_emoji | I'm f(...)ight. [23] |  5,080.2 ns |   794.29 ns |  43.54 ns |
| CFString_CreateRelease |   short_emoji | I'm f(...)ight. [23] |    391.2 ns |     8.60 ns |   0.47 ns |
| NSString_CreateRelease | short_unicode |                汉语 漢語 |  4,980.4 ns |   272.41 ns |  14.93 ns |
| CFString_CreateRelease | short_unicode |                汉语 漢語 |    376.4 ns |    15.98 ns |   0.88 ns |

Also simplified/updated previous tests as suggested in [1].

|                 Method |          name |                value |        Mean |       Error |    StdDev |
|----------------------- |-------------- |--------------------- |------------:|------------:|----------:|
|    NSString_FromString |         empty |      140735350713040 |  2,252.2 ns |   591.63 ns |  32.43 ns |
|    CFString_FromString |         empty |      140735350713040 |    408.4 ns |    47.56 ns |   2.61 ns |
|    NSString_FromString |   long_string |      140295885995872 | 14,887.2 ns |   183.67 ns |  10.07 ns |
|    CFString_FromString |   long_string |      140295885995872 |  7,418.7 ns | 1,844.42 ns | 101.10 ns |
|    NSString_FromString |   short_7bits |  1292713981587835779 |  2,259.8 ns |   210.17 ns |  11.52 ns |
|    CFString_FromString |   short_7bits |  1292713981587835779 |    453.0 ns |   122.77 ns |   6.73 ns |
|    NSString_FromString |  short_accent |      140295885995776 |  2,448.2 ns |    97.43 ns |   5.34 ns |
|    CFString_FromString |  short_accent |      140295885995776 |    256.8 ns |    75.81 ns |   4.16 ns |
|    NSString_FromString |   short_emoji |      140296423669120 |  2,531.6 ns |   199.02 ns |  10.91 ns |
|    CFString_FromString |   short_emoji |      140296423669120 |    259.0 ns |    21.32 ns |   1.17 ns |
|    NSString_FromString | short_unicode |      140295885992304 |  2,426.2 ns |   339.06 ns |  18.58 ns |
|    CFString_FromString | short_unicode |      140295885992304 |    260.6 ns |    97.03 ns |   5.32 ns |

[1] https://github.com/xamarin/xamarin-macios/pull/11809
2021-06-16 14:11:38 -04:00
Sebastien Pouliot 974aad0a26
[tests][link sdk] Re-enable test for Ping for dotnet (#11951)
ref: https://github.com/dotnet/runtime/issues/41355

Unlike what we have today for legacy support for Ping was added in
https://github.com/dotnet/runtime/pull/52240
2021-06-16 14:03:36 -04:00
Manuel de la Pena 0029ffa29d
[Classkit] Add support for Xcode13 beta1. (#11942) 2021-06-16 11:21:21 -04:00
TJ Lambert dbacb3b984
[LinkPresentation] Xcode 13 Beta 1 Changes (#11943)
* initial changes

* removing todo files

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-06-16 09:31:32 -05:00
Sebastien Pouliot 2ecbb07068
[tests] Re-enable tests ignored due to dotnet/runtime #36897 (#11939)
They should now work (even if some tests required more changes) and
will be able to validate other changes.

ref: https://github.com/dotnet/runtime/issues/36897
2021-06-16 09:41:27 -04:00
Rolf Bjarne Kvinge c8e854c151
[dotnet] Add support for generating a binary version of runtimeconfig.json. Fixes #11745. (#11887)
Use Mono's RuntimeConfigParserTask to parse the *.runtimeconfig.json file and
produce a binary version of it.

This also means implementing support for finding the on-disk location of the
file at runtime, and passing it to mono.

Ref: 01b7e73cd3/docs/design/mono/mobile-runtimeconfig-json.md

Fixes https://github.com/xamarin/xamarin-macios/issues/11745.
2021-06-16 15:22:02 +02:00
Manuel de la Pena acf03b510e
[CarPlay] Add support for Xcode13 beta1. (#11928) 2021-06-15 12:00:59 -04:00
Sebastien Pouliot 447c59db60
[iad] Remove most of the framework (#11906)
Most of the API were removed in Xcode 13 beta 1.

The App Store also started to reject some of the (already deprecated)
selectors that were removed, making the API not usable anymore (even
on older versions of the OS).
2021-06-14 20:13:47 -04:00
Sven Boemer 045ccaf3a6
Fixes for .NET 6 linker (#11739)
* Pass custom steps separately from msbuild

* Remove reflection over linker pipeline

* Fix ListExportedSymbols ctor

* Add CoreTypeMapStep

* PR feedback

- Avoid unnecessary tracking of loaded assemblies
   (Use GetLoadedAssembly instead)
- Create extension method on LinkContext
   to avoid conditional code
- Rename dispatchers to reflect when they run

* Fix PreMarkDispatcher

* Fix DoneStep ordering

* Fix other order-dependent steps, test asserts

* Handle cyclic assembly references

* Simplify reference search

By using the already-loaded Assembly closure

* Fix warning number

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

* PR feedback

- Undo whitespace changes
- Move comment to a more appropriate place

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-06-14 20:10:29 -04:00
Rolf Bjarne Kvinge 77a8299e8d
[introspection] Handle a few Metal classes differently for 'encodeWithCoder:'. Fixes #11885. (#11927)
The base ApiSelectorTest class already handles these selectors, and does it
almost right, so just remove this special case and fix the base class logic.

Fixes these failures on macOS 10.15:

    Introspection.MacApiSelectorTest
    	[FAIL] InstanceMethods :   4 errors found in 27001 instance selector validated:
    Selector not found for CoreML.MLDictionaryFeatureProvider : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on CoreML.MLDictionaryFeatureProvider
    Selector not found for CoreML.MLMultiArray : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on CoreML.MLMultiArray
    Selector not found for CoreML.MLFeatureValue : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on CoreML.MLFeatureValue
    Selector not found for CoreML.MLSequence : encodeWithCoder: in Void EncodeTo(Foundation.NSCoder) on CoreML.MLSequence

Fixes https://github.com/xamarin/xamarin-macios/issues/11885.
2021-06-14 20:08:34 +02:00
Manuel de la Pena 5211f5f0e5
[WatchKit] Add support for Xcode13 beta 1. (#11911) 2021-06-14 12:05:33 -04:00
Manuel de la Pena a9c7202dc4
[ARKit] Provide updates for Xcode13 beta1. (#11908) 2021-06-14 12:03:19 -04:00
Rolf Bjarne Kvinge 317af3809e
[tests/dotnet] Add test-case for 32-bit iOS device build as well (#11899) 2021-06-14 11:22:36 +02:00
Rolf Bjarne Kvinge 0921ae4e26
Bump to Xcode 13 beta 1. (#11861)
* Bump maccore.

New commits in xamarin/maccore:

* xamarin/maccore@9acbbed1f6 [mlaunch] Add support for Xcode 13 beta 1. (#2452)
* xamarin/maccore@e48f75c0b6 [Xamarin.Hosting] Fix the --stdout arg not being forwarded to DeviceLaunchConfig (#2435)
* xamarin/maccore@109c695b1b [Xamarin.Hosting] Fix help string for launchdev argument (#2429)

Diff: cddbd1915d..9acbbed1f6

* [xtro] Fix generation of .pch files
* [xtro] Fix deprecated check to handle (anonymous) declarations and enable latest C# syntax in project
* [xtro] Fix _sanity_ checks
* [xtro] Update todo for beta 1

* [Siminstaller] Force siminstaller to use the xcode 12.5 url

Related issue: https://github.com/xamarin/xamarin-macios/issues/11881

* Fix introspection failures (due to [breaking] changes)
* [tests][intro] Fix hang for tvOS

Creating an instance of `NSMetadataQuery` hangs the simulator.

Even after (xharness) timeout the simulator is not in a good state
to run further tests and every new (tvOS) test will also hang...

* [tests][intro] Same hang for watchOS

except that further test execution does not seem affected (like tvOS)

```
CoreSimulator 772.1 - Device: Apple Watch Series 3 - 38mm (watchOS 8.0) - created by XHarness (42262867-E060-40C0-803E-6DA676AF50CC) - Runtime: watchOS 8.0 (19R5266p) - DeviceType: Apple Watch Series 3 - 38mm

Thread 0 Crashed:: tid_103  Dispatch queue: com.apple.main-thread
0   com.apple.Foundation          	0x00007fff21470bd0 -[NSMetadataQuery dealloc] + 432
1   libobjc.A.dylib               	0x00007fff200d11f7 objc_object::sidetable_release(bool, bool) + 177
2   com.apple.Foundation          	0x00007fff21470a03 -[NSMetadataQuery init] + 64
3   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107efc139 xamarin_dyn_objc_msgSend + 217 (trampolines-x86_64-objc_msgSend.s:15)
4   ???                           	0x000000010c76d4f6 0 + 4504081654
5   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107cffc85 mono_jit_runtime_invoke + 1621 (mini-runtime.c:3197)
6   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107e177d8 do_runtime_invoke + 54 (object.c:3052) [inlined]
7   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107e177d8 mono_runtime_invoke_checked + 136 (object.c:3220)
8   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107e1e3c5 mono_runtime_try_invoke_array + 2101 (object.c:5601)
9   com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107daf977 ves_icall_InternalInvoke + 871 (icall.c:3927)
10  com.xamarin.introspection_watch.watchkitapp.watchkitextension	0x0000000107dc0167 ves_icall_InternalInvoke_raw + 103 (icall-def.h:667)
11  ???                           	0x000000010a232799 0 + 4465043353
12  ???                           	0x000000010c76e08b 0 + 4504084619
```

* [tests][monotouch-test] Fix failures with xcode 13 beta 1
* [tests][mmptest] Use a FAT framework that's build with x86_64 and arm64

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-06-10 20:07:20 -04:00
Sebastien Pouliot 7916e74b89
[windows][msbuild] Copy entire directory when the native reference is a framework (#11868)
The entire `.framework` directory needs to be copied back to Windows
when a native reference is a [xc]framework. Otherwise important files
will be missing and the app bundle will be unusable.

Fix https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1339824
2021-06-09 09:21:17 -04:00
Rolf Bjarne Kvinge 3d9c37778f
[tests] Collect and zip up the .NET unit tests for execution on Windows. (#11850) 2021-06-08 08:59:10 +02:00
Rolf Bjarne Kvinge 8460ce6676
[dotnet] Only publish a single libxamarin-dotnet*.dylib file. (#11801)
Remove all the other ones from ResolvedFileToPublish.
2021-06-07 08:37:23 +02:00
Rolf Bjarne Kvinge 0c28f7f060
[dotnet] It's x86, not x84. (#11816) 2021-06-07 08:34:56 +02:00
Sebastien Pouliot 42a2c79ff8
Use `CFString` instead of `NSString` to get a (.net) `System.String` from an handle (#11809)
This is possible because both types are toll-free bridged [0].

How ?

* Renamed `CFString.FetchString` to `FromHandle` so it match `NSString` API
* Make it `public` so it can be used for generated/3rd party bindings
* Update generator to use the new API (instead of the `NSString` version)
* Update manual bindings to use the new API

Why ?

It's no secret that p/invoke (C) are faster than calling a selector
(ObjC). In most cases we do not have a choice what to call... but in a
few, but commonly used, cases we can pick the fastest call.

```
// * Summary *

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

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

|                Type |                              Method | UnrollFactor | ArraySize |            Mean |            Error |          StdDev |          Median |
|-------------------- |------------------------------------ |------------- |---------- |----------------:|-----------------:|----------------:|----------------:|
|      TollFreeString |               ReturnString_NSString |           16 |         ? |      2,522.0 ns |        878.81 ns |        48.17 ns |      2,541.7 ns |
|      TollFreeString |               ReturnString_CFString |           16 |         ? |        808.1 ns |          7.48 ns |         0.41 ns |        808.2 ns |
```

Next ?

The next step is to reduce other `NSString` selectors usage,
then `NSArray`...

[0] https://developer.apple.com/library/archive/documentation/General/Conceptual/CocoaEncyclopedia/Toll-FreeBridgin/Toll-FreeBridgin.html
2021-06-05 10:33:47 -04:00
Manuel de la Pena 5261242a4f
[Tests] Fix intro tests on older macOS (#11736)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-06-04 13:22:13 -04:00
Rolf Bjarne Kvinge fd500dc53c
Mono changed the location of the AOT compiler, so we have to update our code accordingly. (#11789)
* [tests] Augment the .NET unit tests to verify that more runtime identifiers build.

* [dotnet] Show a better error if the AOT compiler doesn't exist.

* [dotnet] Use the official path for the AOT compiler.

* [dotnet] Use platform-specific templates for WorkloadManifest.json.

* [dotnet] Generate the workload targets before the nupkgs.

This avoids a random build failure when doing parallel make.

* [builds] Install the runtime workloads for iOS and tvOS so that we have the AOT compilers downloaded for our local tests.

* [dotnet] Make the iOS and tvOS workloads load the AOT compiler packages from Mono.

* [dotnet] Move the workloads into a common subdirectory.

Also delete the watchOS workload, we're not shipping it for now.

* [dotnet] Set DOTNETSDK_WORKLOAD_MANIFEST_ROOTS when install workloads to get our local ones.

* Set DOTNETSDK_WORKLOAD_MANIFEST_ROOTS to where our local workloads are to use them when installing our locally built workloads into .NET (the local one).
* Stop installing workloads from builds/

* Get NuGet.config with local feed, and make sure those feed contain local build before running 'workload install'.

* Fix makefile logic.

* Another tweak.
2021-06-04 08:34:32 +02:00
Rolf Bjarne Kvinge e36d364048
[tests] Honor V=1 for build verbosity when building size comparison tests. (#11798) 2021-06-03 18:44:28 +02:00
Alex Soto 7fb037c878
[main][mono] Bump mono to HEAD of 2020-02 to match android (#11716)
* [mono] Bump mono to HEAD of 2020-02 to match android

New commits in mono/mono:

* mono/mono@c633fe9238 [MSBuild] Update to vs16.10 branch (#21073)
* mono/mono@a01309d104 sdks: Use https for xamjenkinsartifacts llvm archive download
* mono/mono@6e079842a6 sdks: Disable parallelism for mxe llvmwin64 build
* mono/mono@28a101a8ab [2020-02] Fix leak in assembly-specific dllmap lookups (#21053)
* mono/mono@0449008883 [MonoIO] Wrap calls to open() in EINTR handling (#21042)
* mono/mono@51d876a041 [2020-02][System.Native] Handle ReadDir EINTR (#21029)
* mono/mono@581e5827f4 Bump corefx for credscan fixes (#21018)
* mono/mono@c90ec48f59 [arm64] Fix wrong marshalling in gsharedvt transition (#21006)

Diff: b4a385816e..c633fe9238

* [mmptests] Accommodate tests to take into account msbuild formating changes
2021-06-02 18:59:09 -04:00
Rolf Bjarne Kvinge 4dd95f5e10
[monotouch-test] Use TestRuntime.RunAsync instead of AppDelegate.RunAsync so that the system sound tests work on macOS as well. (#11770)
* [monotouch-test] Use TestRuntime.RunAsync instead of AppDelegate.RunAsync so that the system sound tests work on macOS as well.

* [AudioToolbox] Don't use a generic Action type in a P/Invoke, CoreCLR doesn't support it.

Fixes these test failures:

    [FAIL] FromFile : System.Runtime.InteropServices.MarshalDirectiveException : Cannot marshal 'parameter #4': Non-blittable generic types cannot be marshaled.
    	   at AudioToolbox.SystemSound.AudioServicesAddSystemSoundCompletion(UInt32 soundId, IntPtr runLoop, IntPtr runLoopMode, Action`2 completionRoutine, IntPtr clientData)
    	   at AudioToolbox.SystemSound.AddSystemSoundCompletion(Action routine, CFRunLoop runLoop) in Xamarin.Mac.dll:token 0x600bfd4+0x2b
    	   at MonoTouchFixtures.AudioToolbox.SystemSoundTest.FromFile() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 40

    [FAIL] TestCallbackPlayAlert : System.ArgumentException : The specified Type must not be a generic type. (Parameter 'delegate')
           at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegateInternal(Delegate d)
           at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(Delegate d) in System.Private.CoreLib.dll:token 0x6004586+0xe
           at ObjCRuntime.BlockLiteral.SetupBlockImpl(Delegate trampoline, Delegate userDelegate, Boolean safe, String signature) in Xamarin.Mac.dll:token 0x6001306+0xb
           at ObjCRuntime.BlockLiteral.SetupBlock(Delegate trampoline, Delegate userDelegate, Boolean safe) in Xamarin.Mac.dll:token 0x6001305+0x5e
           at ObjCRuntime.BlockLiteral.SetupBlockUnsafe(Delegate trampoline, Delegate userDelegate) in Xamarin.Mac.dll:token 0x6001307+0x0
           at AudioToolbox.SystemSound.PlayAlertSound(Action onCompletion) in Xamarin.Mac.dll:token 0x600bfc8+0x20
           at MonoTouchFixtures.AudioToolbox.SystemSoundTest.<>c__DisplayClass3_1.<<TestCallbackPlayAlert>b__0>d.MoveNext() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 93
        --- End of stack trace from previous location ---
           at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state) in System.Private.CoreLib.dll:token 0x6002d4d+0x0
           at Foundation.NSAsyncSynchronizationContextDispatcher.Apply() in Xamarin.Mac.dll:token 0x6016560+0x0
        --- End of stack trace from previous location ---
           at ObjCRuntime.Runtime.InvokeMethod(MethodBase method, Object instance, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d1+0x274
           at ObjCRuntime.Runtime.InvokeMethod(MonoObject* methodobj, MonoObject* instanceobj, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d0+0x0
           at ObjCRuntime.Runtime.bridge_runtime_invoke_method(MonoObject* method, MonoObject* instance, IntPtr parameters, IntPtr& exception_gchandle) in Xamarin.Mac.dll:token 0x6001124+0x26
           at ObjCRuntime.Messaging.void_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1)
           at TestRuntime.RunAsync(DateTime timeout, Action action, Func`1 check_completed, NSImage imageToShow) in xamarin-macios/tests/common/mac/TestRuntime.macos.cs:line 18
           at MonoTouchFixtures.AudioToolbox.SystemSoundTest.TestCallbackPlayAlert() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 92

    [FAIL] TestCallbackPlaySystem : System.ArgumentException : The specified Type must not be a generic type. (Parameter 'delegate')
           at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegateInternal(Delegate d)
           at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(Delegate d) in System.Private.CoreLib.dll:token 0x6004586+0xe
           at ObjCRuntime.BlockLiteral.SetupBlockImpl(Delegate trampoline, Delegate userDelegate, Boolean safe, String signature) in Xamarin.Mac.dll:token 0x6001306+0xb
           at ObjCRuntime.BlockLiteral.SetupBlock(Delegate trampoline, Delegate userDelegate, Boolean safe) in Xamarin.Mac.dll:token 0x6001305+0x5e
           at ObjCRuntime.BlockLiteral.SetupBlockUnsafe(Delegate trampoline, Delegate userDelegate) in Xamarin.Mac.dll:token 0x6001307+0x0
           at AudioToolbox.SystemSound.PlaySystemSound(Action onCompletion) in Xamarin.Mac.dll:token 0x600bfca+0x20
           at MonoTouchFixtures.AudioToolbox.SystemSoundTest.<>c__DisplayClass2_1.<<TestCallbackPlaySystem>b__0>d.MoveNext() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 74
        --- End of stack trace from previous location ---
           at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state) in System.Private.CoreLib.dll:token 0x6002d4d+0x0
           at Foundation.NSAsyncSynchronizationContextDispatcher.Apply() in Xamarin.Mac.dll:token 0x6016560+0x0
        --- End of stack trace from previous location ---
           at ObjCRuntime.Runtime.InvokeMethod(MethodBase method, Object instance, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d1+0x274
           at ObjCRuntime.Runtime.InvokeMethod(MonoObject* methodobj, MonoObject* instanceobj, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d0+0x0
           at ObjCRuntime.Runtime.bridge_runtime_invoke_method(MonoObject* method, MonoObject* instance, IntPtr parameters, IntPtr& exception_gchandle) in Xamarin.Mac.dll:token 0x6001124+0x26
           at ObjCRuntime.Messaging.void_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1)
           at TestRuntime.RunAsync(DateTime timeout, Action action, Func`1 check_completed, NSImage imageToShow) in xamarin-macios/tests/common/mac/TestRuntime.macos.cs:line 18
           at MonoTouchFixtures.AudioToolbox.SystemSoundTest.TestCallbackPlaySystem() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 73
2021-06-02 18:19:25 +02:00
TJ Lambert e06ee8e653
[Localization] Test to make sure the new resx files are compiled to Resources (Edited) (#11737)
* making sure new strings get added to designer and resources plus the test

* Next wave of changes to csproj to incorporate Rolf's changes

* fixing path

* Update tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/LocalizationStringTest.cs

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

* Update tests/mtouch/LocalizationTests.cs

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

* forgot the include

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-06-02 11:11:15 -05:00
Rolf Bjarne Kvinge 3eb01e728e
[monotouch-test] It doesn't look like the TryCopyCurrentNetworkInfo test works in the iOS 11 simulator either. (#11764)
* [monotouch-test] It doesn't look like the TryCopyCurrentNetworkInfo test works in the iOS 11 simulator either.

Partial fix for #11504.

* Always assert null.
2021-06-02 16:01:28 +02:00
Rolf Bjarne Kvinge bfe3a1bce0
[monotouch-test] Try to fix a few runtime warnings about unbalanced calls to begin/end appearance transitions. (#11783)
Try to fix these warnings that show up at runtime by checking if the root view
controller is a UINavigationController, and doing the right thing:

> Unbalanced calls to begin/end appearance transitions for <...>
2021-06-02 16:00:40 +02:00
Sebastien Pouliot 73bb153254
[tests][dotnet] Update oldnet sample to use LLVM and add some instructions (#11780)
Using the AOT LLVM-backend is recommended for release and should be used
when comparing sizes.

Also add some basic instruction to ease comparing `oldnet` and `dotnet`
app bundles since IL stripping is not yet available to dotnet builds (and
without considering this the _real_ numbers are a bit off)
2021-06-02 09:07:55 -04:00