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

78 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge ce895603a5
[autoformat] Add the rest of tools. (#16801) 2022-11-17 17:18:34 -05:00
Rolf Bjarne Kvinge 73101f2689
[msbuild] Fix dirty working copy with Errors.designer.cs. (#16404)
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).
2022-10-24 18:56:06 +02:00
Rolf Bjarne Kvinge 1228fda1a8
[nnyeah] Don't build nnyeah unless the iOS build is enabled. (#15752) 2022-08-25 11:31:42 +02:00
Steve Hawley 10b6dffec0
better help, change priority of processing help request. (#15660) 2022-08-09 10:14:48 -04:00
Steve Hawley 8858da6bf3
[Nnyeah] doc'n update (#15646) 2022-08-05 16:35:25 -04:00
Steve Hawley d4e827ce20
[nnyeah] Added code to look up the legacy platform dll instead of requiring it. (#15631)
* Added code to look up the legacy platform dll instead of requiring it.
2022-08-05 10:21:52 -04:00
Steve Hawley d34cbe230c
Better error message for ctors that we can't get to anymore. (#15378)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-08-04 15:34:28 -04:00
Rolf Bjarne Kvinge 29df69192f
[nnyeah] Return a non-zero exit code if something goes wrong. (#15450) 2022-08-02 19:28:15 -04:00
Steve Hawley f069898a29
[nnyeah] update documentation (#15592)
* update documentation

* clean up mark down
2022-08-02 11:11:10 -04:00
Steve Hawley 0b872a1683
[nnyeah] Fix for branch targets and AVMediaTypes (#15561)
* Fix for branch targets and AVMediaTypes
2022-07-22 10:24:40 -04:00
Steve Hawley 8983e56be0
fix incorrect attribute (#15549) 2022-07-20 12:11:28 -04:00
Steve Hawley f378a38bcf
Completed NFloat mappings (#15537) 2022-07-18 14:48:59 -04:00
Steve Hawley 0731d6d8bd
limit to one reference to Microsoft.iOS (#15477) 2022-07-14 10:27:24 -04:00
Steve Hawley ee03980483
removed constructor size limit (#15459) 2022-07-11 17:00:40 -04:00
Steve Hawley b4c68ab209
manage DisposableObject (#15355) 2022-06-27 16:02:20 -04:00
Steve Hawley 8965dde9a0
[nnyeah] Fix more ctor/handle mapping (#15324)
* Fix more ctor/handle mapping

* Make sure the mapping happens
2022-06-23 14:24:28 -04:00
Rolf Bjarne Kvinge 3be1d9d760
Use unix-style line endings in project files. (#15303)
This also removes the BOM in a few project files.

This is a whitespace-only change, as can be seen here: https://github.com/xamarin/xamarin-macios/pull/15303/files?w=1
2022-06-21 17:22:58 +02:00
Steve Hawley 357adfde76
test for private classes (#15292) 2022-06-16 14:43:34 -04:00
Steve Hawley e1c334564e
[nnyeah] Added correct mapping for NSObject.Handle fixing #15261 (#15270)
* Added correct mapping for NSObject.Handle

* removed dead code
2022-06-15 14:17:13 -04:00
Steve Hawley 18f18f9b76
[nnyeah] ensure that outside invocations of IntPtr constructors will work correctly (#15246)
* 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
2022-06-14 11:22:20 -04:00
Steve Hawley 3e12f0550e
[nnyeah] add code to handle get_ClassHandle calls. Fixes #15218 (#15225)
* add code to handle get_ClassHandle calls.

* tweak on the unit test
2022-06-09 11:48:15 -04:00
Chris Hamons 3ab94ebfb3
[nnyeah] Convert IntPtr newobj calls to first convert to NativeHandle (#15220)
- 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
2022-06-08 14:33:26 -05:00
Steve Hawley a78f058507
tests now pass (#15207) 2022-06-07 12:04:54 -04:00
Rolf Bjarne Kvinge a1d0b6eba9
Make our local .NET the default .NET for the build. (#15086)
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.
2022-06-07 10:11:02 +02:00
Steve Hawley e303d4bc9a
Test now passes (#15193) 2022-06-03 10:31:04 -04:00
Steve Hawley 989f9ea1db
[nnyeah] Report on work done on ctors (#15191)
* Report on work done

* whitespace, !
2022-06-02 15:36:33 -04:00
Steve Hawley f552e63085
fixing logic error (#15170) 2022-06-01 15:44:50 -04:00
Chris Hamons c17fd25583
[nnyeah] Map NSObject ctors with IntPtr to NativeHandle (#15134)
* [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.
2022-05-31 10:40:56 -04:00
Steve Hawley 6676f816f2
added missing test invocations (#15132) 2022-05-27 10:59:40 -04:00
Steve Hawley f16c1bb993
implicit operator tests (#15128)
Added more tests for implicit operators.
2022-05-26 15:09:21 -04:00
Steve Hawley 2397b51a79
bitwise operator tests (#15123) 2022-05-26 09:56:04 -04:00
Steve Hawley 6826fb8665
[nnyeah] added tests for boolean operators (#15109)
* added tests for boolean operators

* updated ignore message
2022-05-25 09:59:24 -04:00
Steve Hawley 5946727d08
[nnyeah] Arithmetic tests (#15097)
* Added tests for arithmetic and basic casting
* trying to rebase off main to clean up the PR and future PRs
2022-05-23 15:47:54 -04:00
Chris Hamons 7e8bd5cac4
[nnyeah] Centralize error handling (#15064)
- 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
2022-05-23 10:32:54 -05:00
Steve Hawley d2e0a364d6
[nnyeah] Lets nfloat (#15088)
Reactivated the nfloat tests.
2022-05-23 09:46:19 -04:00
Steve Hawley 94e40c8b11
[nnyeah] fix issues compiling against nnyeah touched libraries (#15082)
fix issues compiling against nnyeah touched libraries
2022-05-20 15:31:18 -04:00
Chris Hamons 03c3b3003a
[nnyeah] Add rest of top nuget examples to integration suite (#15058) 2022-05-20 05:48:29 -05:00
Chris Hamons add714ffb7
[nnyeah] Add unit test showing most common nuget failure (#15065)
- '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
2022-05-20 05:48:02 -05:00
Steve Hawley 6d072fbc46
[nnyeah] Import Type and Member references (#15052)
import methods and types when referencing them
2022-05-18 16:18:04 -04:00
Chris Hamons 873cc1ea96
[nnyeah] Integration tests run against dotnet tool from nupkg (#15051) 2022-05-18 09:23:49 -05:00
Chris Hamons 2aae39d8de
[nnyeah] Optionally run integration test nnyeah in-process (#15049) 2022-05-17 16:27:19 -05:00
Steve Hawley 3207ba2707
[nnyeah] Refactor module usage (#15048)
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.
2022-05-17 16:35:14 -04:00
Chris Hamons f33ddd906d
[nnyeah] Convert integration test to nunit from Makefile (#15040)
- Also refactor test layout a bit to split unit from integration
- Integration should long term invoke the nuget installed, unit never will.
2022-05-17 09:24:35 -05:00
Steve Hawley 746cf884c0
[nnyeah] Fix for handling nfloat (#15021)
nfloat needed a proper reference to System.Runtime.InteropServices.
2022-05-16 11:53:33 -04:00
Chris Hamons 5249316b8a
[Nnyeah] nuget execution (#15017)
- 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.
2022-05-16 09:23:13 -05:00
Steve Hawley 4b5581553c
[nnyeah] Get nint types (#15016)
Fixed issue with treating nint et al as TypeDefinitions instead of TypeReferences
Fixed issue where an old assembly reference is left hanging around
2022-05-13 09:51:56 -04:00
Steve Hawley 1da4351f95
[nnyeah] Check dependencies in output (#14987)
- 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
2022-05-12 14:45:56 -04:00
Chris Hamons cec44107a5
[nnyeah] Add executable integration test (#14977)
- 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
2022-05-11 12:02:06 -05:00
Chris Hamons 086469f70b
[nnyeah] Fix method hashing of generic matching non-generic due to Cecil limitation. (#14962)
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.
2022-05-10 16:09:46 -05:00
Chris Hamons e6d4878fa5
[Nnyeah] Improve error messages for missing required arguments (#14949) 2022-05-10 09:07:05 -05:00