xamarin-macios/src/CFNetwork
Chris Hamons 1dcefc9c56
[NET Attribute Conversion][generator] Generate NET style attributes (#14779)
This PR teaches our code generator to generate .NET 6 style availability attributes, adds a 4th Cecil test to verify our generated attributes, and a metric ton of API changes to satisfy that test.

The generator work is the core of this PR, and includes:

- Hacking out chunks of generator.cs that "helpfully" remove duplicate attributes, which are no longer duplicate in the new order that NET6 attributes force upon us. See changes in FilterMinimumVersion and PrintPlatformAttributes
- Prevent a crash when the generator processes availability attributes with no version included (example: introduced on iOS but no version). See Is64BitiOSOnly.
- The meat, GetPlatformAttributesToPrint, which synthesizes many attributes "out of thing air" from:
        - The parent context
        - Implied introduced just because the class exists on a given framework at all
        - Implied Catalyst because iOS exists
- A few cludgy hacks PrintPlatformAttributesNoDuplicates and GenerateProperty because the existing PrintPlatformAttributes did not pass down parent context down, and the refactor was dangerous/too time consuming given time pressure.

There are two intended API changes introduced by the reviews in this PR:

- GetCurrentInputDevice was obviously intended by availability attributes to exist on Catalyst but due to define confusion was excluded. It is an addition in Microsoft.MacCatalyst.dll only.
- The NEAppRule constructors were mis-marked on platforms, and were showing up incorrectly on Mac/Catalyst. I corrected the Catalyst one unconditionally, as we have not shipped Catalyst yet, but Mac is only fixed in NET6.

There is a lot of follow up work in https://github.com/xamarin/xamarin-macios/issues/14802 to do to remove a number of hard coded test failures, but this should be almost all of the remaining work in NET6 attributes.

🤞 this doesn't break too much for future us.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-05-02 09:44:25 -05:00
..
CFHTTPAuthentication.cs [NET Attribute Conversion] Add missing attributes in code-behind by re-running conversion (#14660) 2022-04-07 10:46:15 -05:00
CFHTTPMessage.cs [NET Attribute Conversion][generator] Generate NET style attributes (#14779) 2022-05-02 09:44:25 -05:00
CFHTTPStream.cs [NET Attribute Conversion] Add missing attributes in code-behind by re-running conversion (#14660) 2022-04-07 10:46:15 -05:00
CFHost.cs [NET Attribute Conversion] Add missing attributes in code-behind by re-running conversion (#14660) 2022-04-07 10:46:15 -05:00
Content.cs [CFNetwork] Remove the MessageHandler type from .NET. (#14056) 2022-02-04 07:54:39 +01:00
MessageHandler.cs [CFNetwork] Remove the MessageHandler type from .NET. (#14056) 2022-02-04 07:54:39 +01:00
WebRequestStream.cs [CFNetwork] Remove the MessageHandler type from .NET. (#14056) 2022-02-04 07:54:39 +01:00
WebResponseStream.cs [CFNetwork] Remove the MessageHandler type from .NET. (#14056) 2022-02-04 07:54:39 +01:00
WorkerThread.cs [CFNetwork] Remove the MessageHandler type from .NET. (#14056) 2022-02-04 07:54:39 +01:00