* ensure that outside invocations of IntPtr constructors will work correctly
* Remove E0017 and ignore such constructors instead of hard erroring, they exist in real life
- This change rewrite the IL instruction stream of newobj calls into NSObject derived ctors to convert the IntPtr to a NativeHandle via the implicit ctor
- Integration tests will come later as we execute a subset of the nugets we convert.
- Also fix a minor issue in showing E0016 as it was missing an argument in the error string.
- Fixes https://github.com/xamarin/xamarin-macios/issues/15133
* [nnyeah] Remove NNYEAH_IN_PROCESS on IntegrationExamples.cs as it was cursed due to global caching in nuget tool install
* [nnyeah] Simplify test API
* [nnyeah] Map NSObject ctors with IntPtr to NativeHandle
- Fixes https://github.com/xamarin/xamarin-macios/issues/15120
This required a significant amount of refactoring:
- To resolve the base type of objects, we need to invoke cecil's Resolve
- Resolve requires all assemblies to be loaded in memory, whcih requires a custom resolver to find them all
- Note: This requires customer assemblies to include all non-platform dependencies to be next to the input
- This extra state prompted a refactor of Program.cs to create a tool 'AssemblyConverter' with instance variables to reduce param passing
- The ctor mapping logic is isolated to ConstructorTransforms to reduce the growth of Reworker.cs and make limited unit testing possible
- Turns out the flat removal of the platform assembly from the import list was wrong, as it caused all platform references, such as NSObject to
be resolved from System.Runtime, which is wrong. So replace in place with the new platform assembly instead.
- 'Error while attempting to map member System.IntPtr Foundation.NSObject::get_Handle() in old assembly'
- Also fix a strange directory name created by Cache.CreateTemporaryDirectory being called from async test method
- change visibility of methods in Program.cs to make it unit-testable
- infrastructure to find the Microsoft platform dlls
- tests to ensure that Xamarin and Microsoft dlls are where we expect
- a (failing) test that shows that dependency is not being removed
Added code to:
compile a string to a platform library
collect the output of the compilation process
check for errors
Added a single unit test of the smoke test variety.