Teach our bgen to ignore those types that have been marked as a rgen
BindingType. The code adds a new smart enum in the sources that should
not be processed by bgen and therefore should not have the smart enum
extension method. You can verify that this is try by looking at the API
diff:
<img width="560" alt="Screenshot 2024-10-15 at 14 58 00"
src="https://github.com/user-attachments/assets/83790ae6-d94a-424f-8f70-e33bde7c4f22">
The existing Objective-C class to request an App Store review (SKStoreReviewController) is deprecated in Xcode 16+, and it doesn't even work on the corresponding OS versions.
The replacement API is Swift-only, but luckily it's a very simple API (just a static method), so it's possible to bind it manually.
This required a few other changes/improvements:
* Add support for Swift code in our runtime.
* Just to keep the changes to a minimum, bump the min OS version for legacy code to match the .NET min OS versions. This is because our build logic uses the legacy min versions when compiling native code (a more involved fix would be to update all the build logic to build native code to use the .NET min OS versions, but that's not the point of this PR, so I took the easy route). Fixes#10659.
I've tested the method locally, and it seems to work fine, but I've still marked
it as experimental for now. There are no unit tests because calling the method will
put up a dialog, which won't work correctly in unit tests.
Fixes https://github.com/xamarin/xamarin-macios/issues/21410.
Fixes https://github.com/xamarin/xamarin-macios/issues/10659.
We are doing the following:
1. Adding the rgen directory with the following solutions:
* Analyzer: Analyzer that will catch errors in the bindings. At the
moment it provides a single error when the BindingTypeAttribute is used
in a nont partial type.
* Analyzer Tests: Allows tests for the analyzer.
* Analyzer Sample: Sample project to test the analyzer.
* Code Generator: A code generator that adds the BindingTypeAttribute to
the compilcation.
* Code Generator Tests: Allows tests for the generator.
* Code Sample: Sample project for the code generator.
2. Make rule to build the roslyn code generator.
3. Makefile changes to add the code generator as part as the second
compilation of the bindings.
This changes add the starting gounds to move to roslyn.
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@soto.dev>
The methods 'GetTraitCollectionWithTraits' and 'GetTraitCollectionByModifyingTraits' takes a callback, but the callback
had the wrong signature.
So introduce a new overload for each of these methods, using a delegate with the correct signature.
Also deprecate 'FromTraitsFromCollections' according to both headers and documentation.
Fixes https://github.com/xamarin/xamarin-macios/issues/21377.
Addresses #13856
This was originally created by @dotMorten in #20434.
Also make SecIdentity.Import use an in-memory keychain on macOS 15+, so that
SecIdentity.Import works like all othe other platforms (i.e. not requiring
access to the default keychain, which, among other things, is not ideal on
bots).
---------
Co-authored-by: Morten Nielsen <mort5161@esri.com>
Co-authored-by: dotMorten <mn@iter.dk>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
The test we had in our codebase for the SBApplication class was not only
outdated, but also incorrect.
With recent changes the test code doesn't work anymore, so delete it.
Instead, add XML documentation that explains how to use the class in a
way that works.
Fixes https://github.com/xamarin/xamarin-macios/issues/21242.
Some of the availability attributes are from earlier OS versions, but
it's what the headers + Apple's documentation say.
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
The 'nw_connection_set_viability_changed_handler' P/Invoke was originally
bound as 'SetBooleanChangeHandler', which isn't quite right.
So now bind it as 'SetViabilityChangeHandler', obsolete the old version and
remove it in XAMCORE_5_0.