The Xamarin.MacDev.Tasks.sln solution is built with dotnet, while other projects
are still built with msbuild. This becomes a problem when generating Errors.designer.cs,
because depending on the runtime the output is different.
This means that the Errors.designer.cs will sometimes randomly change (depending
on which project re-generated the file), leaving the file modified in git. This is
quite annoying, but it also breaks the api comparison, which depends on the build
not leaving modified files behind. So for now, we generate Errors.designer.cs separately
for Xamarin.MacDev.Tasks.sln to not conflict with the mtouch version.
Also fix capitalization in numerous places to be consistent (it's Errors.designer.cs,
not Errors.Designer.cs).
* 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
Make our local .NET the default .NET (in the root's global.json), and then if
a directory wants to use the system .NET, then that directory would have to
opt-in (using its own global.json).
This way we don't have to copy global.json/NuGet.config files around to run
tests with the correct .NET setup.
* [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.
- Due to https://github.com/microsoft/vstest/issues/3658 it is not possible to test code that exits the process on error
- Create a base class for nnyeah exceptions that we want to explicitly report (and not crash), ConversionException
- Move Main to Main2 and wrap it in a try/catch for this exception
- '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
Clean up usage of modules in the app.
the var 'module' gets used all over the place. I'm going to refactor to fix up usage of imports and this will make things much easier to track.
In addition, there are a number of types that get used from module.TypeSystem.SomeType which I put into locals just to tidy up.
- Add a stupidly simple "download a nuget and test it" target
- Fix a few targets that should have had :: instead of : (I believe)
I tried to create a fancy define block to param this instead of hard coding, but I ran into the limits of my makefile example. Bike shedding an example would be appreciated, else we can go with this for now.
- 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
- Test is currently semi-manual and uses Alert to popup results
- Covers nint/nuint/nfloat with method/prop/field/event
- Execution currently doesn't execute events yet.
- Test fails due to reference issue reported to Steve
- Currently not hooked up to any automated tests
This gets iOS integration tests passing
From what I can tell we are failing due to:
public static new PHLivePhotoViewAppearance GetAppearance (UITraitCollection traits) {
public static new PHLivePhotoViewAppearance GetAppearance<T> (UITraitCollection traits) where T: PHLivePhotoView {
having the same hash, as the generic constraints are not printed.
To solve this we take on a small (250ish) dependency on code from MonoMod.Common (MIT licensed). They have code which creates stable hash keys that include generic information.