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

9760 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge e9f0b1f8e6 [msbuild] Implement support for Mac Catalyst 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 2b5723067c [tools] Catalyst apps require Xcode header files in the same circumstances as other Xamarin.iOS platforms.
When linking is disabled.
2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 5f0fc5858f [tools] Catalyst apps are never build for device (just like macOS apps) 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 3556b8468d [tools/bgen] Catalyst is a part of Xamarin.iOS, so use '_ios-build' and 'MD_MTOUCH_SDK_ROOT' 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 4389e19a06 [tools] Add MacCatalyst to our list of platforms 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 716e395ea4 [tools] Catalyst apps must specify their target ABI(s)
No assumptions makes it easier down the road when we're adding support for ARM64.
2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 76da5c461e [tools] Add support for Catalyst frameworks.
The list of Catalyst frameworks is close to the iOS frameworks, so clone the list
of iOS frameworks and then just modify that list.
2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 8b2c3bdd6f [tools] Add an 'Unavailable' property to each framework and check it whenever needed.
Also emit a warning whenever we run into an unavailable framework.
2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge ff950f7a1f [mtouch] Our native catalyst bits are in the Xamarin.MacCatalyst.sdk directory. 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 78ff0ee892 Add a Xamarin.MacCatalyst target framework identifier. 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 731094006c [mtouch] Make the full path to the Info.plist dependent on the target platform.
Because for Catalyst it's in the same place as for macOS; in the Contents/ subdirectory
in the app.
2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 38eca9806a [runtime] Look for files in the Contents/MonoBundle directory for catalyst apps. 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 25ed862e34 [msbuild] Catalyst uses the macOS certificates and profiles for codesigning. 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 1b88ce5294 [msbuild] Apple uses 'macosx' as the platform identifier for catalyst in their toolchain. 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge f3ed478c1d [mtouch] Symbols are always required for catalyst apps.
In this case we're like iOS simulator builds: symbols may not be required under a
few circumstances, one of which is AOT compilation, which doesn't happen for catalyst
apps, thus symbols are always required for catalyst apps.
2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge f48991fadd [mtouch] The executable path in the app is in the Contents/MacOS subdirectory (just like for macOS apps) 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 17e5519692 [mtouch] We don't AOT compile anything for catalyst apps. 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 0527c8b4fd [msbuild] Catalyst uses 'LSMinimumSystemVersion' as the minimum OS version key. 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge b1c3d571d6 [runtime] Build our runtime for Catalyst. 2020-12-03 10:42:25 +01:00
Rolf Bjarne Kvinge 9edb9e2885 [tests] Add test project 2020-12-03 10:42:25 +01:00
Rolf Bjarne Kvinge 9327af6960 [runtime] Put MonoTouchDebugConfiguration.txt in the app resources directory.
This is required for Catalyst apps, since no custom files can be in the root directory
for apps on macOS.
2020-12-03 10:42:25 +01:00
Rolf Bjarne Kvinge 14f89da787 [builds] Install the Mac Catalyst BCL assemblies 2020-12-03 10:42:25 +01:00
Rolf Bjarne Kvinge 0a2d8f3e5f [builds] Install the catalyst libraries from the mono archive 2020-12-03 10:42:25 +01:00
Rolf Bjarne Kvinge 03e010c747 Bump mono to a version that ships catalyst binaries and download those binaries.
New commits in mono/mono:

