Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GameController] Add missing API for XCode15. Fixes #15725 #19708

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mandel-macaque
Copy link
Member

This PR adds the missing bindings and fixes #15725. What the issue reported is incorrect, the problem with the API is that it uses Swift enumerators that have a String RawValue. The way to fix this in our bindings is to use the string values that are PRESENT in the headers.

This PR adds the missing bindings and fixes xamarin#15725. What the issue reported is incorrect,
the problem with the API is that it uses Swift enumerators that have a String RawValue.
The way to fix this in our bindings is to use the string values that are **PRESENT** in the
headers.
src/gamecontroller.cs Outdated Show resolved Hide resolved
Copy link
Contributor

⚠️ Your code has been reformatted. ⚠️

If this is not desired, add the actions-disable-autoformat label, and revert the reformatting commit.

If files unrelated to your change were modified, try reverting the reformatting commit + merging with the target branch (and push those changes).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copy link
Member

@rolfbjarne rolfbjarne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this also needs tests, even for a sample of the generated bindings, because the API is somewhat uncommon.

tests/introspection/iOS/iOSApiProtocolTest.cs Outdated Show resolved Hide resolved
src/gamecontroller.cs Outdated Show resolved Hide resolved
src/gamecontroller.cs Outdated Show resolved Hide resolved
src/gamecontroller.cs Outdated Show resolved Hide resolved
src/gamecontroller.cs Outdated Show resolved Hide resolved
src/gamecontroller.cs Outdated Show resolved Hide resolved
src/gamecontroller.cs Outdated Show resolved Hide resolved
src/GameController/GCPhysicalInputElementCollection_2.cs Outdated Show resolved Hide resolved
src/GameController/GCPhysicalInputElementCollection_2.cs Outdated Show resolved Hide resolved
Comment on lines +40 to +41
public NSEnumerator<IGCPhysicalInputElement> ElementEnumerator
=> Runtime.GetNSObject<NSEnumerator<IGCPhysicalInputElement>> (_ElementEnumerator)!;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a property, not a field.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a property, notice the '=>' and not a '='

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah - this is exactly why Sebastien said to not use => for properties, it's a very small difference from fields (just a single character), and can end up confusing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also public and not private which is the better indicator for me personally.

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
@mandel-macaque
Copy link
Member Author

I think this also needs tests, even for a sample of the generated bindings, because the API is somewhat uncommon.

The issue with this API is that in most cases it needs a controller to test. I have an xbox controller which I can use to write a sample, but adding that in the CI will be problematic.

I have added all the suggested changes. Shall we do a sample? /cc @dalexsoto

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copy link
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I have to agree with @rolfbjarne and my old (younger?) self, this ideally requires a sample.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Tests on macOS M1 - Mac Ventura (13.0) failed ❌

Failed tests are:

  • introspection

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: f26a018341dc232a33e3a66e6f68a3138c27f91e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: f26a018341dc232a33e3a66e6f68a3138c27f91e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

1 tests crashed, 4 tests failed, 229 tests passed.

Failures

❌ introspection tests

4 tests failed, 4 tests passed.
  • introspection/Mac Catalyst [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 40 Passed: 38 Inconclusive: 0 Failed: 1 Ignored: 1)
  • introspection/Mac Modern/Debug: Failed (Test run failed.
    Tests run: 37 Passed: 35 Inconclusive: 0 Failed: 1 Ignored: 1)
  • introspection/iOS Unified 64-bits - simulator/Debug [dotnet]: Failed
  • introspection/tvOS - simulator/Debug [dotnet]: Failed

Html Report (VSDrops) Download

❌ msbuild tests

🔥 Failed catastrophically on VSTS: simulator tests - msbuild (no summary found).

Html Report (VSDrops) Download

Successes

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 6 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 41 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: f26a018341dc232a33e3a66e6f68a3138c27f91e [PR build]

Copy link
Contributor

@mcumming mcumming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +40 to +41
public NSEnumerator<IGCPhysicalInputElement> ElementEnumerator
=> Runtime.GetNSObject<NSEnumerator<IGCPhysicalInputElement>> (_ElementEnumerator)!;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also public and not private which is the better indicator for me personally.

@@ -181,6 +181,9 @@ protected override bool Skip (Type type)
if (Mac.CheckSystemVersion (10, 15))
return true;
break;
case "GameController.GCPhysicalInputSource":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these use constants, enumerations, or nameof?

Comment on lines 52 to +55
case "ASAuthorizationProviderExtensionRegistrationHandler":
return true;
case "GCPhysicalInputSource":
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the case values be using constants, enumerations, or nameof?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Xcode14 GameController.GCPhysicalInputElementCollection Strange Types
5 participants