xamarin-macios/tests/dotnet/ExtensionConsumer
Ivan Povazan 374e902075
NativeAOT: Enable building app extensions with NativeAOT (#20872)
### Description

This PR enables building app extensions with NativeAOT. 

App extensions are class libraries and to build them with NativeAOT we
must not specify `CustomNativeMain=true`. If we do, ILC would expect
that the input assembly has a managed Main as the module entry point.

Additionally, when building class libraries (with the absence of a
managed Main entry point), our static reference from:

2e5ef1eb1c/runtime/nativeaot-bridge.m (L39)

requires build-time symbol resolution. To avoid linking errors, we
generate an empty `__managed__Main`
in the native bootstrapping code of the app extension (e.g., in
`main.arm64.mm`).

### Testing

The unit tests have been introduced to test building app extensions with
both Mono and NativeAOT.
Executing an iOS app TodayExtension built with NativeAOT has been
verified manually on an actual device.

--- 
Fixes: https://github.com/xamarin/xamarin-macios/issues/20653
2024-07-19 08:03:49 -04:00
..
iOS NativeAOT: Enable building app extensions with NativeAOT (#20872) 2024-07-19 08:03:49 -04:00
macOS NativeAOT: Enable building app extensions with NativeAOT (#20872) 2024-07-19 08:03:49 -04:00
tvOS NativeAOT: Enable building app extensions with NativeAOT (#20872) 2024-07-19 08:03:49 -04:00
AppDelegate.cs [autoformat] Add .NET tests. (#16811) 2022-11-21 09:45:49 +01:00
Makefile [tests] Simplify makefiles by using shared code. (#13990) 2022-01-31 21:11:08 +01:00
shared.csproj [tests] Convert spaces to tabs in numerous test projects. (#15855) 2022-09-05 10:54:33 +02:00
shared.mk [tests] Simplify makefiles by using shared code. (#13990) 2022-01-31 21:11:08 +01:00