[Rgen] Add a factory method to create the aux variable for a BindFrom(typeof(NSValue)).#22112
Conversation
|
✅ [PR Build] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [PR Build] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
✅ API diff for current PR / commit.NET ( No breaking changes )❗ API diff vs stable (Breaking changes).NET ( ❗ Breaking changes ❗ )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
💻 [CI Build] Windows Integration Tests passed 💻✅ All Windows Integration Tests passed. Pipeline on Agent |
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 112 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
| var t = parameter.Type.Name; | ||
|
|
||
| // get the factory method based on the parameter type, if it is not found, return null | ||
| var factoryMethod = parameter.Type switch { { FullyQualifiedName: "CoreGraphics.CGAffineTransform" } => "FromCGAffineTransform", { FullyQualifiedName: "Foundation.NSRange" } => "FromRange", { FullyQualifiedName: "CoreGraphics.CGVector" } => "FromCGVector", { FullyQualifiedName: "SceneKit.SCNMatrix4" } => "FromSCNMatrix4", { FullyQualifiedName: "CoreLocation.CLLocationCoordinate2D" } => "FromMKCoordinate", { FullyQualifiedName: "SceneKit.SCNVector3" } => "FromVector", { FullyQualifiedName: "SceneKit.SCNVector4" } => "FromVector", { FullyQualifiedName: "CoreGraphics.CGPoint" } => "FromCGPoint", { FullyQualifiedName: "CoreGraphics.CGRect" } => "FromCGRect", { FullyQualifiedName: "CoreGraphics.CGSize" } => "FromCGSize", { FullyQualifiedName: "UIKit.UIEdgeInsets" } => "FromUIEdgeInsets", { FullyQualifiedName: "UIKit.UIOffset" } => "FromUIOffset", { FullyQualifiedName: "MapKit.MKCoordinateSpan" } => "FromMKCoordinateSpan", { FullyQualifiedName: "CoreMedia.CMTimeRange" } => "FromCMTimeRange", { FullyQualifiedName: "CoreMedia.CMTime" } => "FromCMTime", { FullyQualifiedName: "CoreMedia.CMTimeMapping" } => "FromCMTimeMapping", { FullyQualifiedName: "CoreAnimation.CATransform3D" } => "FromCATransform3D", |
There was a problem hiding this comment.
split in multi lines ?
There was a problem hiding this comment.
Ugh, that was the formatter we use :/ It was in multiple lines. Thanks for catching that. If you notice I have a pragma in other method to stop it from doing it
…(typeof(NSValue)).
413d39c to
2144ab7
Compare
|
Failing tests are unrelated to the change. |
This change allows to be able to generate an aux variable that will be needed if a customer defined a export method in the following way:
The above binding API indicates that the native method in objc will take a NSValue but we want to expose our users a CGPoint. In order to send a NSValue to objc, we need to declare an aux variable that will be used for the native method invocation.