* mono/mono@dfbfe5eed1 [2020-02] Build makefile to support Mac Catalyst (#20566)

Diff: ac596375c7..dfbfe5eed1
2020-12-03 10:42:25 +01:00
Rolf Bjarne Kvinge 14e3282781
[msbuild] Unify the _GetCompileToNativeInputs target between iOS and Mac. (#10189)
* Add a stamp file to the Mac version of _CompileToNative. This is used to
  force a rebuild of the container app when an app extension changes (and was
  already implemented for iOS: 8b376efa4b)
* Rename the iOS stamp file to 'bundler.stamp' instead of 'mtouch.stamp' to
  ease code sharing.
* Rename the 'MmpReferencePath' and 'MTouchReferencePath' properties to
  '_BundlerReferencePath' to ease code sharing.
* Merge the _GetCompileToNativeInputs targets. The only difference between iOS
  and Mac (after the above changes) is that the Mac version now includes
  '@(ReferencePath)' in '_CompileToNativeInput'. This should be fine as far as
  I know.
2020-12-03 08:12:18 +01:00
Manuel de la Pena b4c549f5a8
[VSTS] If we fail dumping the env, continue. (#10193) 2020-12-02 18:50:55 -05:00
Rolf Bjarne Kvinge 7251902439
[bgen] Use ErrorHelper.Verbosity to store the verbosity to avoid storing it in multiple places with different values (#10175)
This avoids some code using one value, and other code using another value.,
and things don't quite work as expected.

In particular it makes it so that passing -v to bgen makes errors show the
stack trace of the corresponding exception.
2020-12-01 11:34:47 +01:00
Rolf Bjarne Kvinge ad20f375c7
[src] Generate a define for each framework for every platform. (#10171)
* [src] Generate a define for each framework for every platform.

Take our list of frameworks per platform, and generate a list of conditional
compiler constants that states that a framework exists for a particular
platform.

Basically generate a list of `-d:HAS_<FRAMEWORK>` for each platform.

This makes it possible to do this:

   #if HAS_COREMEDIA
   using CoreMedia;
   #endif

instead of this:

   #if (PLATFORM1 || PLATFORM2) && !PLATFORM3 || PLATFORM4 || BUT_MAYBE_IF_ITS_FRIDAY
   using CoreMedia;
   #endif

Which makes it much easier when adding new platforms (say Mac Catalyst), or
when a framework is added to an already existing platform.

I've included a few examples of how it would end up looking. Changing all the
code to use these new defines is not the goal (nor is it that these defines
should always be used: sometimes they make most sense, sometimes they don't).

* Use the new defines when building OpenTK-1.0.dll as well.
2020-12-01 11:14:32 +01:00
Filip Navara 56a5432bdf
[dotnet] Avoid double registration of static registrar (#10185) 2020-12-01 08:11:36 +01: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
Rolf Bjarne Kvinge fc34b93cc5
[MetricKit] Don't use deprecated API to check system version. (#10180)
It won't work on platforms that don't have these deprecated API (Mac Catalyst).
2020-11-30 16:14:35 +01:00
Sebastien Pouliot 546cf748dd
[accounts] Add nullability for manual bindings (#10161)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-11-30 09:55:07 -05:00
Rolf Bjarne Kvinge d703b86ec4
[msbuild] Remove unnecessary validation of the SdkPlatform. (#10174)
The platform is already validated in many other places.
2020-11-30 13:38:39 +01:00
Rolf Bjarne Kvinge afaa13d845
[src] Improve the generate-frameworks.csharp script. (#10176)
* [src] Add exception handling to generate-frameworks.csharp.

Because an unhandled exception doesn't make 'csharp' return a non-zero exit
code.

* [src] Pass -s to csharp in generate-frameworks.csharp and improve argument handling a bit.

* Pass -s to csharp so that csharp can properly distinguish script files (any
  argument until -s) from normal arguments).
* Improve argument handling a bit.

* [src] Pass the output as the first argument to generate-frameworks.csharp

* [src] Use temporary file to make sure the target is rebuilt if there's a problem.
2020-11-30 07:45:27 +01:00
Rolf Bjarne Kvinge 1ffabceb09
[src] Reintroduce namespaces as constants to simplify code. (#10173)
It's not necessary to have logic to compute namespaces anymore, that died with
Xamarin.iOS/Classic mode. So simplify the code to use constant values instead.

I hoped this would speed up the build a little bit, but I wasn't able to
measure any significant difference.
2020-11-30 07:44:53 +01: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
Sebastien Pouliot e7d7e19bde
[assetslibrary] Add nullability for manual bindings (#10160)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-11-26 11:24:16 -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 5111d30816
[avkit] Add nullability for manual bindings (#10150)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-11-25 20:40:04 -05:00
Sebastien Pouliot 3125f7ad73
[tests] Remove empty xtro files (#10157) 2020-11-25 14:15:47 -05:00
Sebastien Pouliot ee6bf18181
Bump Touch.Unit to get rid of warnings (#10156)
Commit list for spouliot/Touch.Unit:

* spouliot/Touch.Unit@a94d56e Fix C# compiler CLS-compliant warnings (#95)

Diff: f8768d99ef...a94d56ee10
2020-11-25 11:25:20 -05:00
Rolf Bjarne Kvinge 691721a9dc
[msbuild] Default to verbose logs for mmp/mtouch if creating a binary log. (#10147)
This way we get the full output from mtouch/mmp when the user creates a binary log.
2020-11-25 15:09:21 +01:00
Sebastien Pouliot 5242a14d4a
[arkit] Add nullability for manual bindings (#10088)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-11-24 17:29:39 -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
Rolf Bjarne Kvinge 9c094ee87f
[tools] Set xamarin_executable_name in main for macOS .NET apps. (#10124)
* [tools] Set xamarin_executable_name in main for macOS .NET apps.

This regressed while macOS was disabled in main.

* Fix according to review.
2020-11-24 07:52:35 +01:00
Rolf Bjarne Kvinge e241277705
[src] Don't generate a reference assembly for both the 32-bit and 64-bit variant of Xamarin.WatchOS.dll. (#10136)
* [src] Don't generate a reference assembly for both the 32-bit and 64-bit variant of Xamarin.WatchOS.dll.

We only need one version, and in any case the code would write both the same
file, causing corruption and random build problems later.

Fixes this problem while building .NET packages:

    /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/dotnet/package/common.csproj(75,5): error : Classification matches no files: Xamarin.WatchOS.dll [/Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/dotnet/package/Microsoft.watchOS.Ref/package.csproj]
    make[1]: *** [nupkgs/Microsoft.watchOS.Ref.7.1.100-ci.main.35+sha.a4a1fea86.nupkg] Error 1

* Fix the make rule too so that it doesn't claim it can generate the reference assembly.
2020-11-23 17:30:53 +01: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
Rolf Bjarne Kvinge adb566e408
[runtime] Simplify code for custom mono bundle name a bit by using a default value for the 'xamarin_custom_bundle_name' variable. (#10130) 2020-11-23 08:30:08 +01:00
Rolf Bjarne Kvinge 945bd5c4b5
[dotnet] Don't link the main executable with any dylibs on macOS. (#10127)
Don't link the main executable with any dylib (except libcoreclr) on macOS,
because that may end up running library initializers in those dylibs, and they
may abort if something goes wrong.

This way we delay any failures until those dylibs are actually needed.

In particular, libSystem.Security.Cryptography.Native.OpenSsl.dylib will abort
in its library initializer if it can't find the native libssl.dylib it wants:
1d9e50cb47/src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.c (L122-L126)
and my system doesn't have any of the libssl.dylib versions that code wants.
2020-11-23 08:27:47 +01:00
Rolf Bjarne Kvinge 75979ca400
[tools] Disable Objective-C exception handling for macOS .NET apps due to a missing feature in the runtime. (#10123)
* [tools] Disable Objective-C exception handling for macOS .NET apps due to a missing feature in the runtime.

We need support for dllmaps, and that isn't working on macOS yet.

* Fix to only affect .NET
2020-11-23 08:05:35 +01:00