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

4543 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 18ab7db7c7
[xharness] Fix warning about unknown file wrt default inclusion. (#10438)
Fixes this warning when running xharness:

    Unknown file: fsharplibrary.fsproj (extension: .fsproj). There might be a default inclusion behavior for this file.
2021-01-18 07:28:39 +01:00
VS MobileTools Engineering Service 2 0cea46da64
[CI][VSTS] The pkg of the tests fail because there is a path not longer found. (#10436)
fixes: https://github.com/xamarin/maccore/issues/2363

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-01-15 17:14:21 -05:00
Rolf Bjarne Kvinge aa1bf71cd6 [monotouch-test] Make it work with Mac Catalyst.
* Fix system version checks to work properly on Mac Catalyst (which uses the macOS
  version as its system version).

* Add the framework-specific defines to the build for monotouch-test.csproj (using
  the generated response files), this way we can use them in the tests.

* Sprinkle conditionals in numerous places - I tried using either framework-specific
  or XAMCORE_3_0 whenever that made since (instead of using Mac Catalyst as a condition).

* Updated a few tests to use non-deprecated API (because the deprecated API often
  doesn't exist in Mac Catalyst).

* Also a few minor API fixes to make any corresponding tests compile.
2021-01-15 17:52:28 +01:00
Sebastien Pouliot 4eda43b1c9
[msbuild] Fix semi-conflicting options to set codesign timestamp (#10428)
TL&DR:

This effectively change nothing - but prevents (warn) if both options
contradict themselves.

Long Story....

So we have two ways to control the codesign's `--timetamp` option but
they both ignore each other so we can end up with the option being
set more than once at build time.

`DisableTimestamp` was the original one. It was meant for iOS (and
derivative OS) and disable the option (which requires the network)
for simulator or debug builds. IOW we _wanted_ timestamps when doing
release builds for devices.

```
DisableTimestamp="$(_CodesignDisableTimestamp)"
```

```
<_CodesignDisableTimestamp>False</_CodesignDisableTimestamp>
<_CodesignDisableTimestamp Condition="'$(_SdkIsSimulator)' == 'true' Or '$(_BundlerDebug)' == 'true'">True</_CodesignDisableTimestamp>
```

Now disabling the timestamp did not mean it was enabled. We did not ask
for a timestamp, leaving it to the default which from `man codesign`
means:

> If this option is not given at all, a system-specific default behavior is invoked.
> This may result in some but not all code signatures being timestamped.

Then `UseSecureTimestamp` was added for macOS builds. If hardening is
enabled then a secure timestamp is required.

`msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets` `_CodesignAppBundle`

```
UseSecureTimestamp="$(UseHardenedRuntime)"
```

However it's also exposed for iOS (shared target) in
`msbuild/Xamarin.Shared/Xamarin.Shared.targets` `__CodesignNativeLibraries`
but it would always be `false` in that case.

Adding this option means there's now always a `--timestamp` option given,
either to enable it (no URL so it means using Apple's server) or to
disable it (`=none`) but since it's controlled by `UseHardenedRuntime`,
which is macOS only, then iOS device builds are never timestamped.

An alternative would be to have `UseSecureTimestamp` as a macOS-only
option - but that would change how we currently sign the iOS applications
and I'd rather not change things that are known to work.
2021-01-15 10:43:11 -05:00
Rolf Bjarne Kvinge 29727d6a8d
[tests] Preserve a required method in System.Private.CoreLib to work around a bug in .NET 6. (#10426)
Ref: https://github.com/dotnet/runtime/issues/46908.
2021-01-15 16:39:44 +01:00
Rolf Bjarne Kvinge 24331f35dd
[monotouch-test] Adjust CaptiveNetworkTest.TryCopyCurrentNetworkInfo to work on iOS 10.3.3 (#10435)
According to Apple's documentation, an app linked with iOS 12 or later must
enable a specific entitlement, otherwise calls to CNCopyCurrentNetworkInfo
will always return NULL.
2021-01-15 16:14:27 +01:00
Manuel de la Pena d04a86a408
[CI][VSTS] The pkg of the tests fail because there is a path not longer found. (#10432) 2021-01-15 07:53:05 -05:00
Rolf Bjarne Kvinge ef53600f7a
[monotouch-test] Change the url for the TestPACParsingScriptNoProxy test to be the Microsoft uri. (#10423)
All the other *NoProxy tests use the Microsoft uri, which seems to be the uri
that's not supposed to need a proxy (according to what I understand from the
code) - in other words, it looks like this was a c&p error.

Fixes this test failure when running on device:

    [FAIL] TestPACParsingAsyncNoProxy :   Expected: None
        But was:  HTTPS
	        at MonoTouchFixtures.CoreFoundation.ProxyTest.TestPACParsingAsyncNoProxy () [0x000fa] in /Users/rolf/work/maccore/onedotnet/xamarin-macios/tests/monotouch-test/CoreFoundation/ProxyTest.cs:238
2021-01-15 08:25:19 +01:00
Rolf Bjarne Kvinge 48080d2d03
[monotouch-test] Add version checks for new HKCategoryTypeIdentifier fields. (#10424) 2021-01-15 08:24:29 +01:00
Rolf Bjarne Kvinge ca7d562493
[monotouch-test] Add a few Xcode version checks to ColorTest and AvoidOccluderConstraintTest. (#10425)
* [monotouch-test] Adjust ColorTest.CreateByMatchingToColorSpace to be Xcode 11+ only.

This test uses CGColor.CreateSrgb, which is Xcode 11+ only.

* [monotouch-test] Restrict AvoidOccluderConstraintTest to iOS 11+.
2021-01-15 08:24:12 +01:00
Sebastien Pouliot 05e28c3713
[macos] Add correct support for producing/archiving `dSYM` (#10409)
TL&DR: This PR

1. Removes the creation of the `.dSYM` based on `Debug Information` [1]

2. Adds dSYM support to XM msbuild (now shared with XI implementation)

3. Archive the `.dSYM` directories (plural) properly, e.g.

```
msbuild -p:Configuration=Release -p:ArchiveOnBuild=true
```

Why ? The long story...

Historically `.dSYM` for Xamarin.Mac have not been very useful, largely
because (most of) the code is JITed so not much is known before runtime.
So they were simply not generated during the builds...

However AOT options were added to Xamarin.Mac, making them potentially
more useful. Also symbols from `libmono` and other native libraries /
frameworks can prove useful when diagnosing application crashes.

Unsurprisingly developers looking to get symbols eventually found _a way_
[1] to get a `.dSYM` for their applications - but it was not quite
correct because:

* setting the debug information option meant that `mmp` would be supplied with `-debug`. This disables several optimizations that are, by default, enabled for release builds. IOW generating symbols should have no effect on the executing code (but it had);

* it was produced when compiling the native launcher, so the symbols coverage was incomplete. How much depends if mono was statically or dynamically linked. However this would not cover any AOTed code nor bundled libraries or user frameworks.

* the .dSYM was produced inside the `x.app/Contents/MacOS/`, side-by-side with the native executable, which makes it part of the **signed** `.app` and also part of the created (and signed) `.pkg`. This had a large impact on the application's, disk and download, size(s). Manually (re)moving the `.dSYM` means re-signing the app and re-creating (and signing) the `.pkg` is not a good solution.

[1] https://forums.xamarin.com/discussion/139705/how-to-symbolicate-a-xam-mac-crash-log

Additional fixes

* Use `Directory.Move` instead of running the `mv` command

While the result is identical there is a cost to spawn several `mv`
processes. Doing it in parallel (might have) helped but that setup
also comes at a cost.

`Directory.Move` the four `.dylib.dSYM` of an app takes 1 ms, while
the existing code took 17 ms to do the same.

* Fix building mmptest since the DeleteDebugSymbolCommand constant is not present (nor used) anymore
2021-01-14 08:42:24 -05:00
Rolf Bjarne Kvinge db79cd6b4c
[monotouch-test] Fix a few issues when running the .NET version of monotouch-test on device. (#10419)
* [monotouch-test] Fix conditional compilation constants when building for device.

* [tests/monotouch-test] Don't use entitlements when building monotouch-test for device.
2021-01-14 14:37:31 +01:00
Rolf Bjarne Kvinge 7584ada30d
Bump to .NET 6.0.100-alpha.1.21060.3. (#10388)
* Bump to .NET 6.0.100-alpha.1.21060.3.

* Fix dotnet command line arguments.

* dotnet build: the project file must be the first argument.
* dotnet build/publish: use the documented verbosity format.

* Update version number in tests.

* [tests/introspection] Adjust introspection to cope with different library names in the new .NET version.

* [tests/link sdk] Adjust the LinkSdkRegressionTest.SpecialFolder test according to the new version of .NET 6.

* [tests/link sdk] Preserve a required method in System.Private.CoreLib to work around a bug in .NET 6.

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

* Revert "[CI][VSTS] Add the donet 6 pkg as a dependency. (#10348)"

This reverts commit 6de4e717e7.

There's no need to provision .NET 6, it's done automatically.
2021-01-14 14:07:28 +01:00
Rolf Bjarne Kvinge 4181593b15
[msbuild] Merge the iOS and Mac versions of the DetectSigningIdentity task. (#10407)
Mac Catalyst needs much of the Mac signing logic, so merge the iOS and Mac
versions of DetectSigningIdentity so that the Xamarin.iOS.Tasks assembly
contains what it needs for Mac Catalyst.
2021-01-14 07:49:30 +01:00
Rolf Bjarne Kvinge a54f948011
[msbuild] Unify handling of Sdks. (#10375)
* [msbuild] Unify handling of Sdks.

Create an Sdks class in Xamarin.MacDev.Tasks.Core, which handles both Xamarin.iOS
and Xamarin.Mac. Refactor the MacOSXSdks and IPhoneSdks classes to use the new Sdks
class.

This makes it possible to avoid some code duplication in MacOSXSdks and IPhoneSdks,
and also share code elsewhere.

This requires a bump of Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@fae0237 [Xamarin.MacDev] Add GetAppleDTSettings and GetSdkSettings to the IAppleSdk interface. (#85)

Diff: f665e3a0fc..fae0237704

* Translate exception message.

* Simplify according to review.

* Update list of non-translated strings.
2021-01-13 11:44:11 +01:00
Sebastien Pouliot 734b8a7f2a
[msbuild] Simplify resolving xcframeworks (#10376)
TD&LR: This PR simplifies how we refer to user frameworks and fixes both
warnings and non-optimal (app) output.

Much longer story:

Additional testing on macOS showed some build-time warnings and an
[extra (dupe) file](a20f8aba41 (diff-54fd7d9cd5deae57f30195be0a43133eace03c1132401741a317e0ae8d5e13fdR34)).

Logs shows that we referred to the xcframework several times, where once
should have been enough.

```
/native-reference:/Users/poupou/git/spouliot/xcframework/Universal.xcframework
/native-reference:/Users/poupou/git/spouliot/xcframework/Universal.xcframework/macos-arm64_x86_64/Universal.framework
/native-reference:/Users/poupou/git/spouliot/xcframework/Universal.xcframework/macos-arm64_x86_64/Universal.framework/Universal
```

The first `/native-reference` line produced a warning like:

```
MMP warning MM2006: Native library 'Universal.xcframework' was referenced but could not be found.
```

which makes sense as the tools (both `mmp` and `mtouch`) are not, by
design, aware of (unresolved) xcframeworks.

Removing `{NativeReference}` from `Xamarin.Mac.Common.targets` (and
`Xamarin.iOS.Common.targets`) as it has already been processed by
`_ExpandNativeReferences` solves this.

The other part of the issue (next two lines) is because `msbuild` does
not track changes to directories like it does for files - and the
workaround (in `_ExpandNativeReferences`) had to be copied in other
places (both XI and XM `_CompileToNative`) and that was not enough (and
would eventually need to be duplicated again and again).

This could lead to duplicate entries (i msbuild logs) like

```
NativeReferences
../../Universal.xcframework/macos-arm64_x86_64/Universal.framework
../../Universal.xcframework/macos-arm64_x86_64/Universal.framework/Univeral
```
which maps to our extra entries.

In order to simplify things we make the `_ExpandNativeReferences` resolve
the full path to the library name (not the `.framework` directory) which
simplifies both `_CompileToNative` and ensure a single way (at least for
`msbuild`) to provide this data to the tools (`mmp` and `mtouch`).

Using a file, instead of a directory, is also more consistent for the
existing `-framework` option, e.g. we provide the names like:

```
--framework=CoreLocation
--framework=ModelIO
```

So adding a full path that include the name is more appropriate, e.g.

``` --framework=/Users/poupou/git/master/xamarin-macios/tests/xharness/tmp-test-dir/xcframework-test760/bin/AnyCPU/Debug/bindings-xcframework-test.resources/XTest.xcframework/ios-i386_x86_64-simulator/XTest.framework/XTest
```

Finally for macOS applications it turns out we were embedding yet another
copy of the framework's library inside the `MonoBundle`, which is clearly
wrong, because of the last entry.

```
$ l bin/Release/xcf-mac.app/Contents/MonoBundle/Universal
-rwxr-xr-x  1 poupou  staff  167152  2 Dec 16:16 bin/Release/xcf-mac.app/Contents/MonoBundle/Universal
```

The tool now checks if a provided library is inside a framework (or not)
which is a good validation to have anyway when it gets called directly,
i.e. not thru `msbuild`.
2021-01-12 16:02:01 -05:00
Rolf Bjarne Kvinge 08cf9653df
[xtro] Make it possible to override the sharpie executable. (#10373)
Use a variable for the sharpie executable, so that it's easier to override
while doing testing.
2021-01-12 09:55:23 +01:00
vs-mobiletools-engineering-service2 603fdcd5ec
Bump the shared XHarness library (#10367)
Co-authored-by: Premek Vysoky <premek.vysoky@microsoft.com>
2021-01-11 17:04:56 -05:00
Rolf Bjarne Kvinge 22d65a560d
[tests] Add xtro support for Mac Catalyst. Fixes #10214. (#10289)
* [xtro] Add support for Mac Catalyst. Fixes #10214.

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

* Update xtro.

* Bump Objective-Sharpie.

* Delete .todo files for frameworks we don't support.

* And another one bites the dust.

* [xtro] Update.
2021-01-11 11:56:58 +01:00
Přemek Vysoký 1c34588487
[xharness] Bump the shared library version
This is mainly to bring in this fix: dotnet/xharness@841114a
(two parameters were swapped and BundleIdentifier was set to AppPath)

Other changes contained:

We don't log the full XML when listing devices anymore, just the file size
SimulatorLoader has a new method that accepts retryCount
2021-01-08 15:47:56 -05:00
Rolf Bjarne Kvinge 734c120bb0
[tests] Add a Xamarin.Forms test project using Mac Catalyst. (#10319) 2020-12-18 22:16:51 +01:00
Rolf Bjarne Kvinge 93bbfe7a86
[tests] Merge apitest into xammac_tests. (#10276)
* [apitest] Sanitize files by adding missing eols.

* [apitest] Add #if __MACOS__ to all test files.

In preparation for the move into monotouchtest.

* [apitest] Move test files into monotouchtest.

* [tests] Remove the apitest project.

* [monotouch-test] Remove MessagingMac.cs, it's not needed.

* [xammac-tests] Add file PlatformInfo.cs to the build.

* [xammac-tests] Move files into monotouch-test.

* [monotouch-test] Rename test class to not clash with another test class of the same (Objective-C) name.

* [tests] How did this ever work?

Answer: it never did.

* [monotouch-test] Remove duplicated test code.

* [xammac-tests] Define DYNAMIC_REGISTRAR when we're using the dynamic registrar.

* [monotouch-test] Adjust the BundleTest.TestGetBundleId test to cope with having multiple apps for the same bundle id.

* [monotouch-test] Ignore a test that doesn't work with the static registrar (due to a bug in the static registrar).
2020-12-18 11:45:06 +01:00
Alex Soto 04461cd5c8
Merge pull request #10306 from dalexsoto/main-xcode12.3
[main] Merge xcode12.3 into main
2020-12-17 15:20:24 -05:00
Rolf Bjarne Kvinge 1582bf47cc
Add support for binding projects in Mac Catalyst. Fixes #10286. (#10295)
* [tests] Build test-libraries for Mac Catalyst.

* [msbuild] Add support for Mac Catalyst binding projects.

* [mtouch] Allow frameworks for Mac Catalyst apps.

* [mtouch] Put frameworks in the expected location for Mac Catalyst apps.

* [msbuild] Create the Resources directory before trying to put files in it.
2020-12-17 18:53:16 +01:00
Rolf Bjarne Kvinge c98b51feb7
[bgen] Avoid a NullReferenceException when reporting multiple attributes on a type. Fixes #10310. (#10311)
Fixes https://github.com/xamarin/xamarin-macios/issues/10310.
2020-12-17 15:12:32 +01:00
Rolf Bjarne Kvinge ef0763bbac
[tests] Use the FSharp.Core NuGet for Mac Catalyst. (#10307)
We're not shipping F# assemblies for Mac Catalyst, so just use the ones from
NuGet instead.

This is a partial fix for https://github.com/xamarin/xamarin-macios/issues/10217.
2020-12-17 15:01:20 +01:00
Alex Soto bd16f26f88 Merge remote-tracking branch 'xamarin/xcode12.3' into main 2020-12-15 23:50:18 -05:00
Sebastien Pouliot d7684319cd
[xtro] Fix nullability checks on parameters (#10279)
and fix most (append for AppKit) additional missing/extra null that this
fix detected in the bindings
2020-12-15 08:24:10 -05:00
Sebastien Pouliot 50e91deda7
[spritekit] Add nullability to (generated and manual) bindings (#10262)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-12-14 08:32:17 -05:00
Alex Soto d5b500ff58 Revert "[tests] Ignore bcl-tests that causes a SIGFPE (#10235)"
This reverts commit 318ee8a3f5.
2020-12-10 14:31:18 -05:00
Alex Soto 051ffe51ad Revert "[tests] Ignore bcl-tests that causes a SIGFPE"
This reverts commit 2c3f8a69d2.
2020-12-10 09:59:42 -05:00
Rolf Bjarne Kvinge 38531bdcab
[CallKit] Add to macOS. (#10244) 2020-12-10 11:37:15 +01:00
Alex Soto 7a2ee467c6
[xcode12.3] Bump to Xcode 12.3 RC (#10240)
* [xcode12.3] Bump to Xcode 12.3 RC

* Remove the odds to make it even
2020-12-09 12:24:02 -05:00
Sebastien Pouliot aa73c33db9
[corebluetooth] Add nullability to (generated and manual) bindings (#10241)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-12-09 09:10:55 -05:00
Sebastien Pouliot 14ad1a122b
[gamekit] Add nullability to (generated and manual) bindings (#10237)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-12-08 21:37:26 -05:00
Sebastien Pouliot 4d53f14118
[tests] Re-enable ModelIO in Mac's introspection tests (fixed in 11.1 beta 2) (#10239) 2020-12-08 21:35:12 -05:00
Sebastien Pouliot 959aef9856
[network] Update for Xcode 12.2 beta 2 (#10238) 2020-12-08 17:15:26 -05:00
Alex Soto 318ee8a3f5
[tests] Ignore bcl-tests that causes a SIGFPE (#10235)
context: https://github.com/mono/mono/issues/20632
2020-12-08 12:52:04 -05:00
Sebastien Pouliot d5f9191eed
[coremotion] Update for Xcode 12.3 beta 1 (#10234) 2020-12-08 10:42:22 -05:00
Alex Soto 8830d0c088
Merge pull request #10196 from dalexsoto/xcode12.3-watchsim64
[Xcode12.3] [watchOS] Add x86_64 simulator support (#10059)
2020-12-08 08:04:53 -05:00
Sebastien Pouliot 16cd30a42c
[adservices] New in Xcode 12.3 beta 1 (#10229)
Annotations suggest that it's available on tvOS 14.3 but the headers
are not shipped in tvOS SDK.
2020-12-07 20:00:38 -05:00
Alex Soto 2c3f8a69d2 [tests] Ignore bcl-tests that causes a SIGFPE
context: https://github.com/mono/mono/issues/20632
2020-12-07 19:39:13 -05:00
Sebastien Pouliot dcc9a8322d
[gamecontroller] Update for Xcode 12.3 beta 1 (#10228) 2020-12-07 17:23:13 -05:00
Sebastien Pouliot a946610387
[healthkit] Update for Xcode 12.3 beta 1 (#10225) 2020-12-07 16:42:51 -05:00
Sebastien Pouliot 30f8156d23
[imageio] Update for Xcode 12.3 beta 1 (#10224) 2020-12-07 16:42:06 -05:00
Sebastien Pouliot bcc953bf50
[coregraphics] Expose CGColor.CreateByMatchingToColorSpace (#10223)
and add unit test

Fix https://github.com/xamarin/xamarin-macios/issues/10212
2020-12-07 16:40:29 -05:00
Rolf Bjarne Kvinge daa7e123e2
Add very early support for Mac Catalyst. (#10199)
* Install the Mac Catalyst versions of the mono libraries and BCL.
   * The BCL is the same as the one for Xamarin.iOS, which means it has to be post-processed a bit to work with a Xamarin.MacCatalyst.dll
* Build our runtime for Mac Catalyst.
* Build a Xamarin.MacCatalyst.dll with the Mac Catalyst API (it compiles, but I haven't looked at the API surface at all). This PR assumes we're going to have a new TargetFrameworkIdentifier for Mac Catalyst, but a final decision has not been made (see https://github.com/dotnet/runtime/issues/44882), so this may change.
* Build a Xamarin.iOS.dll that contains type forwarders to Mac Catalyst for all the types that exist in both Mac Catalyst and Xamarin.iOS.
* Add support to xharness for running introspection on Mac Catalyst (there are a lot of failures because the API surface is wrong)
* Add support to our msbuild tasks and mtouch for building Mac Catalyst apps. This basically comes down to adding a new case in numerous places to either do things the iOS way or the macOS way, depending on each case.
* Add a __MACCATALYST__ define (which is in addition to the __IOS__ define).
2020-12-04 18:27:37 +01:00
Rolf Bjarne Kvinge 9e20285ebb
[tests] Merge the msbuild-mac tests into the Xamarin.MacDev.Tests project. (#10129) 2020-12-04 13:05:51 +01:00
Rolf Bjarne Kvinge 4f75b9e8da
[tests] Update test to cope with change in Xamarin.WatchOS.dll's location. (#10198)
Fixes this test failure:

* Xamarin.Linker.SdkTest.NoLLVMFailuresInWatchOS("../../32bits/Xamarin.WatchOS.dll"):
    AOT compilation
    Expected: 0
    But was: 1

This regresed in 87d04ac331.
2020-12-04 11:38:08 +01:00
Rolf Bjarne Kvinge b36b02c80e
[tests] Remove the MM0143 test, it doesn't look like VSMac is going to fix the bug. Fixes #8939. (#10183)
* [tests] Skip the MM0143 test, it doesn't look like VSMac is going to fix the bug. Fixes #8939.

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

* Remove more code.
2020-12-03 16:59:14 +01:00
Sebastien Pouliot 1d6cf0c46e
[scenekit] Add nullability to (generated and manual) bindings (#10195)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-12-03 09:14:54 -05:00
Rolf Bjarne Kvinge aaf2818af5 [src] Fix availability for MPNowPlayingPlaybackState 2020-12-03 10:43:20 +01:00
Rolf Bjarne Kvinge eafa843ec2 [xharness] Add support for Mac Catalyst test suites. 2020-12-03 10:43:19 +01:00
Rolf Bjarne Kvinge 65e59b29da [msbuild] Don't generate archived-expanded-entitlements.xcent for catalyst apps 2020-12-03 10:43:19 +01:00
Rolf Bjarne Kvinge 9edb9e2885 [tests] Add test project 2020-12-03 10:42:25 +01:00
Alex Soto 2b1d0799aa [xcode12.3][watchOS] Add x86_64 simulator support
* Bumps mono binaries to include x86_64 watchOS support
* Build runtime/registrar x86_64 slices
* Produce a 64 bit version of Xamarin.WatchOS.dll
* Allow building x86_64 for watch simulators in mtouch
* Let xharness know about x86_64

* [tests] Add x86_64 arch to test-libraries

* Make dotnet package aware of x64

* [ObjCRuntime] Fix computing if we're calling a stret function or not in a 64-bit watchOS simulator.

* [xharness] Re-enable some watchOS tests.

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

New commits in mono/mono:

* mono/mono@ac596375c7 Add support for OP_FCONV_TO_I to mini-arm64.c. (#20548)
* mono/mono@392fe5b87b [2020-02][watchOS] Add simwatch64 support (#20552)
* mono/mono@a22ed3f094 Fix potential crash for Encoder.Convert (#20522)
* mono/mono@970783731f Bump to F# 5.0 (#20511)
* mono/mono@32ab5066f7 Bump msbuild to fix a build issue
* mono/mono@93a7fe77e8 Ensure special static slots respect alignment. (#20506)
* mono/mono@3db5b35841 [debugger] Switch to GC Unsafe in signal handler callbacks (#20495)
* mono/mono@af315f44c4 [2020-02][corlib] ThreadAbortException protection for ArraySortHelper (#20468)
* mono/mono@ca11fb0fd8 [2020-02] Bump ikvm-fork to include https://github.com/mono/ikvm-fork/pull/20 (#20452)

Diff: be2226b5a1..ac596375c7
2020-12-02 22:23:45 -05:00
Alex Soto fa4b8dbb0a
[CoreImage] Update bindings to Xcode 12.3 Beta 1 (#10164) 2020-12-01 09:20:31 -05:00
Alex Soto 1a1b9cd78b
[Contacts] Update bindings to Xcode 12.3 Beta 1 (#10163) 2020-12-01 09:19:38 -05:00
Sebastien Pouliot 0473fce78d
[networkextension] Update to Xcode 12.3 beta 1 (#10166)
Mostly changes in Xcode 12.2 (beta 3)
https://github.com/xamarin/xamarin-macios/wiki/NetworkExtension-iOS-xcode12.2-beta3

and macOS-only changes from 12.3 beta 1
https://github.com/xamarin/xamarin-macios/wiki/NetworkExtension-macOS-xcode12.3-beta1
2020-11-30 23:11:27 -05:00
Sebastien Pouliot f07968f01b
[tvservices] Update for Xcode 12.3 beta 1 (#10184) 2020-11-30 17:16:44 -05:00
Alex Soto ba0465c2e6
[AVFoundation] Update bindings to Xcode 12.3 Beta 1 (#10162)
* [AVFoundation] Update bindings to Xcode 12.3 Beta 1

* Fix xtro
2020-11-30 14:53:20 -05:00
Sebastien Pouliot 8ad5d7bd29
[uikit] Update for Xcode 12.3 beta 1 (#10181) 2020-11-30 13:50:06 -05:00
Sebastien Pouliot 3bd14c3eef
[msbuild] Add support for `.xcframework` (#10046)
This is done early so we can resolve the inner framework, inside the
xcframework, and let the existing framework support do most of the
work.

The resolving code has unit tests. Custom projects for "NoEmbedding"
exists for all supported platforms and executed by xharness.

A sample `xcframework` with tests projects is also available 
[here](https://github.com/spouliot/xcframework).

The xcframework test case is based on Rolf's earlier/partial implementation.
https://github.com/rolfbjarne/xamarin-macios/commit/xcframework

Things to note:

Do not rename a framework (like XTest) to use it in an xcframework
(like XCTest). That will fail at codesign but won't give anything
useful. You might think signing the framework (instead of the inner
binary) would solve it. It does, as it codesign, but then the app
crash at startup. At some point you realize some symbols are still
using XTest (not XCTest) and then you can delete several other weird
workarounds (like for `ld`) because all of it was cause by this
never identified rename.

dSYM support (and tests) to be done in a separate PR.
2020-11-30 13:44:03 -05:00
Sebastien Pouliot edf1847405
[tests] Re-enable MediaAccessibility/ImageCaptioningTest.cs` `SetCaption` test (#10172)
This works fine with Xcode 12.3 beta 1 on 10.15.7 (Intel) and 11.0

ref: https://github.com/xamarin/xamarin-macios/issues/10165
2020-11-30 08:16:36 -05:00
Rolf Bjarne Kvinge 87d04ac331
[src/mtouch] Put implementation assemblies in a per-platform directory (#10169)
Currently we put the implementation assemblies for all Xamarin.iOS platforms
in the same directory. This makes it impossible to have different
implementations for the same assembly in different platforms: in particular,
we're going to want a special version of Xamarin.iOS.dll for Mac Catalyst
(that will just have type forwarders into Xamarin.MacCatalyst.dll), that that
assembly will go into the Mac Catalyst-specific directory of implementation
assemblies.
2020-11-27 18:53:25 +01:00
Alex Soto f9679cde8c
[ARKit] Update bindings to Xcode 12.3 Beta 1 (#10158)
* [ARKit] Update bindings to Xcode 12.3 Beta 1

* Update tests/introspection/ApiProtocolTest.cs
2020-11-26 10:26:04 -05:00
Sebastien Pouliot 229b6253a9
[mac] Add user-framework support for Xamarin.Mac (#10144)
* Move existing tests to iOS subdirectory and adjust reference paths
2020-11-26 08:47:41 -05:00
Sebastien Pouliot 3125f7ad73
[tests] Remove empty xtro files (#10157) 2020-11-25 14:15:47 -05:00
Sebastien Pouliot 0723e3cd20
[corevideo] Update for Xcode 12.2 RC (#10155) 2020-11-25 09:30:44 -05:00
Sebastien Pouliot 267495d0c9
[tests][monotouch] Fix recent CGColorSpace tests not to fail on macOS 10.15.x (#10142)
```
CreateExtendedTest: System.EntryPointNotFoundException : CGColorSpaceCreateExtended assembly:<unknown assembly> type:<unknown type> member:(null)
```

The API was added in iOS 14.0 (Xcode 12.0) but macOS 11.0 (Xcode 12.2)
and it does not exists on my Mac (10.15.7) even if I don't recall seeing
fail on the bots.
2020-11-24 16:30:14 -05:00
Alex Soto 54c91d3868
[xcode12.3] Initial bump to Xcode 12.3 Beta 1 (#10135) 2020-11-23 09:48:06 -05:00
Rolf Bjarne Kvinge a4a1fea868
[dotnet] Add an issue for a missing Mono.framework, which isn't on us for now. (#10126) 2020-11-23 09:44:03 +01:00
Alex Soto 72c7b1ffcc
[main][watchOS] Add x86_64 simulator support (#10059)
* [watchOS] Add x86_64 simulator support

* Build runtime/registrar x86_64 slices
* Produce a 64 bit version of Xamarin.WatchOS.dll
* Allow building x86_64 for watch simulators in mtouch
* Let xharness know about x86_64

* [tests] Add x86_64 arch to test-libraries

* Make dotnet package aware of x64

* [ObjCRuntime] Fix computing if we're calling a stret function or not in a 64-bit watchOS simulator.

* [xharness] Re-enable some watchOS tests.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-11-20 09:27:46 -05:00
Rolf Bjarne Kvinge f4c9327fac
[dotnet] Bump to .NET 6.0.100-alpha.1.20556.2 and net6.0 (#10079)
This involves a few changes:

* Change everything to reference net6.0 instead of net5.0
* Update various variables to be NET6* instead of NET5*
* Reorder build logic to account for that our targets are imported earlier in
  the build process:

   In the latest .NET 6, our Workloads.targets is imported earlier in the
   build. This requires a few changes, because we still need to run most of
   our logic later in the process, which we do by adding targets files we
   want imported later to the AfterMicrosoftNETSdkTargets property.

   What we're loading as soon as possible:

   * Our version information (Xamarin.Shared.Sdk.Versions.targets)
   * The supported OS versions
     (Microsoft.<platform>.Sdk.SupportedTargetPlatforms.targets)
   * The default OS version
     (Xamarin.Shared.Sdk.TargetFrameworkInference.targets).

   This is all information that the .NET build require early on.

   Changes:

   * Rename all files that are loaded early to *.props.
   * Updated documentations to reflect these changes.
   * Remove Microsoft.<platform>.TargetFrameworkInference.targets, these
     files aren't used and don't contain anything useful.
   * Move the logic to calculate _ComputedTargetFrameworkMoniker has been
     delayed to later, because it needs TargetFrameworkMoniker set.

* Add a StoreAttributesStep to store attributes that are removed by the
  linker, but that the static registrar needs.

   In particular, in .NET 6 the linker removes the
   System.Runtime.CompilerServices.ExtensionAttribute, which the static
   registrar needs to handle category methods properly.

   This involved copying and slightly modifying the RemoveAttributesBase
   code.
2020-11-19 15:01:55 +01:00
Manuel de la Pena 15a3060d65 [Tests] Fix msbuild tests after the test API changed. 2020-11-18 10:26:35 -05:00
Rolf Bjarne Kvinge 1570b2616d
[xharness] Bring back special processing of GuiUnit for Xamarin.Mac test projects. (#10103)
This code isn't necessary in main, because we've removed any GuiUnit usage,
but in d16-8 we're still using GuiUnit, which means we still need to process
GuiUnit project references correctly.

This fixes numerous build failures when building Xamarin.Mac tests (in
particular when building Xamarin.Mac tests for older macOS versions).
2020-11-18 15:48:33 +01:00
Manuel de la Pena f6010bee10 [AVFoundation] Fix merge issue. 2020-11-17 15:16:58 -05:00
Manuel de la Pena 999ddda01b [Xtro] Update xtro ignore files with the new mac os x bindings. 2020-11-17 12:07:19 -05:00
Manuel de la Pena a810f6954a [Security] Fix some tests after the bump to NUnitlite. 2020-11-17 11:14:04 -05:00
Manuel de la Pena 0f7bc75e50 Merge branch 'xcode12.2' into main-xcode12.2 2020-11-17 11:09:15 -05:00
Rolf Bjarne Kvinge 62a8c9ad46 [xharness] Don't generate into the same directory/files for macOS Modern and macOS Full. (#9121)
* [xharness] Don't generate into the same directory/files for macOS Modern and macOS Full.

This meant that we were overwriting some generated files, which meant that we
were executing the Modern set of tests instead of the Full set of tests for at
least some configurations.

* Add a few ignored tests to the System.Configuration test now that we actually run it.
2020-11-16 20:43:57 +01:00
Rolf Bjarne Kvinge 85c2d0a638 Fix merge conflict. 2020-11-16 19:10:46 +01:00
Rolf Bjarne Kvinge 3e14390ce6 [tests] Switch msbuild-mac to use package references. (#9245)
And don't specify the solution path anymore, because we can restore using just
the csproj just fine now.
2020-11-16 18:28:12 +01:00
Rolf Bjarne Kvinge 2cf58c57f0 [tests] Switch msbuild-mac and mmptest to use package references. (#9246)
And don't specify the solution path anymore, because we can restore using just
the csproj just fine now.
2020-11-16 18:25:57 +01:00
Rolf Bjarne Kvinge 5792c497d9 Merge remote-tracking branch 'origin/main' into dotnet-6.0.100-alpha.1.20559.4 2020-11-16 15:33:26 +01:00
Rolf Bjarne Kvinge 7218d51e1a One straggler! 2020-11-16 15:22:36 +01:00
Alex Soto fec5322de4 [tests] Fix mmp and MSBuild mac tests 2020-11-13 16:54:22 -05:00
Manuel de la Pena 02bfdcb559 Make things match. 2020-11-13 11:52:02 -05:00
Manuel de la Pena d8e21b6226 [Tets] Retarget the NUnit references in mac projects. 2020-11-13 11:48:00 -05:00
Přemek Vysoký 0fba63cdc7
[xharness] Remove Microsoft.DotNet.XHarness.iOS.Shared project and use NuGet instead (#9980) 2020-11-13 11:05:10 -05:00
Alex Soto 5173ebd456 [xharness] Manual revert of e4aaf6a8d6
Reverts: e4aaf6a8d6

This allows ApiTests to avoid issues like this https://gist.github.com/dalexsoto/0769ead003e5e501296a1861dc1aedc2
2020-11-12 21:42:26 -05:00
Alex Soto b589427668 [tests] Accomodate tests to Xcode 12.2 changes 2020-11-12 21:40:32 -05:00
Manuel de la Pena e5ea789738 [Tests][Network] Do not really check the value, just make sure that we are called. (#9901) 2020-11-12 19:38:26 -05:00
Alex Soto 1b243acbf9 Merge remote-tracking branch 'xamarin/xcode12.2' into d16-8-xcode12.2-merge 2020-11-12 18:52:53 -05:00
Sebastien Pouliot d4fb41b172
[tests] Update framework tests not to embed/zip the native binaries (#10073)
Manually added `NoBindingEmbedding` to bindings .csproj and removed
`[LinkWith]` attributes.

Also added support for NativeReference to harness and updated the
workaround for watchOS (since it can't link against ModelIO)

Fixed/adapted unit tests wrt change
2020-11-11 12:00:48 -05:00
Rolf Bjarne Kvinge d6756f4829 Merge remote-tracking branch 'origin/main' into dotnet-6.0.100-alpha.1.20559.4 2020-11-11 16:38:15 +01:00
Rolf Bjarne Kvinge bbc81dd80c
[dotnet] We're not doing anything with regards to the http handler, so we won't have a runtime-options.plist. (#10083) 2020-11-11 07:43:49 +01:00
Rolf Bjarne Kvinge db23ca881a
[dotnet] Add _CreateDebugSettings, _CreateDebugConfiguration and _CreatePkgInfo to the targets we run on app creation. (#10061) 2020-11-10 13:44:26 +01:00
Rolf Bjarne Kvinge ac36750f49
[tests] Add a tvOS version of the dotnet introspection test project. (#10066)
* [tests] Move the dotnet introspection test project to a new test directory.

A tvOS project will come soon too, this makes the separation nicer.

* [tests] Add a tvOS version of the dotnet introspection test project.
2020-11-10 13:44:05 +01:00
Rolf Bjarne Kvinge c640775699 [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0
New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@f8768d9 Advance into the world of net6.0

Diff: 9abe69e6f5..f8768d99ef
2020-11-10 11:41:06 +01:00
Sebastien Pouliot 7db9e66d87
[tests] Disable XM samples that use QTKit, ibtool won't compile their nib anymore (#10057) 2020-11-05 13:24:27 -05:00
monojenkins f7b13c49f2
[tests] Bump sampletester hashes to pick up fixes (#10054) 2020-11-05 11:32:05 -05:00
monojenkins 64166db9f4
[tests] Bump sampletester hashes to pick up fixes (#10042) 2020-11-05 10:30:51 -05:00
Rolf Bjarne Kvinge 0def89604d
[msbuild] Add Metal files to our items included by default. (#10049) 2020-11-05 15:36:36 +01:00
Rolf Bjarne Kvinge 8aa53ba943
[dotnet] Add app extension targets to our list of stuff to do during the build. (#10044)
That makes app extensions build in dotnet.

This required adding a RuntimeIdentifier property to all the extension test
projects.
2020-11-05 08:34:29 +01:00
Rolf Bjarne Kvinge 1c6cd0b439
[tests] Re-enable the ReleaseBuild.RebuildTest, since we're using msbuild exclusively now. (#10041)
This test also required a few changes to pass.
2020-11-05 08:24:50 +01:00
TJ Lambert c67a2d076c
[msbuild] Adding W0111 Translations (#10022)
Updating msbuild localization string translation for error code W0111
2020-11-04 09:55:06 -06:00
Rolf Bjarne Kvinge e7dd367125
[msbuild] Add CoreML models to our items included by default. (#10038) 2020-11-04 16:01:43 +01:00
Rolf Bjarne Kvinge 32f360ed42
[tests] Re-enable an that requires msbuild (as opposed to xbuild). (#10040)
Since we're using msbuild exclusively now.
2020-11-04 15:19:05 +01:00
Sebastien Pouliot 9eeeb5c512
[tests] Bump sampletester hashes to pick up fixes (#10020) 2020-11-04 09:01:47 -05:00
Rolf Bjarne Kvinge 781bc851a5
[dotnet] Add atlas textures to the our items included by default. (#9995) 2020-11-04 08:40:16 +01:00
Rolf Bjarne Kvinge d104a660ed
[tests] Update .NET unit tests to parse the binlog. (#10031)
Update the .NET unit tests to parse the binlog instead of standard output for
specific build output, since we're not printing a diagnostic build log to
standard output anymore.

This fixes numerous test failures in the .NET unit tests:

    * Xamarin.Tests.DotNetProjectTest.BuildBindingsTest("watchOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildBundledResources("iOS","monotouch"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildEmbeddedResourcesTest("iOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildBundledResources("watchOS","monotouch"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildBindingsTest2("tvOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildBindingsTest("tvOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildBindingsTest("iOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildBundledResources("tvOS","monotouch"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildMyTVApp: Linker did not executed as expected.
        Expected: String containing "Building target "_RunILLink" completely."
        But was: "Microsoft (R) Build Engine version 16.8.0-preview-20475-05+aed5e7ed0 for .NET [...]"

    * Xamarin.Tests.DotNetProjectTest.BuildMySingleView: Linker did not executed as expected.
        Expected: String containing "Building target "_RunILLink" completely."
        But was: "Microsoft (R) Build Engine version 16.8.0-preview-20475-05+aed5e7ed0 for .NET [...]"

    * Xamarin.Tests.DotNetProjectTest.BuildInterdependentBindingProjects("iOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildEmbeddedResourcesTest("tvOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildBindingsTest2("watchOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildFSharpLibraryTest("tvOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildFSharpLibraryTest("watchOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildEmbeddedResourcesTest("watchOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildBindingsTest2("iOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildInterdependentBindingProjects("tvOS"): Assemblies
        Expected: not <empty>
        But was: <empty>

    * Xamarin.Tests.DotNetProjectTest.BuildFSharpLibraryTest("iOS"): Assemblies
        Expected: not <empty>
        But was: <empty>
2020-11-03 18:20:33 +01:00
Sebastien Pouliot 1f0b89cd6a
[appkit] Fix introspection tests for NSAccessibility on macOS 10.9 (#10016)
This reverts parts of https://github.com/xamarin/xamarin-macios/pull/9993
and add a special case to the test looking for duplicate attributes
between members and the type.

Why ? Introspection fails because `bgen` inline the `NSAccessibility`
protocol (added in 10.10) into types that existed earlier. That's
normally not a problem since the type-level attribute is there.
However because of the 10.9 (type) vs 10.10 (protocol) issue that was
moved into the manual bindings (so `bgen` does not know it)

Even if built inside `COREBUILD` the issue exists since the protocol
interface does not really exists at that point (by default), so it's
the type (10.9) availability that is looked up.

In retrospect we should have created a new type, like Swift did (a
few years later), named `NSAccessibilityProtocol` for 10.10.

Fix https://github.com/xamarin/xamarin-macios/issues/10009
2020-11-02 08:15:47 -05:00
Sebastien Pouliot a18679b036
[metrickit] Add missing `MXMetricManager.MakeLogHandle` API (#10017)
and add unit test since it's _partially_ a manual binding as it
returns an non-ObjC type.

Fixes https://github.com/xamarin/xamarin-macios/issues/10004
2020-10-30 18:28:58 -04:00
TJ Lambert d51d34a0eb
[msbuild] Localization String Test for All Strings (#9971)
This test will run through all available strings in MSBStrings.Designer.cs in the each of the supported languages.
If any strings should fire in other languages but are still in english, an error will be thrown unless that error code is in an ignore file.

There are two types of ignore files introduced:

LocalizationIgnore/common-Translations.ignore
for error codes that are not yet translated in all languages
LocalizationIgnore/<LOCALE>-Translations.ignore
for error codes that are not yet translated in the specific locale

If an error code is in an ignore file and it turns out it is translated, an error will be thrown to remove the error code from the ignore file.

If there is a non-valid error code in any ignore file, an error will also be thrown.

Wiki will be updated for the team to reflect this test: https://github.com/xamarin/maccore/wiki/Localization
2020-10-30 10:19:55 -05:00
Rolf Bjarne Kvinge 6e5f39a5b5
[tests] Make sure there are no simulators lurking around when we start running the .NET unit tests. (#10013)
It seems actool can fail in interesting ways if there are other types of simulators running from earlier tests:

* com.apple.actool.errors
   * Failed to find newest available Simulator runtime, no available runtime found from:
        watchOS 7.0 (7.0 - 18R382) - com.apple.CoreSimulator.SimRuntime.watchOS-7-0 (unavailable, failed to open liblaunch_sim.dylib) ==> not available: Error Domain=com.apple.CoreSimulator.SimError Code=401 "The watchOS 7.0 simulator runtime is not available." UserInfo={NSLocalizedDescription=The watchOS 7.0 simulator runtime is not available., NSUnderlyingError=0x7ff2160359b0 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=XPC error talking to SimLaunchHostService: <error: 0x7fff958b89a0> { count = 1, transaction: 0, voucher = 0x0, contents =
        	"XPCErrorDescription" => <string: 0x7fff958b8b08> { length = 18, contents = "Connection invalid" }
        }}}, NSLocalizedRecoverySuggestion=Unable to open liblaunch_sim.dylib.  Try reinstalling Xcode or the simulator runtime., NSLocalizedFailureReason=failed to open liblaunch_sim.dylib}

        tvOS 14.0 (14.0 - 18J383) - com.apple.CoreSimulator.SimRuntime.tvOS-14-0 (unavailable, failed to open liblaunch_sim.dylib) ==> not available: Error Domain=com.apple.CoreSimulator.SimError Code=401 "The tvOS 14.0 simulator runtime is not available." UserInfo={NSLocalizedDescription=The tvOS 14.0 simulator runtime is not available., NSUnderlyingError=0x7ff216332580 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=XPC error talking to SimLaunchHostService: <error: 0x7fff958b89a0> { count = 1, transaction: 0, voucher = 0x0, contents =
        	"XPCErrorDescription" => <string: 0x7fff958b8b08> { length = 18, contents = "Connection invalid" }
        }}}, NSLocalizedRecoverySuggestion=Unable to open liblaunch_sim.dylib.  Try reinstalling Xcode or the simulator runtime., NSLocalizedFailureReason=failed to open liblaunch_sim.dylib},

        iOS 14.1 (14.1 - 18A8394) - com.apple.CoreSimulator.SimRuntime.iOS-14-1 (unavailable, failed to open liblaunch_sim.dylib) ==> not available: Error Domain=com.apple.CoreSimulator.SimError Code=401 "The iOS 14.1 simulator runtime is not available." UserInfo={NSLocalizedDescription=The iOS 14.1 simulator runtime is not available., NSUnderlyingError=0x7ff21a607c80 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=XPC error talking to SimLaunchHostService: <error: 0x7fff958b89a0> { count = 1, transaction: 0, voucher = 0x0, contents =
        	"XPCErrorDescription" => <string: 0x7fff958b8b08> { length = 18, contents = "Connection invalid" }
        }}}, NSLocalizedRecoverySuggestion=Unable to open liblaunch_sim.dylib.  Try reinstalling Xcode or the simulator runtime., NSLocalizedFailureReason=failed to open liblaunch_sim.dylib},
    ] when matching for <IBCocoaTouchPlatformToolDescription: 0x7ff216274910> System content for IBAppleTVFramework-fourteenAndLater <IBScaleFactorDeviceTypeDescription: 0x7ff21622c520> scaleFactor=1x, renderMode.identifier=(null), idiom=<IBAppleTVIdiom: 0x7ff219f898b0> runtime=<IBCocoaTouchTargetRuntime: 0x7ff216257050>
2020-10-30 15:40:28 +01:00
Rolf Bjarne Kvinge 957bb31838 Merge remote-tracking branch 'origin/main' into tests-msbuild-improve 2020-10-30 08:34:02 +01:00
Rolf Bjarne Kvinge b7ca87a344
[tests] Remove 10.15 version checks since we only run on 10.15+ now. (#9999) 2020-10-30 07:49:36 +01:00
Rolf Bjarne Kvinge acf4038386
[dotnet] Don't try to include any results from the AOT compiler unless we're on a Mac. (#9989)
Because the AOT compiler won't execute unless we're on a Mac.

Also add a test.
2020-10-30 07:48:34 +01:00
Rolf Bjarne Kvinge 69a171abff [tests] Clean up Xamarin.MacDev.Tests.
This is a pretty big refactoring, which:

* Always copies the test projects to a temporary directory before running any tests
  that use them.
* Runs all the tests using an out-of-process MSBuild instance.
* Logs to a binlog instead of writing text to stdout.
* Refactors all the code that used the MSBuild assemblies in memory to instead:
    * Tests that modified projects in memory now modifies them on disk instead. This
      won't affect the working copy because the tests are always working with a copy
      of the test projects.
    * Tests that inspected projects in memory afterwards now parses the binlog to get
      the same information.
* Significantly simplified the code to setup the test projects for testing.
2020-10-29 14:52:31 +01:00
Rolf Bjarne Kvinge ebb3da262b [tests] There's no need to reference the MSBuild assemblies from Xamarin.MacDev.Tests anymore, we're going out-of-process! 2020-10-29 14:52:31 +01:00
Rolf Bjarne Kvinge 0ba5faecb5 [tests] There's no need for Xamarin.MacDev.Tests to reference Xamarin.iOS.Tasks
But we still need a reference to Xamarin.MacDev, since we use some code from that assembly.
2020-10-29 14:52:31 +01:00
Rolf Bjarne Kvinge 6aa51156a2 [tests] Remove BundlePath from ProjectTest, it's not used 2020-10-29 14:52:31 +01:00
Rolf Bjarne Kvinge 4d9bbaf650 [tests] Add Platform/Configuration to TestBase.
This makes it easier to simplify some code later.
2020-10-29 14:52:30 +01:00
Rolf Bjarne Kvinge 915f96b885 [tests] Remove dead code 2020-10-29 14:51:53 +01:00
Rolf Bjarne Kvinge 1ea929ac48 [tests] Remove unused variable. 2020-10-29 14:51:53 +01:00
Rolf Bjarne Kvinge 16c60508c5 [tests] Remove outdated comment 2020-10-29 14:51:53 +01:00
Rolf Bjarne Kvinge 62af8c3fd9 [tests] Use binlog instead of text logs 2020-10-29 09:53:06 +01:00
Rolf Bjarne Kvinge d882a3e370 [tests] Drop AssemblyInitialization from Xamarin.MacDev.Tests, it's not needed 2020-10-29 09:53:06 +01:00
Rolf Bjarne Kvinge 8f2913b518
[dotnet] Add asset catalogs to the our items included by default. (#9841) 2020-10-29 09:18:20 +01:00
Rolf Bjarne Kvinge 1197c67ebe
[tests] Rewrite ValidateAppBundleTaskTests to not create a task in-process. (#9983)
This is a step towards making Xamarin.MacDev.Tests run tests out-of-process.

It requires adding '_GenerateBundleName' as a dependency for the
'_ValidateAppBundle' target, because we're invoking the '_ValidateAppBundle'
directly, and we can't depend on any other targets executing
'_GenerateBundleName', because there are no other executed targets.
2020-10-29 08:59:11 +01:00
Sebastien Pouliot c3d66bcdca
[tests][monotouch-tests] ModelIO tests can't be executed on old Mac (#9988)
even if broken/ignored on 12.2 beta 3 the original condition, to check
for Xcode 9, remains required.
2020-10-28 13:54:42 -04:00
Rolf Bjarne Kvinge 26e720943f
[tests] Bump Xamarin.MacDev.Tests to net472 (#9986) 2020-10-28 17:48:04 +01:00
Rolf Bjarne Kvinge d02a2c2c3f
[tests] Simplify WatchKit 1 test (since we don't support WatchKit 1 anymore) (#9987) 2020-10-28 17:47:51 +01:00
Rolf Bjarne Kvinge 139c11a190
[tests] Use MyiOSFrameworkBinding as a binding test project instead of bindings-test (#9985)
MyiOSFrameworkBinding is in our normal collection of test projects (in
tests/common/TestProjects), which means it doesn't need a lot of special
casing to make it work.
2020-10-28 17:21:40 +01:00
Rolf Bjarne Kvinge 2cfbb67d31
[tests] Fix assert in DetectAppManifest_LibraryProject. (#9982)
"Is.Not.Null.Or.Empty" is equal to "(value != null) || (value.Length == 0)", which
is the same as "value != null", i.e. "Is.Not.Null", which was clearly not the intention
of this code.

The fact is that the _AppManifest value is not set for library projects, so the correct
assert is to verify that the value is null or empty.
2020-10-28 13:13:22 +01:00
Rolf Bjarne Kvinge 9cf78cf399
[tests] Clean up Xamarin.MacDev.Tasks.Tests. (#9975)
* Remove a lot of dead code.
* Use TestBase.CreateTask<T> to create tasks (and set required properties for all
  tasks) instead of instantiating tasks directly. This required subclassing TestBase
  in a few places, as well as making a few helper methods instance methods instead
  of static methods.
* Bump to net472.
* A few other misc simplifications.
2020-10-28 08:13:18 +01:00
Rolf Bjarne Kvinge c72b320561
[tests] Set MSBuildEnableWorkloadResolver=true when running the .NET tests. (#9977)
This works fine when executed from xharness, because
MSBuildEnableWorkloadResolver is set by xharness, but without this the dotnet
tests fail when executed from the IDE.
2020-10-28 08:12:19 +01:00
Sebastien Pouliot 7e854827d4
[msbuild] Have `XcodeCompilerToolTask` use `xcrun` to start Apple tools (#9965) (#9972)
1. Use `xcrun` to run `ibtool` (and `actool`) and avoid toolchain mismatches

2. Set `DEVELOPER_DIR` so everyone (well `xcrun`) use the same toolchain

3. Workaround for `macos-arm64` issue (FB8827920)

	* Start `ibtool` as an `Apple` [Silicon] process
	* This will ensure the `ibtoold` daemon is also running as `Apple`
	* If `ibtoold` is run as `Intel` then `ibtool` asserts and build fail

```
LaunchScreen.storyboard : error : 2020-10-26 14:24:52.757 ibtoold[37142:6681382] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-17506/InterfaceBuilderKit/Utilities/IBAbstractInterfaceBuilderPlatformToolManager.m:481
LaunchScreen.storyboard : error : Details:  Failed to attach to IBAgent-iOS with error: Error Domain=com.apple.InterfaceBuilder Code=-1 "Encountered an error communicating with IBAgent-iOS." UserInfo={NSLocalizedFailureReason=IBAgent-iOS (37146) failed to launch and exited with status 10, NSUnderlyingError=0x7fa4e58fc760 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to launch IBAgent-iOS via CoreSimulator spawn" UserInfo={NSLocalizedDescription=Failed to launch IBAgent-iOS via CoreSimulator spawn, NSUnderlyingError=0x7fa4e5e8a900 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to handshake with platform tool" UserInfo={NSLocalizedFailureReason=Failed to open connection over FIFOs with platform tool, NSLocalizedDescription=Failed to handshake with platform tool, NSUnderlyingError=0x7fa4e5e237c0 {Error Domain=com.apple.InterfaceBuilder Code=-1 "" UserInfo=0x7fa4e5e8bba0 (not displayed)}}}}}, NSLocalizedRecoverySuggestion=Please check Console.app for crash reports for "IBAgent-iOS" for further information., NSLocalizedDescription=Encountered an error communicating with IBAgent-iOS.}
LaunchScreen.storyboard : error : Object:   <IBCocoaTouchToolManager>
LaunchScreen.storyboard : error : Method:   +_THREADSAFE_launchNewToolWithLaunchContext:executionContext:toolProxyClass:proxyDelegate:failureContext:requestingMethod:error:forReason:
LaunchScreen.storyboard : error : Thread:   <NSThread: 0x7fa4e341af70>{number = 1, name = main}
LaunchScreen.storyboard : error : Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
LaunchScreen.storyboard : error : 2020-10-26 14:24:52.766 ibtoold[37142:6681382] [MT] IBPlatformTool: *** Failed to launch tool with description <IBCocoaTouchPlatformToolDescription: 0x7fa4e5f34160> System content for IBCocoaTouchFramework-fourteenAndLater <IBScaleFactorDeviceTypeDescription: 0x7fa4e5f2fb50> scaleFactor=2x, renderMode.identifier=(null): Encountered an error communicating with IBAgent-iOS. (Failure reason: IBAgent-iOS (37146) failed to launch and exited with status 10): Failed to launch IBAgent-iOS via CoreSimulator spawn: Failed to handshake with platform tool (Failure reason: Failed to open connection over FIFOs with platform tool): : Failed to open FIFOs for handshaking with platform tool (Failure reason: IBAgent-iOS exited before we could handshake)
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1425,3): error : ibtool exited with code 1
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1425,3): error :
LaunchScreen.storyboard : ibtool error : Encountered an error communicating with IBAgent-iOS.
```

Note: `main` has diverged quite a bit (net6 support) so this pull request
will need to be re-worked (it won't apply)

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

Foreport of #9965 since the source code diverged from `xcode12.2`
2020-10-27 21:11:08 -04:00
Rolf Bjarne Kvinge ebef5e3e6b
[xharness] Automatically run the msbuild tests if something in the msbuild or tests/msbuild directories changed. (#9976) 2020-10-27 21:45:57 +01:00
Sebastien Pouliot 93d8fa89a9
[msbuild] Have `XcodeCompilerToolTask` use `xcrun` to start Apple tools (#9965)
1. Use `xcrun` to run `ibtool` (and `actool`) and avoid toolchain mismatches

2. Set `DEVELOPER_DIR` so everyone (well `xcrun`) use the same toolchain

3. Workaround for `macos-arm64` issue (FB8827920)

	* Start `ibtool` as an `Apple` [Silicon] process
	* This will ensure the `ibtoold` daemon is also running as `Apple`
	* If `ibtoold` is run as `Intel` then `ibtool` asserts and build fail

```
LaunchScreen.storyboard : error : 2020-10-26 14:24:52.757 ibtoold[37142:6681382] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-17506/InterfaceBuilderKit/Utilities/IBAbstractInterfaceBuilderPlatformToolManager.m:481
LaunchScreen.storyboard : error : Details:  Failed to attach to IBAgent-iOS with error: Error Domain=com.apple.InterfaceBuilder Code=-1 "Encountered an error communicating with IBAgent-iOS." UserInfo={NSLocalizedFailureReason=IBAgent-iOS (37146) failed to launch and exited with status 10, NSUnderlyingError=0x7fa4e58fc760 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to launch IBAgent-iOS via CoreSimulator spawn" UserInfo={NSLocalizedDescription=Failed to launch IBAgent-iOS via CoreSimulator spawn, NSUnderlyingError=0x7fa4e5e8a900 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to handshake with platform tool" UserInfo={NSLocalizedFailureReason=Failed to open connection over FIFOs with platform tool, NSLocalizedDescription=Failed to handshake with platform tool, NSUnderlyingError=0x7fa4e5e237c0 {Error Domain=com.apple.InterfaceBuilder Code=-1 "" UserInfo=0x7fa4e5e8bba0 (not displayed)}}}}}, NSLocalizedRecoverySuggestion=Please check Console.app for crash reports for "IBAgent-iOS" for further information., NSLocalizedDescription=Encountered an error communicating with IBAgent-iOS.}
LaunchScreen.storyboard : error : Object:   <IBCocoaTouchToolManager>
LaunchScreen.storyboard : error : Method:   +_THREADSAFE_launchNewToolWithLaunchContext:executionContext:toolProxyClass:proxyDelegate:failureContext:requestingMethod:error:forReason:
LaunchScreen.storyboard : error : Thread:   <NSThread: 0x7fa4e341af70>{number = 1, name = main}
LaunchScreen.storyboard : error : Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
LaunchScreen.storyboard : error : 2020-10-26 14:24:52.766 ibtoold[37142:6681382] [MT] IBPlatformTool: *** Failed to launch tool with description <IBCocoaTouchPlatformToolDescription: 0x7fa4e5f34160> System content for IBCocoaTouchFramework-fourteenAndLater <IBScaleFactorDeviceTypeDescription: 0x7fa4e5f2fb50> scaleFactor=2x, renderMode.identifier=(null): Encountered an error communicating with IBAgent-iOS. (Failure reason: IBAgent-iOS (37146) failed to launch and exited with status 10): Failed to launch IBAgent-iOS via CoreSimulator spawn: Failed to handshake with platform tool (Failure reason: Failed to open connection over FIFOs with platform tool): : Failed to open FIFOs for handshaking with platform tool (Failure reason: IBAgent-iOS exited before we could handshake)
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1425,3): error : ibtool exited with code 1
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1425,3): error :
LaunchScreen.storyboard : ibtool error : Encountered an error communicating with IBAgent-iOS.
```

Note: `main` has diverged quite a bit (net6 support) so this pull request
will need to be re-worked (it won't apply)

Fixes https://github.com/xamarin/xamarin-macios/issues/4634
2020-10-27 08:07:52 -04:00
Manuel de la Pena e64aeb4ada
[Xharness] Bring xharness changes to d16-8 (#9951)
* [xharness] Add support for skipping more test variations.

* [xharness] Add the dotnet introspection project file to our list of projects, and mark it as a .NET project.

* [xharness] Clearly label .NET projects as such.

* [xharness] Disable project generation for .NET projects for now.

* [xharness] Create DotNetBuildTasks when we need to build .NET projects.

* [xharness] Improve project cloning to take into account default inclusion behavior for .NET projects.

.NET projects will include files from the current directory by default, which
means that if we clone the project file and write the cloned project file in a
different directory, we'll have to add an automatically included files into
the cloned file manually.

* [xharness] Add a GetDotNetExecutable callback and an MSBuildPath property to [I]ProcessManager.

* [xharness] Retrieve a .NET project's OutputPath by running MSBuild.

.NET projects are vastly simplified, which means that the OutputPath can't be
determined by reading the project file itself, it has to be calculated by
MSBuild.

So that's exactly what we do: we run MSBuild on the project file and get it to
print the property we're interested in.

* [xharness] Skip the old simulator variation for introspection/dotnet for now.

* [xharness] Try to not have log directories with spaces in them. (#8976)

The simulators won't write stdout/stderr to a path with a space.

* [xharness] Don't generate makefile targets for .NET projects.

They end up with the same make targets as non-.NET targets, which prints
warnings in the terminal when running make.

We're not using the makefile targets much anymore, so postpone implementing
them for .NET until we need them for some reason.

* [xharness] Add support for generating a tvOS version of .NET iOS projects. (#9032)

* [xharness] Add support for generating a tvOS version of .NET iOS projects.

And use it to run the tvOS version of introspection for .NET.

* [xharness] Change according to reviews.

* [xharness] Use Cecil to inspect assemblies, instead of Reflection. (#9082)

This is slightly faster - ~0.95s vs ~1.4s - (probably because reflection tries
to load a lot of other referenced assemblies, which may or may not exist,
causing exceptions (if they don't exist) or spend time loading them (which
Cecil won't)).

It also avoids a lot of exception details showing up when tracing xharness
execution.

* [xharness] Don't group simulators when running in server mode. (#9098)

Grouping simulators means we have to wait until we know which simulators are
available, because we group by the simulator's UDID.

When running in server mode, we don't need to group simulator test runs,
because we run the as the user chooses, not in any particular order.

This way the test list loads faster at startup, since we don't have to wait
until we've loaded the simulators before we can show the list.

* [xharness] Fix finding testable types in test assemblies. Fixes #xamarin/maccore@2267. (#9103)

Apparently a null namespace when using Reflection can be an empty namespace in Cecil.

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

* [xharness] Parse NUnit v2 xml reports correctly. (#9110)

* [xharness] De-asyncify template expansion. (#9104)

This avoids:

* Getting the resource stream for every template expansion
* Reading the resource stream
* A lot of async code.

Instead just read the resource stream once, into a string, and return that.

This speeds up the startup by ~10% (from ~0.96s to ~0.83s on my machine).

* [xharness] Improve code to not throw exceptions in the first place instead of catching and ignoring. (#9118)

* [xharness] Try harder to make lldb quit after trying to get a backtrace. (#9119)

When a process times out, we try to print a stack trace for all threads. This
involves executing "lldb --source <script>", where the script contains:

	process attach --pid 1234
	thread list
	thread backtrace all
	detach
	quit

Basically we attach to the project, and ask lldb to print stack traces.

The problem:

    16:09:02.9522580 Printing backtrace for pid=25276
    16:09:02.9528060 /usr/bin/lldb --source /var/folders/q7/mkzwrzcn7bzf3g2v38f3c1cw0000gn/T/tmp58e75d85.tmp
    16:09:04.6127570 (lldb) command source -s 0 '/var/folders/q7/mkzwrzcn7bzf3g2v38f3c1cw0000gn/T/tmp58e75d85.tmp'
    16:09:04.6130020 Executing commands in '/var/folders/q7/mkzwrzcn7bzf3g2v38f3c1cw0000gn/T/tmp58e75d85.tmp'.
    16:09:04.6130200 (lldb) process attach --pid 25276
    16:09:05.6458750 error: attach failed: Error 1
    16:09:05.7529100 25276 Execution timed out after 1200 seconds and the process was killed.
    16:09:05.7588770 Execution timed out after 1200 seconds.

If any of those commands fail, the subsequent commands aren't executed. This
includes the final "quit" command, which means we end up waiting forever for
lldb to do its thing, when lldb doesn't think it needs to do anything at all.

The fix: pass two different scripts. It turns out subsequent scripts are
executed even if previous scripts fail, so we do the equivalent of:

     lldb --source <attach script> --source <quit script>

And now lldb will quit no matter what the attach script does (it still works
even if the attach script succeeds, in which case we'll ask lldb to quit
twice).

* [xharness] Improve process killing a bit. (#9120)

* Log what we're doing.
* Wait a bit after sending SIGABRT, to allow for the OS to create any crash
  reports.

* [xharness] Don't try to write cleaned xml into the same file as the dirty xml was. (#9122)

* [xharness] Don't replace existing files, instead add new files, when providing human-readable logs. (#9123)

This makes understanding what's going on much easier.

* [xharness] Fix BCL project generation for watchOS projects. (#9131)

Reading from a file named as the actual content of the watchOS template doesn't
_quite_ work. Instead just use the content directly.

* [xharness] Only try to parse the build log if we have a build log. (#9130)

* [xharness] Don't generate into the same directory/files for macOS Modern and macOS Full. (#9121)

* [xharness] Don't generate into the same directory/files for macOS Modern and macOS Full.

This meant that we were overwriting some generated files, which meant that we
were executing the Modern set of tests instead of the Full set of tests for at
least some configurations.

* Add a few ignored tests to the System.Configuration test now that we actually run it.

* [xharness] Disable default inclusion behavior for the introspection .NET tests. (#9137)

It gets too annoying to keep track of which files are where with the project
cloning we're doing, if files are implicitly included.

* [xharness] Generate BCL projects asynchronously. (#9083)

Split the BCL project generation in two: one part that figures out which
projects to generate, and which is done synchronously (because we need it to
compute the list of tests), then split out the actual generation and run it on
a background thread (since that doesn't have to happen until we want to
execute those tests).

This speeds up launching xharness in server mode significantly (from ~2s to
~0.2s).

* [xharness] Document the test loading process a little bit.

* [xharness] Generate projects into a subdirectory for each project.

Because it's cumbersome to keep the build working when the same directory has
multiple project files.

* [xharness] Remove a lot of special-casing for the mono-native tests.

It's not needed anymore.

* [xharness] Store attribute in local variable instead of fetching it twice.

* [xharness] Make ProjectFileExtensions.GetInfoPListInclude a bit clearer.

Add a comment to document what's supposed to happen, and simplify the code a little bit.

* [xharness] Add support for specifying whether variations should be generated for Xamarin.iOS projects.

* [xharness] Don't generate variations for BCL projects using the normal procedure, we generate them differently already.

This makes it possible to remove some dead code.

* [xharness] Add a TestPlatform value to TestProject, and use it to indicate that a TestProject might be of a specific platform already.

* [xharness] Make the templates path an input parameter for the BCL templates.

* [xharness] Make the BCL project generation generate each project file into its own subdirectory.

* [tests] Put the iOS and macOS mono-native templates in their own directory.

This makes it possible to remove a few conditions in the code.

* [xharness] Simplify the MonoNativeInfo class a bit by removing the custom Mac-specific subclass (there's almost no difference anymore).

* [tests] Move bindings-test[-mac].csproj to their own directory.

* [xharness] Fix compiler warning. (#9147)

* [xharness] Fix logic to not create makefile targets to run BCL tests. (#9148)

According to the existing code, we're already not supposed to create makefile
targets for BCL tests. However, the code to detect BCL tests wasn't quite
reliable, so we ended up creating makefile targets for some BCL tests.

So always use the same logic to detect BCL tests.

Also remove a lot of dead code to generate makefile code for BCL tests.

* [tests] Set the correct mono-native link mode and flavor defines in the csproj itself.

This makes it possible to simplify a lot of C# code.

* [xharness] Remove a redundant ToArray.

* [xharness] Allow for null environment variables to mlaunch. (#9140)

It's a valid scenario to set a null environment variable.

This happens when changing InCI to always return true (to test locally what's
done on the bots), in which case we try to forward BUILD_REVISION to mlaunch,
but BUILD_REVISION isn't necessarily set. Not forwarding it to mlaunch should
not cause problems in most tests, so just allow this scenario.

* [xharness] Generate makefile targets for non-executable projects. (#9158)

It turns out some Xamarin.Mac projects are library projects (for unit tests),
and we still need to generate makefile targets for those (because we use them
to build Xamarin.Mac tests to run on older macOS bots).

* [xharness] Backport Touch.Unit fix for command line parsing. (#9165)

Apply https://github.com/spouliot/Touch.Unit/pull/78 to the duplicated file.

* [tests] Info.plists should be inside LogicalName, not Link.

This makes it possible to simplify a bit more code inside xharness as well.

* Merge remote-tracking branch 'origin/main' into xharness-a-directory-per-project

* [xharness] Fix finding Info.plist, and add some tests too.

* [xharness] Fix how .NET projects are ignored. (#9168)

* [xharness] Fix how .NET projects are ignored.

Now they're actually ignored if .NET tests are not included.

* Fix compile error.

* Merge remote-tracking branch 'origin/main' into xharness-a-directory-per-project

* [xharness] If we're not generating projects in the Target class, the project path equals the template path.

* [xharness] Make restoring nugets the default for all test projects. (#9237)

But don't do it for .NET projects, since 'dotnet build' automatically restores.

* [xharness] Improve restoring NuGets for Xamarin.Mac projects in the makefile by depending on the csproj files in addition to the packages.conf files. (#9242)

Packages are listed in the csproj when we're using package references.

Also only list files in git, otherwise we pick up all the generated project files as well.

* [tests] Migrate the sample tests to use package references. (#9244)

* [tests] Switch msbuild-mac to use package references. (#9245)

And don't specify the solution path anymore, because we can restore using just
the csproj just fine now.

* [xharness] Mark the .NET tests project as a .NET project so that we don't try to call nuget restore on it. (#9251)

* [xharness] Mark the .NET tests project as a .NET project so that we don't try to call nuget restore on it.

* [xharness] Mark the .NET generator project as a .NET project as well.

* [xharness] Resolve relative project references using the referencing project's directory. (#9252)

Otherwise it would end up being resolved from the current directory, which is
not dependable.

* [xharness] Don't try to parse a build log that doesn't exist. (#9253)

* [xharness] Add support for generating/duplicating projects with a Touch.Client reference.

This also means removing support for generating/duplicating MonoTouch.NUnit references,
since we're not using those anymore.

* [tests] Remove dead code related to GuiUnit and the GuiUnit submodule.

* [xharness] Change how we run macOS unit tests to work with Touch.Client.

This is very similar to how we run iOS unit tests.

* [xharness] Add the Touch.Client projects to our solutions instead of MonoTouch.NUnitLite.

* [tests] The upstream NUnitLine isn't linker safe, so add an xml file to make sure linking doesn't remove too much.

In particular NUnit uses reflection to get a private method, and the linker removes
the corresponding private method:

1c680b4dc8/src/NUnitFramework/framework/Internal/TestExecutionContext.cs (L552)

So add an xml definition to keep this private method, and modify project files to
pass the xml definition to mtouch and mmp.

Some care needs to be taken to make sure xharness is still able to clone these project
files.

* [xharness] Add support for finding/setting the main Xamarin import among multiple imports.

This is required for the previous commit, where we added an additional import to
a few project files to pass an xml definition to mtouch/mmp.

* [xharness] Use LogFile instead of ResultFile in macOS BCL tests to match the Touch.Client usage.

* [tests] Restore projects before building them from the command line.

* [xharness] Implement Log.GetReader for all loggers. (#9257)

This makes it easier to write code that parses logs, since that code won't
have to worry about if a particular log supports GetReader or not.

* [xharness] Fix main log parsing by not requiring it to come from a file. (#9258)

Not all types of logs have files, but all types of logs have a reader (or will
have soon due to PR #9257).

* [xharness] Improve parsing of NUnitV2 xml reports to fix an issue with failures in parameterized tests. (#9259)

We weren't properly reporting all failures when there were multiple failures
in parameterized tests, because we'd incorrectly skip too many xml nodes when
we were looking for the next test failure.

* Merge remote-tracking branch 'origin/main' into HEAD

* Remove wrongly added dir. (#9301)

Someone (Manuel) uses an IDE that uses .idea to store user settings and
that got added by accident.

* [Harness] Fix some typos. (#9303)

* [xharness] Make it possible to include .NET tests by setting a label. (#9298)

This also means that setting 'run-all-tests' enables the .NET tests, which
means they'll now start running on internal Jenkins (as was the intention from
the beginning).

* [xharness] Look at the exact NUnit version an NUnit project is referencing to figure out how to run it in a makefile. (#9322)

* [xharness] Add support for adding PropertyGroups for unknown platform/configuration values in a csproj. Fixes xamarin/maccore@2277. (#9347)

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

* [xharness] Add support for getting the default AssemblyName for projects. (#9369)

In .NET projects there's a default value for most properties, which means that
there won't necessarily be an AssemblyName property in a csproj. We need to know the
AssemblyName, so calculate it from the csproj filename (which is how .NET does it).

This turned out slighly complicated, because we're pass an XmlDocument around,
and the XmlDocument doesn't know the file from where it was loaded, so we need
to keep that information separately.

* [xharness] Add the .NET version of interdependent-binding-projects to our lineup

* [xharness] Enhance ResolveAllPaths to understand $(RootTestsDirectory).

This requires passing the root directory around in multiple places, since ResolveAllPaths
doesn't have access to the static class where we define the root directory.

Also call ResolveAllPaths in a few more places to ensure paths everywhere are resolved.

* [xharness] Do not mark DeviceLoaders as loaded when loading fails (#9367)

* [xharness] Make sure MSBUILD_EXE_PATH is not set when executing dotnet.

Something ends up confused, and dotnet hangs.

* [xharness] Bump timeout for the .NET tests.

More tests take longer to run!

* [xharness] Don't clone the same project multiple times when reached through different project references.

Problem:

1. interdependent-binding-project references binding-test and bindings-test2.
2. bindings-test2 references bindings-test.

This means bindings-test is reached through 2 projects: both
interdependent-binding-projects and bindings-test2, and previously we'd
process each of these references separately, effectively making two separate
clones of the bindings-test project.

Instead keep track of all referenced projects from the leaf project, and if we
encounter a project we've already cloned, use that directly.

* [dotnet] Add support for consuming binding projects. (#9376)

* Port the interdependent-binding-projects test to .NET (it's the simplest
  test project we have with binding projects).
* Add a lot of the shared source code for mtouch/mmp to dotnet-linker, and
  make it compile. Most issues were fixed by adding a few stubbed out classes,
  since there are large chunks of the mtouch/mmp code we're not using yet, so
  stubbing out while things are being implemented works fine.
* Add a step in dotnet-linker for loading the linker output (the linked
  assemblies) into our bundler code.
* Add another step in dotnet-linker to extract native resources from binding
  libraries.
* Augment the build process to take into account the native resources we found
  in any binding libraries.

* [xharness] Make it possible to make a project ignored by default from its initial definition.

Make it possible to make a project ignored by default from its initial definition,
and which takes precedence over any other selection criteria.

This way it's possible to make the .NET version of monotouch-test show up in the
web view, which makes it runnable locally (for testing), while at the same time it
will never be run on CI.

* [xharness] Add monotouch-test to the .NET lineup.

* [xharness] Improve resolving paths in project files.

* Properties may contain a list of files, separated by semi-colon, so if we find
  any semi-colons, treat each entry as a separate path.

* Treat anything that starts with a variable as a full path, because either the
  variable is a full path, or it will be updated according to the new project location
  and resolve correctly.

* [xharness] Process '$(RootTestsDirectory)' before bailing due to any other variables when resolving paths in project files. (#9467)

While keeping '$(RootTestsDirectory)' as-is works fine when building the
project using MSBuild, xharness itself may end up encountering it (in
particular when listing referenced projects), and at that point will end up
confused. So just always resolve '$(RootTestsDirectory)' to the actual
directory to keep other parts of xharness happy.

Fixes this problem (as seen in PR #9460):

    Harness exception for 'interdependent-binding-projects': System.IO.DirectoryNotFoundException: Could not find a part of the path "/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/external/Touch.Unit/Touch.Client/dotnet/iOS/Touch.Client-iOS.dotnet.csproj".
        at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0015e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:223
        at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:149
        at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:86
        at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess)
        at Microsoft.DotNet.XHarness.iOS.Shared.Utilities.PListExtensions.LoadWithoutNetworkAccess (System.Xml.XmlDocument doc, System.String filename) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Utilities/PlistExtensions.cs:17
        at Microsoft.DotNet.XHarness.iOS.Shared.TestProject.CreateCopyAsync (Microsoft.DotNet.XHarness.iOS.Shared.Logging.ILog log, Microsoft.DotNet.XHarness.iOS.Shared.Execution.IProcessManager processManager, Microsoft.DotNet.XHarness.iOS.Shared.Tasks.ITestTask test, System.String rootDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] allProjectReferences) [0x0010c] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestProject.cs:98
        at Microsoft.DotNet.XHarness.iOS.Shared.TestProject.CreateCopyAsync (Microsoft.DotNet.XHarness.iOS.Shared.Logging.ILog log, Microsoft.DotNet.XHarness.iOS.Shared.Execution.IProcessManager processManager, Microsoft.DotNet.XHarness.iOS.Shared.Tasks.ITestTask test, System.String rootDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] allProjectReferences) [0x00811] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestProject.cs:168
        at Microsoft.DotNet.XHarness.iOS.Shared.Tasks.TestTasks.RunInternalAsync () [0x00117] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Tasks/TestTask.cs:274

* [tests] Port dont link to .NET (#9488)

There are a few test failures, so it's ignored by default in xharness for now.

* [xharness] don't link is now green on .NET!

* [tests] Port link sdk to .NET

* [xharness] link sdk is now green on .NET!

At least the Debug configuration is, there's still a test failure in the Release
configuration, so skip that for now.

* [tests] Port link all to .NET (#9515)

* [tests] Port link all to .NET

* [tests] Exclude link all tests in .NET that reference OpenTK-1.0.dll

OpenTK-1.0.dll isn't supported yet.

* [tests] Exclude link all tests using API that isn't available anymore in .NET.

* [xharness] Use the local 'ignore' variable instead of fetching 'test.TestProject.Ignore' for every test when generating test variations. (#9518)

* [xharness] Enable monotouch-test/.NET by default, but ignore all variations. (#9526)

* [xharness] Enable monotouch-test/.NET by default, but ignore all variations.

The default (Debug) configuration is green now, but the rest of the variations aren't yet.

* [tests] Ignore LocaleTest.InitRegionInfo in .NET because it needs globalization data.

Ref: https://github.com/xamarin/xamarin-macios/issues/8906

I can't reproduce locally, because it's ignored for me:

    [INCONCLUSIVE] InitRegionInfo : You can construct locale without countries
        at MonoTouchFixtures.Foundation.LocaleTest.InitRegionInfo() in [...]/xamarin-macios/tests/monotouch-test/Foundation/LocaleTest.cs:line 47

but this should fix this monotouch-test test failure (I'm guessing that 'IV'
stands for 'Invariant', which is all the current .NET version ships with):

    MonoTouchFixtures.Foundation.LocaleTest
        [FAIL] InitRegionInfo :   Name
            String lengths are both 2. Strings differ at index 0.
            Expected: "US"
            But was:  "IV"
            -----------^
                 :    at MonoTouchFixtures.Foundation.LocaleTest.InitRegionInfo() in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/monotouch-test/Foundation/LocaleTest.cs:line 49

* [xharness] Enable the .NET tests when a file containing 'dotnet' is modified. (#9510)

* [xharness] Enable the .NET tests when a file containing 'dotnet' is modified.

This also required adding support for using regex as file names when selecting
which tests to run.

* Remove redundant dotnet prefix.

* [xharness] Rename variables to match usage.

* [dotnet] Use net5.0-[ios|tvos|watchos|macos] TargetFrameworks. (#9532)

* [dotnet] Set TargetPlatformSupported when the right TargetPlatformIdentifier is used.

* [dotnet] Generate a list of valid OS versions for each platform, and add it to the SupportedTargetPlatform item group.

The generated files: https://gist.github.com/rolfbjarne/765c4e4b38b1b017380c9378d9666317

* [dotnet] Define and set the default platform version if it's not set in the TargetFramework variable.

* [dotnet] Switch to using the new-style TargetFramework values.

This includes bumping spouliot/Touch.Unit to get new-style TargetFramework values for Touch.Client.

* spouliot/Touch.Unit@89afaf7 [Touch.Client] Use the right TargetFrameworks for watchOS and macOS as well. (#92)
* spouliot/Touch.Unit@fd0e576 [Touch.Client] Use the right TargetFrameworks. (#91)
* spouliot/Touch.Unit@40f47db [Touch.Client] Add a macOS and watchOS version for .NET. (#90)
* spouliot/Touch.Unit@1d4b8c0 Add .gitignore for NuGet.config and global.json. (#89)
* spouliot/Touch.Unit@49441f3 Call `mlaunch` instead of `mtouch` (#88)
* spouliot/Touch.Unit@b157cf4 Fix a few markdown issues found by markdownlint. (#87)

Diff: d7f55a6167..89afaf7e05

* [dotnet] Document the script that generates the lists of the target platform versions a little bit better.

* [dotnet] Make the [Platform]SupportedTargetPlatform variables public.

This matches how Android and Windows do it:

* https://github.com/xamarin/xamarin-android/pull/5007
* 18ee4eac8b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSupportedTargetPlatforms.props

* [xharness] Update the TargetFramework value when creating project variations.

* [dotnet] Pass the Optimize flags from the extra bundler arguments to the linker configuration. (#9599)

* [dotnet] Pass the Optimize flags from the extra bundler arguments to the linker configuration.

Also call Application.InitializeCommon to initialize the application instance. The
important part here is that InitializeCommon calls Optimizations.Initialize to compute
the default optimizations. It also calls Set*ExceptionMode and sets the default EnableCoopGC
value (so we don't need to call/set those anymore), and it does a few other initialization
tasks which we don't need yet, but eventually will.

And finally remember to parse the bundler arguments before using them in the dotnet
build logic. How did this not cause problems before? 🤦

* [tests] Set the verbosity using the additional args instead of an internal variable.

The internal _BundlerVerbosity variable is overwritten now (with the verbosity
value from the additional args).

* [xharness] Disable tvOS generation for the introspection/.NET test, it incorrect and needs fixing.

* [dotnet-linker] Add OptimizeGeneratedCodeSubStep into the pipeline. (#9608)

Fixes these linkall tests:

    Linker.Shared.OptimizeGeneratedCodeTest
        [FAIL] IsARM64CallingConvention :   optimized: no ldsfld instruction
        Expected: 0
        But was:  1
            at Linker.Shared.BaseOptimizeGeneratedCodeTest.IsARM64CallingConvention() in /Users/rolf/work/maccore/main/xamarin-macios/tests/linker/BaseOptimizeGeneratedCodeTest.cs:line 527

    [FAIL] SetupBlockPerfTest :   At least 6x speedup
        Expected: greater than 6
        But was:  1.0876440665344851d
            at Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlockPerfTest() in /Users/rolf/work/maccore/main/xamarin-macios/tests/linker/BaseOptimizeGeneratedCodeTest.cs:line 120

And linkall is now green for .NET/Debug.

* [xharness] Add support for adding PropertyGroups if none are applicable when adding a property. (#9616)

Some .NET test projects (monotouch-test) require this to set properties for
some test variations, and .NET projects are quite minimal, making it likely
that they won't have a particular property that needs to be set/modified.

This makes it possible to execute the various monotouch-test variations for
.NET in xharness (some of the variations still fail though, so they're still
ignored by default).

* [tests] Ignore a few link sdk tests in .NET for now. (#9614)

There are easier fish to fry right now, so implementing the linker support for
these tests to pass (metadata reduction and code removal) can wait.

This makes the link sdk/Release variation green for .NET.

Ref: https://github.com/xamarin/xamarin-macios/issues/9612
Ref: https://github.com/xamarin/xamarin-macios/issues/9613

* [xharness] The linkall tests are green for .NET/Release now. (#9629)

* [xharness] Skip the 'dont link / AssemblyBuildTarget: SDK framework (release)' variation by default for tvOS. Fixes #xamarin/maccore@2282. (#9659)

This test variation ends up being too big (1.5 GB), so it doesn't install
properly and the app crashes at startup.

So just skip it.

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

* [src] Build the .NET version of our product assemblies using a .NET 5 BCL. (#9637)

* [src] Build the .NET version of our product assemblies using a .NET 5 BCL.

We're not shipping the .NET product assemblies in any stable release, so we
can use a preview version of the .NET 5 BCL.

Also:

* Add all the nuget feeds we need to the top-level NuGet.config, even for .NET
  5/6, there shouldn't be any conflicts with stable feeds since we use exact
  version numbers.

* Generate a top-level global5.json which is copied to every directory that
  needs a .NET 5 global.json (overriding the .NET 3.1 global.json in the root
  directory).

* Use the expected dotnet binary during our local build.

* [tests] Fix the bgen tests to use .NET 5.

* [xharness] Set the current directory to the project directory when running .NET tests.

This way we end up using the dotnet version that's configured in global.json for the tests.

* [xharness] Fix typo in test case creating two identical test cases. (#9702)

* [xharness] Use XmlReaderSettings to ignore stuff we don't care about when parsing xml. (#9703)

At the very least this makes stepping through code while debugging much
faster, since stepping through whitespace and comments is useless.

* [xharness] Fix rendering human-readable results for parameterized tests. Fixes #9400. (#9704)

We weren't probably parsing nested test-suite elements in the xml, so
implement parsing of test-suite elements using recursion, which is easier and
less error-prone (and turns out to work fine too).

Also use TextReader/Writer instead of StreamReader/Writer in a few places.
This makes it easier to write tests, since TextReader/Writer can use in-memory
streams (no need to mess with temporary files).

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

* [dotnet-linker] Add a CollectUnmarkedMembersStep that will keep linked away types around for the static registrar. (#9722)

The static registrar may need access to types that have been linked away, so
store unmarked types so that the static registrar can access them later.

This also makes all the monotouch-test variations green, so enable them all.

Fixes this monotouch-test when all optimizations are enabled:

    MonoTouchFixtures.ObjCRuntime.RegistrarTest
        [FAIL] TestProtocolRegistration :   UIApplicationDelegate/17669
            Expected: True
            But was:  False
                at MonoTouchFixtures.ObjCRuntime.RegistrarTest.TestProtocolRegistration() in xamarin-macios/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs:line 1350

* [xharness] Only run xammac variations if macOS tests are included. (#9729)

This fixes a build error with a xammac test variation that is executed even if
the macOS build is disabled.

* [xharness] The dotnet version of introspection/iOS 10.3 works fine now. (#9728)

* [xharness] Disable iOS 32-bit simulator tests, they don't work on Xcode 12+. (Re)fixes #xamarin/maccore@2284. (#9732)

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

* Undo does changes that ship and we do not want to bring with us.

* Fix issues that do not allow compilation.

* Fix mtouch tests.

* Ignore generated files.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
2020-10-26 16:05:40 -04:00
Rolf Bjarne Kvinge f22e143f1c
[tests] Make the baseline sample test pass the correct environment variables. (#9952)
This makes it so that we use the configured Xcode, and not the default (/Applications/Xcode.app), which may be a symlink, which doesn't work with Xcode 12:

    Tool /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool execution started with arguments: --errors --warnings --notices --output-format xml1 --minimum-deployment-target 8.0 --target-device iphone --target-device ipad --auto-activate-custom-fonts --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk --compilation-directory /Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/obj/iPhone/Debug/ibtool /Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/LaunchScreen.storyboard
             (TaskId:13)
    Tool /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool execution finished (exit code = 134).
             (TaskId:13)
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.854 ibtoold[5120:92020] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-17515.1/DVTFoundation/PlugInArchitecture/DataModel/DVTPlugIn.m:232 [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Details:  Requested but did not find required plug-in with identifier com.apple.rc.RCIDESupportCore [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Object:   <DVTPlugIn: 0x7fe30d129560> [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Method:   -awakeWithPropertyList: [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Thread:   <NSThread: 0x7fe30780acc0>{number = 1, name = main} [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.863 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IBCocoaTouchBuildSupport.PlatformDefinition.MacCatalyst of plug-in com.apple.dt.IDE.IBCocoaBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.863 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IBCocoaBuildSupport.PlatformDefinition.Cocoa of plug-in com.apple.dt.IDE.IBCocoaBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.880 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IBCocoaTouchBuildSupport.PlatformDefinition.CocoaTouch of plug-in com.apple.dt.IDE.IBCocoaTouchBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.880 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IBAppleTVBuildSupport.PlatformDefinition.AppleTV of plug-in com.apple.dt.IDE.IBAppleTVBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.883 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IDEInterfaceBuilder.PlatformDefinition.WatchOS of plug-in com.apple.dt.IDE.IDEInterfaceBuilderWatchKitBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.979 ibtoold[5120:92020] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-17506/InterfaceBuilderKit/Utilities/IBScopedSingletonRegistry.m:45 [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
2020-10-23 16:21:01 +02:00
Rolf Bjarne Kvinge 02ce88fa7f
[xharness] Create device variations for the .NET tests. (#9947)
They're all disabled by default for now, since device builds for .NET hasn't
been implemented yet.
2020-10-22 16:32:14 +02:00
Rolf Bjarne Kvinge 673e20e4b4
[xharness] Make the MSBuildTask capable of building .NET projects. (#9941)
Merge DotNetBuildTask into MSBuildTask to simplify creation of build tasks -
these tasks are very similar, and we instantiate MSBuildTasks in over a dozen
places, and this way we don't have to update every instantiation to check if
an MSBuildTask or a DotNetBuildTask should be created.

The end result is that code that does 'new MSBuildTask (...)' will just work
without updates for .NET projects.
2020-10-22 08:45:14 +02:00
Alex Soto 9d1988a3c8
[tests][xcode12.2] Fix xammac tests (#9935)
* [tests][xcode12.2] Fix xammac tests

* Update tests/common/TestRuntime.cs

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

* [xammac] Avoid multiple #if statements

* [xammac] Fix missing cases amd reduce amount of changes

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-10-21 17:12:48 -04:00
Manuel de la Pena 5595ab78e7
Merge pull request #9933 from mandel-macaque/main-xcode12.1
[Main] Bring Xcode12.1 support.
2020-10-21 07:25:47 -04:00
Rolf Bjarne Kvinge 565003d3a3
[xharness] Give the MSBuild tests 30 more minutes to finish. Fixes #xamarin/maccore@2623. (#9927)
Fixes https://github.com/xamarin/maccore/issues/2326.
2020-10-21 08:56:33 +02:00
Manuel de la Pena 00e25199ae [Main] Bring Xcode12.1 support. 2020-10-20 17:55:31 -04:00
Manuel de la Pena 18963f0983 [Xcode12.1] Bring Xcode12.1 support. 2020-10-20 17:27:14 -04:00
Sebastien Pouliot 67a8e812c6
[storekit] Update for Xcode 12.2 beta 3 (#9930) 2020-10-20 17:15:00 -04:00
Whitney Schmidt de032018aa
add check for xcode12 (#9922) 2020-10-20 14:55:58 -04:00
monojenkins e0ce496804
[xcode12.1] [Tests][Network] Do not really check the value, just make sure that we are called. (#9921) 2020-10-20 09:37:08 -04:00
monojenkins f6f0c76eeb
[Tests][ARKit] Add check for xcode12 (#9923)
Co-authored-by: Whitney Schmidt <whschm@microsoft.com>
2020-10-20 09:36:29 -04:00
monojenkins 5d3db5fde2
[Tests][ARKit] Add check for xcode12 (#9924)
Co-authored-by: Whitney Schmidt <whschm@microsoft.com>
2020-10-20 09:35:53 -04:00
Rolf Bjarne Kvinge 0269d25f79
[xharness] Announce to the world that we're creating UTF8 documents. (#9926)
This makes emojiis in the html report render properly 😁
2020-10-20 14:35:05 +02:00
monojenkins db2d95b155
[xcode12.1] [tests] Fix sample tests to take into account when a platform has been disabled. (#9915)
* [tests] Fix sample tests to take into account when a platform has been disabled.

* [devops] The INCLUDE_MAC/INCLUDE_IOS variables might not exist.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-10-20 08:28:23 +02:00
monojenkins 7d448f1f9e
[xcode12.2] [Tests][Network] Do not really check the value, just make sure that we are called. (#9920)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Whitney Schmidt <whschm@microsoft.com>
2020-10-19 18:08:38 -04:00
Manuel de la Pena 699c1f98fb
[Tests][Network] Do not really check the value, just make sure that we are called. (#9901) 2020-10-19 16:38:32 -04:00
Sebastien Pouliot 9672dc11a9
[fileprovider] Update for Xcode 12.2 beta 3 (#9918)
note: this is not a breaking change (even if it looks like one, even in
API diff) since there is a `[NoMac]` in `d16-8-xm` that was removed (and
never released for XM) in `xcode12`.
2020-10-19 15:50:20 -04:00
Sebastien Pouliot 262872ad5d
[avkit] Update for Xcode 12.2 beta 3 (#9917) 2020-10-19 14:40:49 -04:00
Sebastien Pouliot bd13ea10cb
[xcode12.2][avfoundation] Update for Xcode 12.1 GM (#9913)
same as #9887 with added availability to new platforms and more xtro platform todo resolved
2020-10-19 13:44:21 -04:00
TJ Lambert 369c3f8668
[msbuild] Updating LocalizationStringTest (#9889)
Adding a test to check a specific error code to see if the strings in other locales are translated. This test will be added to the Localization wiki in Maccore accessible to the xamarin-macios team: https://github.com/xamarin/maccore/wiki/Localization
2020-10-19 09:18:30 -05:00
Sebastien Pouliot 3c3229deb3
[xcode12.2][imageio] Update availability and new API from Xcode 12.1 GM (#9907) 2020-10-19 08:03:12 -04:00
Sebastien Pouliot 30c4d90ffa
[xcode12.2][coreimage] Update availability and new API from Xcode 12.1 GM (#9906) 2020-10-19 07:56:29 -04:00
Rolf Bjarne Kvinge 295938bcec
[dotnet] Add support for workloads (#9897)
* Add a `Microsoft.NET.Workload.<platform>` directory which contains
  `WorkloadManifest.json` and `WorkloadManifest.targets` required for the
  workload resolver.
   * For testing, this directory is installed into our local dotnet directory
     (`dotnet/sdk-manifests/5.0.100/Microsoft.NET.Workload.<platform>`).
* Convert `Microsoft.<platform>.Sdk` to an SDK workload pack.
* Replace `Sdk.props` with `AutoImport.props`, and include the default
  inclusion itemgroups definitions from here.
* Split default inclusion logic in two:
   * The itemgroups that import the default items has been moved into a props
     file and included from `AutoImport.props`. They're also conditioned
     based on the TargetPlatformIdentifier.
   * The rest of the logic (to enable default inclusion) is left in the
     .targets file.
* Merge several .props files into .targets files to follow the convention that
  .props files should be loaded before the main csproj, and .targets files
  after (these .props files were loaded after, so to avoid confusion the
  simplest solution was to merge their contents into the applicable .targets
  file and delete the .props files).
* Bundle the workload (WorkloadManifest.json/WorklooadManifest.targets) and
  the sdk + ref packs into an installable macOS pkg (and upload these
  packages).
* Updates tests to import `Microsoft.NET.Sdk` instead of
  `Microsoft.<platform>.Sdk` (this also required a Touch.Unit bump).
* Install the sdk + ref packs into the local dotnet directory (using symlinks
  to our on-disk nuget representation). This is required for local testing.
* Add some documentation.
* Finally fix a couple of bugs that these changes uncovered.

Ref: https://github.com/xamarin/xamarin-android/pull/5195
2020-10-19 10:41:53 +02:00
Sebastien Pouliot b7254af791
[xcode12.2][coregraphics] Update availability wrt Xcode 12.1 GM (#9898) 2020-10-16 18:12:05 -04:00
Sebastien Pouliot 90f5d6af7e
[videotoolbox] Update attributes and add 12.2 specific key (#9905) 2020-10-16 18:08:40 -04:00
Sebastien Pouliot d89cba1d9d
[corebluetooth] Update for Xcode 12.2 beta 3 (#9900) 2020-10-16 15:54:51 -04:00
monojenkins 9d76eb877e
[coretelephony] Update for Xcode 12.1 GM (#9899) 2020-10-16 13:30:28 -04:00
Rolf Bjarne Kvinge 2415902e83
[tests] Put linked source code into an external/ folder in the msbuild test projects. (#9896)
This makes it easier to navigate the projects in the IDE.
2020-10-16 16:29:59 +02:00
Rolf Bjarne Kvinge 693f7a8728 [tests] Fix project reference. 2020-10-16 14:27:57 +02:00
Rolf Bjarne Kvinge 890077adfa [tests] Enable the workload resolver. 2020-10-16 14:27:57 +02:00
Rolf Bjarne Kvinge 062352ccae [tests] Use 'Microsoft.NET.Sdk' instead of 'Microsoft.<platform>.Sdk'. 2020-10-16 14:27:57 +02:00
Rolf Bjarne Kvinge 9da5db37b5 [tests] We don't need to point to our custom packages in global.json anymore, since we'll be using the installed workload. 2020-10-16 14:27:42 +02:00
Rolf Bjarne Kvinge d3042a8829
[tests] Simplify temp file management in the msbuild tests. (#9895)
* Use Cache.CreateTemporaryDirectory everywhere.
* Stop manually deleting temporary files/directories, they'll be deleted automatically.
2020-10-16 14:26:51 +02:00
Sebastien Pouliot 88acbb109b
[imageio] Update bindings up to Xcode 12.1 GM (#9891)
First backport of PR#9793
Then adjustments for Xcode 12.1 GM

Co-authored-by: Alex Soto <alex@alexsoto.me>
2020-10-15 23:01:08 -04:00
Sebastien Pouliot e358d75863
[coregraphics] Update for Xcode 12.1 GM (#9880)
Backport of PR#9828 (xcode12.2) with availability changes.

No need to merge it back into `xcode12.2` (it would conflict) but another
PR will be needed to change `[iOS (14,2)]` to `[iOS (14,1)]` on the new
API

Co-authored-by: Alex Soto <alex@alexsoto.me>
2020-10-15 20:11:54 -04:00
Sebastien Pouliot 5f220b7549
[coreimage] Update for Xcode 12.1 GM (#9886) 2020-10-15 13:53:20 -04:00
Sebastien Pouliot 8497df4c93
[avfoundation] Update for Xcode 12.1 GM (#9887) 2020-10-15 13:07:12 -04:00
Alex Soto dff6934850
[xcode12.2] Initial commit for Xcode 12.2 Beta 3 (#9877)
* [xcode12.2] Initial commit for Xcode 12.2 Beta 3

* Update iOSApiCtorInitTest.cs

* Fix watchOS check on intro for AVSpeechSynthesisVoice

* Update iOSApiCtorInitTest.cs

* Update iOSApiCtorInitTest.cs
2020-10-15 12:08:27 -04:00
Manuel de la Pena 35e78f61dd
[Tests] Fix typo. (#9870) 2020-10-15 11:50:42 -04:00
Sebastien Pouliot a16e29d994
[videotoolbox] Update for Xcode 12.1 GM (#9884) 2020-10-15 11:37:58 -04:00
Sebastien Pouliot 3090eca84d
[tests][intro] Detect cases where [Unavailable] is mis-used (#9871)
For each platform the presence of `[Unavailable]` should mean there are
no other availability (introduced, deprecated or obsoleted) attributes
on the same member.

Also check if the type is unavailable. In that case no member should,
for that platform, have other availability attributes.

Also fix failures - all in WatchKit which was removed from iOS.
2020-10-15 08:57:47 -04:00
Rolf Bjarne Kvinge e92809f38c
[tests] Split the iOS msbuild tests in two. (#9860)
Split the iOS msbuild tests in two:

* Xamarin.MacDev.Tasks.Tests: contains in-process unit tests for tasks.
* Xamarin.MacDev.Tasks: contains larger tests that either invoke targets or a complete
  build. These are currently in-process, but will become out-of-process soon to make
  it possible to run them with dotnet.

Also make the new projects non-iOS-specific, because the macOS msbuild tests will
be moved here as well soon.

There is some duplicated code between these two test projects now (all files
that show up as new are copies of existing files), this will be cleaned up in
later pull requests.
2020-10-15 08:45:43 +02:00
Sebastien Pouliot 714876d55f
[coretelephony] Update for Xcode 12.1 GM (#9878) 2020-10-14 22:22:55 -04:00
Sebastien Pouliot 3a35c2425c
[xcode12.1] Bump for GM (#9876) 2020-10-14 20:06:20 -04:00
monojenkins a72ad286d7
[Tests] Fix a test that crashes on devices due to possible bonjour services present. (#9868)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2020-10-14 15:12:13 -04:00
monojenkins 4804009a65
[Tests] Fix a test that crashes on devices due to possible bonjour services present. (#9869)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2020-10-14 14:52:46 -04:00
Sebastien Pouliot c379544def
[xcode12.2][intro] check for duplicate or inconsistent availability attributes (#9825) (#9856)
This can easily happen when existing type(s) or framework are added to a platform. E.g.

```csharp
[Watch (6,0)][iOS (9,0)]
interface AVFoo {
   [Watch (6,0)][iOS (13,0)]
   void NewMember ();
}
```

Here we have duplicate attributes and, while not confusing, it does mean extra (and non required) metadata into the platform assemblies.

```csharp
[Watch (6,0)][iOS (9,0)]
interface AVFoo {
   [Watch (5,0)][iOS (13,0)]
   void NewMember ();
}
```

Here we declare a member as available when the type is not. I'm not sure how the IDE will react - but this should be audited since one of them is wrong (whatever the IDE behaviour is).

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

Backport of https://github.com/xamarin/xamarin-macios/pull/9825

Includes additional fixes for XM (disabled in `main`)
2020-10-14 13:57:14 -04:00
Rolf Bjarne Kvinge 9cbde483a9
[tests] Set DEVELOPER_DIR when calling xcrun manually. (#9859)
This fixes build problems that may occur when the various versions of Xcode
(system Xcode, VSMac Xcode, '/Applications/Xcode.app' symlink) don't agree on
which Xcode is THE Xcode:

    CustomMetalSmelting:
      Creating directory "bin/iPhone/Debug-unified/monotouchtest.app".
      xcrun -sdk iphoneos metal -c Resources/fragmentShader.metal -o obj/iPhone/Debug-unified//fragmentShader.air -mios-version-min=11.0
      2020-10-14 09:09:03.985 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEWatchSupportUI.ideplugin (com.apple.dt.IDEWatchSupportUI) not present
      2020-10-14 09:09:03.985 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEWatchSupportCore.ideplugin (com.apple.dt.IDEWatchSupportCore) not present
      2020-10-14 09:09:03.985 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IBCocoaTouchBuildSupport.ideplugin (com.apple.dt.IDE.IBCocoaTouchBuildSupport) not present
      2020-10-14 09:09:03.985 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for GPUDebuggerOSXSupport.ideplugin (com.apple.dt.gpu.GPUDebuggerOSXSupport) not present
      2020-10-14 09:09:03.985 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEOSXSupportCore.ideplugin (com.apple.dt.IDE.IDEOSXSupportCore) not present
      2020-10-14 09:09:03.985 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEOSXSupportUI.ideplugin (com.apple.dt.IDE.IDEOSXSupportUI) not present
      2020-10-14 09:09:03.985 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IBAppleTVBuildSupport.ideplugin (com.apple.dt.IDE.IBAppleTVBuildSupport) not present
      2020-10-14 09:09:03.985 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEInterfaceBuilderAppleTVIntegration.ideplugin (com.apple.dt.IDE.IDEInterfaceBuilderAppleTVIntegration) not present
      2020-10-14 09:09:03.985 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEInterfaceBuilderWatchKitIntegration.ideplugin (com.apple.dt.IDE.IDEInterfaceBuilderWatchKitIntegration) not present
      2020-10-14 09:09:03.986 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEInterfaceBuilderWatchKitBuildSupport.ideplugin (com.apple.dt.IDE.IDEInterfaceBuilderWatchKitBuildSupport) not present
      2020-10-14 09:09:03.986 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for GPUDebuggertvOSSupport.ideplugin (com.apple.dt.gpu.GPUDebuggertvOSSupport) not present
      2020-10-14 09:09:03.986 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEAppleTVSupportUI.ideplugin (com.apple.dt.IDEAppleTVSupportUI) not present
      2020-10-14 09:09:03.986 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEAppleTVSupportCore.ideplugin (com.apple.dt.IDEAppleTVSupportCore) not present
      2020-10-14 09:09:03.986 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for DVTAppleTVSupportCore.dvtplugin (com.apple.dt.DVTAppleTVSupportCore) not present
      2020-10-14 09:09:03.986 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for GPUDebuggeriOSSupport.ideplugin (com.apple.dt.gpu.GPUDebuggeriOSSupport) not present
      2020-10-14 09:09:03.986 xcodebuild[59510:1676867] [MT] DVTPlugInManager: Required plug-in compatibility UUID C80A9C11-3902-4885-944E-A035869BA910 for IDEiOSPlatformSupportCore.ideplugin (com.apple.dt.IDEiOSPlatformSupportCore) not present
      2020-10-14 09:09:04.081 xcodebuild[59510:1676867] [MT] DVTPlatform: Required content for platform watchOS is missing.
      Domain: DVTFoundationErrorDomain
      Code: 4
      Recovery Suggestion: Please reinstall Xcode.
      --
      No Xcode.DVTFoundation.ExtendedPlatformInfo extension found for platform with identifier com.apple.platform.watchos
      Domain: DVTExtendedPlatformInfoErrorDomain
      Code: 2
      --
    xcodebuild : error : Initialization failed. [[...]/xamarin-macios/tests/monotouch-test/monotouch-test.csproj]
      	Reason: Required content for platform watchOS is missing.
    xcrun : error : sh -c '/Applications/Xcode_11.7.0.app/Contents/Developer/usr/bin/xcodebuild -sdk iphoneos -find metal 2> /dev/null' failed with exit code 17920: (null) (errno=No such file or directory) [[...]/xamarin-macios/tests/monotouch-test/monotouch-test.csproj]
    xcrun : error : unable to find utility "metal", not a developer tool or in PATH [[...]/xamarin-macios/tests/monotouch-test/monotouch-test.csproj]
    [...]/xamarin-macios/tests/monotouch-test/monotouch-test.csproj(385,5): error MSB3073: The command "xcrun -sdk iphoneos metal -c Resources/fragmentShader.metal -o obj/iPhone/Debug-unified//fragmentShader.air -mios-version-min=11.0" exited with code 72.
2020-10-14 19:19:00 +02:00
Rolf Bjarne Kvinge e707fb691c
[dotnet] Remove workaround for mono/linker#1435, which has now been fixed. (#9863) 2020-10-14 15:13:46 +02:00
Manuel de la Pena ebc81460c9
[monotouch-test] Don't assert any specific value for the ReusedConnection value in UrlSessionTaskTransactionMetricsTest. Fixes #xamarin/maccore@2281. (#9660) (#9854)
Fixes https://github.com/xamarin/maccore/issues/2281.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-10-13 15:11:56 -04:00
Sebastien Pouliot 11aafadd86
[intro] check for duplicate or inconsistent availability attributes (#9825)
This can easily happen when existing type(s) or framework are added to a platform. E.g.

```csharp
[Watch (6,0)][iOS (9,0)]
interface AVFoo {
   [Watch (6,0)][iOS (13,0)]
   void NewMember ();
}
```

Here we have duplicate attributes and, while not confusing, it does mean extra (and non required) metadata into the platform assemblies.

```csharp
[Watch (6,0)][iOS (9,0)]
interface AVFoo {
   [Watch (5,0)][iOS (13,0)]
   void NewMember ();
}
```

Here we declare a member as available when the type is not. I'm not sure how the IDE will react - but this should be audited since one of them is wrong (whatever the IDE behaviour is).

Fix https://github.com/xamarin/xamarin-macios/issues/6856
2020-10-13 14:16:33 -04:00
Rolf Bjarne Kvinge 86cb7468b9
[tests] Fix ignoring dotnet tests when certain platforms have been disabled. (#9851)
Fixes an issue where some of the non-macOS dotnet tests where ignored because
the logic to disable the macOS ones were incorrect.
2020-10-13 17:55:20 +02:00
Filip Navara 0c0662c46f
[dotnet] Remove workaround for F# projects (#9845)
Contributes to #8901. Issue dotnet/sdk#12954 was marked as fixed, the dotnet version was recently bumped to one that should contain the fix.
2020-10-13 09:21:33 +02:00
Rolf Bjarne Kvinge 80db37dca7
[msbuild] Set DEVELOPER_DIR to the Xcode we're using when calling ibtool. (#9836)
* [msbuild] Set DEVELOPER_DIR to the Xcode we're using when calling ibtool.

This fixes strange problems that occur when the system Xcode isn't the same as
the Xcode configured in Visual Studio for Mac, because we'd end up directly
launching VSMac's Xcode's ibtool, which would end up confused because it
wasn't the system ibtool.

Setting DEVELOPER_DIR tells VSMac's Xcode's ibtool that it's the system's ibtool.

* [msbuild] Set IBToolTask.SdkDevPath from the tests as well.

It's already set in the .targets files.
2020-10-13 09:15:04 +02:00
Alex Soto 2a6320ba55
[tests] Fix macOS 11 intro/apitest (#9844)
* 'GKGameCenterViewController' init throws on macOS 11 and makes sense
  to remove the DefaultCtor since it has other init methods that
  should be used instead. Added XAMCORE_4_0 removal.

* 'ModelIO' seems to be broken in macOS 11.0, if you touch several
  types you end up getting some C++ errors

* 'CoreSpotlight.CSLocalizedString' crashes in Xcode 12.0 GM and now
  in Xcode 12.2 Beta 2 on macOS.

Added issues to check for future betas/GM here #9744
2020-10-12 13:37:22 -04:00
Alex Soto cb524b13a8
[introspection] Do not let intro check on QTKit now that is just stubs (#9843)
* [introspection] Do not let intro check on QTKit now that is just stubs

* Update ApiCtorInitTest.cs

* [QTKit] Fix more QT Tests

* Remove some more QT leftovers
2020-10-11 14:43:41 -04:00
monojenkins 3924a30c4b
[AppKit] Allow NSGraphicsContext.CurrentContext to be null (#9842)
- Fixes https://github.com/xamarin/xamarin-macios/issues/9827

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2020-10-09 15:33:37 -05:00
Chris Hamons 05303cfec3
[AppKit] Allow NSGraphicsContext.CurrentContext to be null (#9838)
- Fixes https://github.com/xamarin/xamarin-macios/issues/9827
2020-10-09 13:44:34 -05:00
Rolf Bjarne Kvinge 54a553a900
[dotnet] Add storyboards and xibs to the our items included by default. (#9834) 2020-10-09 18:24:45 +02:00
Rolf Bjarne Kvinge 9ade64930f
[msbuild] Move all the msbuild tests to tests/msbuild to put all the tests together. (#9824)
* [msbuild] Move msbuild/tests to tests/msbuild to put all the tests together.

* [tests] Move test projects for Xamarin.Mac to tests/common/TestProjects

* [tests] Move test projects for Xamarin.iOS to tests/common/TestProjects
2020-10-09 16:06:19 +02:00
Alex Soto 1efee685f9
[CoreGraphics] Update bindings to Xcode 12.2 Beta 2 (#9828) 2020-10-09 06:34:00 -04:00
Alex Soto ef7515d190
[Foundation] Update up to Xcode 12.2 Beta 2 (#9826)
* [Foundation] Update up to Xcode 12.2 Beta 2

* Update src/foundation.cs
2020-10-09 06:32:52 -04:00
Rolf Bjarne Kvinge 4b5be94592
[msbuild] Add SceneKit assets to our items included by default. (#9798)
* [msbuild] Add SceneKit assets to our items included by default.

There's a minor wrinkle here: we need to calculate the virtual path of the
SceneKit items (relative to the project), but for items included by default
their defining project is not the user's project, but our
Xamarin.Shared.Sdk.DefaultItems.targets file.

The solution is to add metadata for items included by default
('IsDefaultItem'), and if that's found when we calculate the virtual path, use
the executable project to calculate the virtual path, instead of the project
that defined the SceneKit items.

* [msbuild] Use a different temporary directory based on the platform.
2020-10-09 08:31:52 +02:00
Sebastien Pouliot c5a43ac2b7
[oslog] New framework in macOS 11 (#9820)
Fix https://github.com/xamarin/xamarin-macios/issues/9480
2020-10-08 16:33:03 -04:00
Alex Soto 340ab9f8cb
[HealthKit] Update bindings up to Xcode 12.2 Beta 2 (#9822) 2020-10-08 15:54:48 -04:00
Sebastien Pouliot 030e1476cd
[xcode12.2][qtkit] Stub removed API. Fix #7704 (#9815)
Xamarin.Mac only supports 64 bits - since the supported macOS and
Xcode have dropped 32bits last year.

QTKit headers were removed but we still had bindings code generated
and kept to avoid braking changes.

This is now replaced by stubs, which are a smaller (no code and less
metadata).

```
Current Xamarin.Mac.dll 23,990,784 bytes
QTKit-stubbed XM.dll    23,843,840 bytes
Difference                 146,944 bytes
```

reference: https://github.com/xamarin/xamarin-macios/issues/7704
2020-10-08 14:22:38 -04:00
Sebastien Pouliot 8c174308c2
[photos] Update for Xcode 12.2 beta 2 (#9813) 2020-10-08 08:04:42 -04:00
Alex Soto d3d278e367
[CoreFoundation] Update bindings up to Xcode 12.2 Beta 2 (#9720)
* [CoreFoundation] Update bindings to Xcode 12.2

* Fix NRE

* Add tests for manual API

* Oops, fix spacing
2020-10-08 06:38:38 -04:00
Sebastien Pouliot 97b25bb56f
[security] Update for Xcode 12.2 beta 2 (#9812) 2020-10-07 21:45:10 -04:00
Sebastien Pouliot 95c929e487
[mlcompute] Update for Xcode 12.2 beta 2 (#9806) 2020-10-07 20:25:17 -04:00
monojenkins fc158cb67d
correct the nullability attributes for the Photos framework (#9805)
Co-authored-by: Ryan Pendleton <me@ryanp.me>
2020-10-07 16:51:55 -04:00
Alex Soto afa9f62ce0
[VideoSubscriberAccount] Update bindings up to Xcode 12.2 Beta 2 (#9794) 2020-10-07 11:53:56 -04:00
Sebastien Pouliot 9f78daee75
[xcode12.2][tests][xtro] Add enum member/values checks. Fix #7527 (#9691) (#9796)
Figure out if
* we're missing enum values (easy to workaround, but annoying for developers)
* we expose enum values that are not defined natively (potential bugs)

reference: https://github.com/xamarin/xamarin-macios/issues/7527

backport of #9691 with additional macOS and xcode12.2 fixes
2020-10-07 10:58:27 -04:00
Rolf Bjarne Kvinge dd97579e3a
[msbuild] Share the *CompileCoreMLModels targets between Xamarin.iOS and Xamarin.Mac. (#9792)
Xamarin.Mac didn't have support for CoreML models before, so this effectively adds
support for CoreML models to Xamarin.Mac.

Also add a test to make sure it actually works.
2020-10-07 08:42:17 +02:00
Alex Soto 01540ae5e0
[ImageIO] Update bindings up to Xcode 12.2 Beta 2 (#9793)
* [ImageIO] Update bindings up to Xcode 12.2 Beta 2

* Remove not needed case
2020-10-06 14:45:52 -04:00
Alex Soto 0ccb75f0d3
[FileProvide] Update bindings up to Xcode 12.2 Beta 2 (#9791) 2020-10-06 12:38:47 -04:00
Rolf Bjarne Kvinge 8bf4e0e5e6
[tests] Fix sample tests to take into account when a platform has been disabled. (#9774)
* [tests] Fix sample tests to take into account when a platform has been disabled.

* [devops] The INCLUDE_MAC/INCLUDE_IOS variables might not exist.
2020-10-06 17:33:03 +02:00
Alex Soto 73778ebe60
[CoreImage] Update bindings up to Xcode 12.2 Beta 2 (#9790) 2020-10-06 09:52:19 -04:00
Alex Soto 82215f8d94
[CarPlay] Update bindings to Xcode 12.2 Beta 2 (#9788) 2020-10-06 08:21:51 -04:00
Sebastien Pouliot 0922f354fe
[generator] Fix potential warnings/errors when `[Sealed]` is used on types. Fix #9065 (#9782)
Fix build warnings
```
build/mac/mobile/ReplayKit/RPScreenRecorder.g.cs(113,22): warning CS0628: 'RPScreenRecorder.RPScreenRecorder(IntPtr)': new protected member declared in sealed class
build/mac/full/ReplayKit/RPScreenRecorder.g.cs(113,22): warning CS0628: 'RPScreenRecorder.RPScreenRecorder(IntPtr)': new protected member declared in sealed class
```
which still happens even if we disable XM in `main` :|

Added generator test based on Whitney's test case from github issue

ref: https://github.com/xamarin/xamarin-macios/issues/9065
2020-10-05 22:01:36 -04:00
monojenkins 89a36cf511
[xcode12.2] [tests][xtro] Check for missing/extra [Appearance]. Fix #7136 (#9785)
based on the header's `UI_APPEARANCE_SELECTOR` decorations

Fix https://github.com/xamarin/xamarin-macios/issues/7136
2020-10-05 21:58:59 -04:00
monojenkins 6018db4d39
[xcode12.2] [tests][xtro] Consider class (static) methods when checking for deprecation. Fix #9026 (#9781)
ref: https://github.com/xamarin/xamarin-macios/issues/9026
2020-10-05 16:00:51 -04:00
Sebastien Pouliot d7f8825119
[tests][xtro] Add enum member/values checks. Fix #7527 (#9691)
Figure out if
* we're missing enum values (easy to workaround, but annoying for developers)
* we expose enum values that are not defined natively (potential bugs)

reference: https://github.com/xamarin/xamarin-macios/issues/7527
2020-10-05 15:57:18 -04:00
monojenkins 3b36acecba
[tests][cecil] Check that error-based enum values don't have availability attributes (#9780)
and fixes the ones that have some.

From https://github.com/xamarin/xamarin-macios/issues/9724

We do not _normally_ add availability attributes on enums **members** that represent error codes. In part because it's a lot of metadata and, foremost, because it's not really helpful to write code. E.g.

```csharp
var err = Call.Api (1);
switch (err) {
case NSError.Bad:
case NSError.Wrong:
   Console.WriteLine ($"API failed: {err});
   break;
case NSError.Ok:
   break;
default:
   Console.WriteLine ($"Unknown error code {err}");
   break;
}
```

Adding version checks inside this would be complicated (source wise) and not really helpful since
* API can return undefined error code (and the error logic should work);
* Availability information is not 100% accurate;

As such we default to not add them - but we some time forgot about it. An intro rule could easily ensure we don't add them needlessly.
2020-10-05 10:37:54 -04:00
Sebastien Pouliot 9e192d1eff
[xcode12.2][tests][xtro] Check for deprecated p/invokes (C API) (#9773)
We already had support for ObjC API but nothing reported missing
availability attributes for p/invokes, used in manual bindings

Backport of #9700 which adds fixes for missing [Deprecated] inside Xamarin.Mac.dll
2020-10-05 08:12:45 -04:00
Alex Soto 5deee9ea95
[xcode12.2] Initial bump to Xcode 12.2 Beta 2 (#9730)
* [xcode12.2] Initial bump to Xcode 12.2 Beta 2

* Add tvOS specific checks for exact Xcode check
2020-10-02 18:33:38 -04:00
Sebastien Pouliot 144f926cea
[tests][xtro] Check for missing/extra [Appearance]. Fix #7136 (#9765)
based on the header's `UI_APPEARANCE_SELECTOR` decorations

Fix https://github.com/xamarin/xamarin-macios/issues/7136
2020-10-02 13:51:55 -04:00
Sebastien Pouliot 0093925e74
[xcode12.2][tests][cecil] Check for absence of `[NoX]` (Unavailable) in platform assemblies. Fix #4835 (#9771)
It's way too easy to forget that attributes like `[NoiOS]` means the code
is not generated (for bindings) on that platform but that they will be
compiled for _manual_ bindings (not run thru the generator).

This can expose types (and API) that are not usable on some platforms.
This new test checks that the `[No*]` and `[Unavailable]` attributes
are not in their respective platform assemblies.

For compatibility (existing mistakes) we ignore the check on API that
are decorated with `[Obsolete]` attributes.

Changes in the bindings are fix such mistakes - mostly adding the
`[Obsolete]` attribute.

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

backport of https://github.com/xamarin/xamarin-macios/pull/9686
2020-10-02 10:33:59 -04:00
Sebastien Pouliot 63e3744c70 [tests][intro] ConstantsCheck should only be executed on latest OS (#9751)
since the files, mapped by the constants, might not be present in earlier
versions of the OS. We can only be sure, of their presence, on the
current/supported SDK version

Fix intro running on iOS 10.3 (64 bits)

```
Introspection.iOSApiTypoTest
    [PASS] AttributeTypoTest
    [FAIL] ConstantsCheck :   NetworkLibrary
  Expected: True
  But was:  False
 :   at Introspection.ApiTypoTest.ConstantsCheck () [0x00168] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiTypoTest.cs:1088
```
2020-10-01 22:38:06 -04:00
Sebastien Pouliot 1e5801c930 [tests][intro] Split attributes typos from API typos tests (#9652)
The latter requires the spellchecker which varies by OS versions, so we
only run it on the latest OS version (and simulator, except macOS).

The former are some internal rules and can be run on every commit and
avoid finding issues late in a release cycle.

Also changed to
- process members even if a type is obsoleted
- process the properties and events on types

About the strings...

Some were fine, others were not. Copy/pasted strings are hard to
maintain. Moving them to constants will help, both maintainability and
will reduce the metadata size of the platform assemblies.

ref: https://github.com/xamarin/xamarin-macios/issues/9353
2020-10-01 22:37:54 -04:00
Sebastien Pouliot 2b6eb8438a
[tests][intro] ConstantsCheck should only be executed on latest OS (#9751)
since the files, mapped by the constants, might not be present in earlier
versions of the OS. We can only be sure, of their presence, on the
current/supported SDK version

Fix intro running on iOS 10.3 (64 bits)

```
Introspection.iOSApiTypoTest
    [PASS] AttributeTypoTest
    [FAIL] ConstantsCheck :   NetworkLibrary
  Expected: True
  But was:  False
 :   at Introspection.ApiTypoTest.ConstantsCheck () [0x00168] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiTypoTest.cs:1088
```
2020-10-01 22:30:04 -04:00
Alex Soto 94dc5ebd5d
[CarPlay] Update bindings to Xcode 12.2 Beta 1 (#9719)
* [CarPlay] Update bindings to Xcode 12.2 Beta 1

CPEntity docs got removed https://developer.apple.com/documentation/carplay/cpentity
so it is very likely that Apple will keep this out from the API.

* Better obsolete and hide it from autocompletion

* Fix

* Ups I broke it again...

* Apply feedback
2020-10-01 15:22:45 -04:00
Manuel de la Pena 2c78255dbe
[Metal][Generator] Fix the SetBuffers methods in protocols. Fixes #9649 (#9651)
Add fixes for Metal for XAM_CORE_4. Fixing the methods takes us to a dangerous path, so we do not do it unless we have issues about the methods.

Fixes https://github.com/xamarin/xamarin-macios/issues/9649
2020-10-01 14:27:55 -04:00
Sebastien Pouliot 3cb3d60e2b
[tests][xtro] Consider class (static) methods when checking for deprecation. Fix #9026 (#9743)
ref: https://github.com/xamarin/xamarin-macios/issues/9026
2020-10-01 08:02:09 -04:00
Ryan Pendleton bcfbed9ae6
[Photos] Correct nullability attributes for the Photos framework (#9740) 2020-10-01 08:42:44 +02:00
Rolf Bjarne Kvinge 82be630003
[tests] Set the build environment when cleaning project as well in the mac msbuild tests. (#9739)
This way we don't depend on having a system install of Xamarin.Mac.
2020-10-01 08:42:05 +02:00
Rolf Bjarne Kvinge 49f03c13fd
[tests] Fix a couple of typos. (#9736) 2020-10-01 08:41:01 +02:00
Rolf Bjarne Kvinge 0293ae5153
Revert "[introspection] Adapt to .NET 5's vision of how ConstructorInfo.ToString () should behave." (#9738)
This reverts commit f69ed9a25e.

This is now fixed in .NET.
2020-10-01 08:38:21 +02:00
Rolf Bjarne Kvinge 8876444586
[msbuild] Share the _*CompileSceneKitAssets targets between Xamarin.iOS and Xamarin.Mac. (#9735)
The Xamarin.iOS version is more updated, so that's the version now for both
Xamarin.iOS and Xamarin.Mac:

* The iOS version contains Inputs/Outputs (important for incremental builds).
* It doesn't use FileWrites (see e97d69b25c why
  this was removed for iOS)

Additionally define the _SceneKitCache variable for macOS as well, previously
it was only defined for iOS (I'm adding more variables than just
_SceneKitCache to macOS, most of the others will be used in in macOS in
upcoming pull requests, and this way turned out to be simplest).

And also add a new Xamarin.Mac test that exercises the CompileSceneKitAssets targets.
2020-10-01 08:37:52 +02:00
Manuel de la Pena c72f27f939
[Viso] Clean xtro files. (#9747) 2020-10-01 00:35:04 -04:00
Sebastien Pouliot e343e68725
[tests][cecil] Check that error-based enum values don't have availability attributes (#9737)
and fixes the ones that have some.

From https://github.com/xamarin/xamarin-macios/issues/9724

We do not _normally_ add availability attributes on enums **members** that represent error codes. In part because it's a lot of metadata and, foremost, because it's not really helpful to write code. E.g.

```csharp
var err = Call.Api (1);
switch (err) {
case NSError.Bad:
case NSError.Wrong:
   Console.WriteLine ($"API failed: {err});
   break;
case NSError.Ok:
   break;
default:
   Console.WriteLine ($"Unknown error code {err}");
   break;
}
```

Adding version checks inside this would be complicated (source wise) and not really helpful since
* API can return undefined error code (and the error logic should work);
* Availability information is not 100% accurate;

As such we default to not add them - but we some time forgot about it.
2020-09-30 15:15:18 -04:00
Rolf Bjarne Kvinge 24795d1306
[tests] Simplify ProjectTestHelpers.FindRootDirectory by re-using existing code. (#9734) 2020-09-30 19:12:54 +02:00
Rolf Bjarne Kvinge f4832392d7
[tests] Remove duplicated code to set the requirement environment variables for building locally. (#9733) 2020-09-30 19:09:55 +02:00
Rolf Bjarne Kvinge 3f0cac77b7
[xharness] Disable iOS 32-bit simulator tests, they don't work on Xcode 12+. (Re)fixes #xamarin/maccore@2284. (#9732)
Fixes https://github.com/xamarin/maccore/issues/2284.
2020-09-30 18:11:10 +02:00
Sebastien Pouliot 4a050c5ae6
[tests][xtro] Check for deprecated p/invokes (C API) (#9700)
We already had support for ObjC API but nothing reported missing
availability attributes for p/invokes, used in manual bindings
2020-09-30 09:57:37 -04:00
Sebastien Pouliot 11cec5096a
[tests][cecil] Check for absence of `[NoX]` (Unavailable) in platform assemblies. Fix #4835 (#9686)
It's way too easy to forget that attributes like `[NoiOS]` means the code
is not generated (for bindings) on that platform but that they will be
compiled for _manual_ bindings (not run thru the generator).

This can expose types (and API) that are not usable on some platforms.
This new test checks that the `[No*]` and `[Unavailable]` attributes
are not in their respective platform assemblies.

For compatibility (existing mistakes) we ignore the check on API that
are decorated with `[Obsolete]` attributes.

Changes in the bindings are fix such mistakes - mostly adding the
`[Obsolete]` attribute.

Fix https://github.com/xamarin/xamarin-macios/issues/4835
2020-09-30 07:56:48 -04:00
Sebastien Pouliot 3e14650b6e
[tests][intro] Split attributes typos from API typos tests (#9652)
The latter requires the spellchecker which varies by OS versions, so we
only run it on the latest OS version (and simulator, except macOS).

The former are some internal rules and can be run on every commit and
avoid finding issues late in a release cycle.

Also changed to
- process members even if a type is obsoleted
- process the properties and events on types

About the strings...

Some were fine, others were not. Copy/pasted strings are hard to
maintain. Moving them to constants will help, both maintainability and
will reduce the metadata size of the platform assemblies.

ref: https://github.com/xamarin/xamarin-macios/issues/9353
2020-09-30 07:53:48 -04:00