-
Notifications
You must be signed in to change notification settings - Fork 515
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
[Foundation] Add bindings for Xcode 13 rc 1. #13328
[Foundation] Add bindings for Xcode 13 rc 1. #13328
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable. There are a lot of tests, but I'm not sure enough given how much manual bindings/wraps there were.
I want @rolfbjarne 's blessing before this goes in.
Good work, this was messy.
@@ -1785,7 +1785,7 @@ public TrampolineInfo MakeTrampoline (Type t) | |||
} | |||
|
|||
var rt = mi.ReturnType; | |||
var rts = IsNativeEnum (rt) ? "var" : rt.ToString (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mandel-macaque - Can you explain this bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, without this fix you will get an issue with the trampolines that use generics because you get the class name like NSArra'1 rather than NSArray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this would be in a separate PR to make blaming it in the future more obvious.
Consider calling it out with explaination in the PR/commit description for possible future us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be a diff fix. The issue where is that the rt.ToString() ois doing the wrong thing and is generating a non-compilable name. I'll add this as a separate branch with a decent explanation.
tests/monotouch-test/Foundation/NSOrderedCollectionChange1Test.cs
Outdated
Show resolved
Hide resolved
tests/monotouch-test/Foundation/NSOrderedCollectionChange1Test.cs
Outdated
Show resolved
Hide resolved
@@ -394,7 +394,7 @@ | |||
<Exec Command="xcrun -sdk $(_SmeltingSdk) metal -c @(CustomMetalSmeltingInput) -o $(IntermediateOutputPath)\fragmentShader.air $(_SmeltingMinOS)" EnvironmentVariables="DEVELOPER_DIR=$(_SdkDevPath)" /> | |||
<Exec Command="xcrun -sdk $(_SmeltingSdk) metallib $(IntermediateOutputPath)\fragmentShader.air -o $(AppBundleDir)\fragmentShader.metallib" EnvironmentVariables="DEVELOPER_DIR=$(_SdkDevPath)" /> | |||
</Target> | |||
<Target Name="BeforeBuild" Inputs="@(GeneratedTestInput)" Outputs="@(GeneratedTestOutput)" DependsOnTargets="CustomMetalSmelting" > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unrelated to PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE being stupid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small things I noticed!
@@ -3569,7 +3668,10 @@ interface NSMutableArray { | |||
[iOS (8,0), Mac(10,10)] | |||
[Static, Export ("arrayWithContentsOfURL:")] | |||
NSMutableArray FromUrl (NSUrl url); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Extra line removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not removed. Someone left a tab and is added in the diff.
TestRuntime.AssertXcodeVersion (13,0); | ||
|
||
var str = new NSString ("Test"); | ||
var change = NSOrderedCollectionChange<NSString>.ChangeWithObject(str, NSCollectionChangeType.Insert, 0, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var change = NSOrderedCollectionChange<NSString>.ChangeWithObject(str, NSCollectionChangeType.Insert, 0, 1); | |
var change = NSOrderedCollectionChange<NSString>.ChangeWithObject (str, NSCollectionChangeType.Insert, 0, 1); | |
```nit |
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com> Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👍++ for the generator fix and the tests!
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffView dotnet API diffView dotnet legacy API diffAPI & Generator diffℹ️ API Diff (from PR only) (please review changes) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results11 tests failed, 90 tests passed.Failed tests
Pipeline on Agent XAMBOT-1104.BigSur' |
return first.ToString ().Equals (second.ToString ()); | ||
}); | ||
}, "Not throws"); | ||
Assert.NotNull (diff, "Not null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe assert that we get a specific diff
result as well?
var changes = new NSOrderedCollectionChange<NSString> [] { change }; | ||
using var diff = new NSOrderedCollectionDifference<NSString> (changes); | ||
Assert.DoesNotThrow (() => { | ||
var i = diff.Insertions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for not asserting on the returned value?
Assert.AreEqual (1, diff.Insertions.Length, "insertions");
(or whatever it's supposed to return)
var changes = new NSOrderedCollectionChange [] { change }; | ||
using var diff = new NSOrderedCollectionDifference (changes); | ||
Assert.DoesNotThrow (() => { | ||
var i = diff.Insertions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same: assert on the returned value
[SupportedOSPlatform ("ios13.0"), SupportedOSPlatform ("tvos13.0"), SupportedOSPlatform ("macos10.15")] | ||
#endif | ||
public void ApplyDifference (NSOrderedCollectionDifference<TKey> difference) | ||
=> _ApplyDifference (difference.Handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NRE if difference is null
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] | ||
[Static] | ||
[Export ("stringFromMeasurement:countStyle:")] | ||
string StringFromMeasurement (NSUnitInformationStorage measurement, NSByteCountFormatterCountStyle countStyle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a verb:
string StringFromMeasurement (NSUnitInformationStorage measurement, NSByteCountFormatterCountStyle countStyle); | |
string Create (NSUnitInformationStorage measurement, NSByteCountFormatterCountStyle countStyle); |
@@ -7278,6 +7393,10 @@ partial interface NSUrlSessionTask : NSCopying, NSProgressReporting | |||
[Export ("countOfBytesClientExpectsToReceive")] | |||
long CountOfBytesClientExpectsToReceive { get; set; } | |||
|
|||
[Watch (8, 0), TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)] | |||
[NullAllowed, Export ("delegate", ArgumentSemantic.Retain)] | |||
NSObject WeakDelegate { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a strongly typed Delegate
property?
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
/azp run |
Pull request contains merge conflicts. |
@mandel-macaque is this still a thing? we may want to land it before @chamons converts attributes on Foundation |
- This is based upon Manuel's xamarin#13328
- Based upon xamarin#13328
- Xcode 13 section Based upon #13328 - Some disabled due to https://github.com/xamarin/maccore/issues/2608
No description provided.