Multiple relations on single parameter#166
Conversation
|
After sending this PR, I've started writing tests. While everything I've tested on works correctly, I'm worried about |
08dadbf to
5bc72c1
Compare
* Use IList to store all relations on a parameter * Reimplement RelationParser to be a proper language parser based on Roslyn * Drop IHasRelatedMarshallable interface * Prevent crash when relation specifies parameter name, which is absent on the method. Print helpful message instead.
5bc72c1 to
bd64e10
Compare
|
@jkoritzinsky this PR is ready to be reviewed. |
|
Note, that this PR enables new syntax: Relatively unrelated question: |
|
Some of the tasks (the ones that discover which C++ files are inputs and which C# files are outputs) definitely need to stay separate. The rest of them could probably merge together. My goal with the separation was to enable generation to work incrementally, but the design of the config files breaks that. |
|
@jkoritzinsky yep, I agree the tasks that compute inputs/outputs must stay separate.
Could you please elaborate on that? I mean, I think it's because the config files specify inputs (source headers) MSBuild is not aware of, but I haven't given it much thought. What do you think is the cause of SharpGen regenerating everything almost on every build? Meanwhile (waiting on this PR to be reviewed and merged), I'm having a look at #144. The patch there is insufficient (even SdkTests are failing, and for a good reason), I'm working on a better solution. upd: better solution implemented on my draft PR. |
|
There are a few MSBuild tasks that the targets files use to enable discovering all of the input headers into SharpGenTools so that we re-run generation when only the native headers are changed and not require extraneous edits to the mapping files. |
|
@jkoritzinsky it still doesn't explain why SharpGen 1.2 sometimes regenerates bindings for no good reason (observed numerous times, but I couldn't grab binlog since I was using Rider IDE). Meanwhile, I'm finishing my rework of SharpGen targets for v2:
This will take a couple more days, then I'll push it to draft PR branch. I hope this PR will be reviewed & merged by that time. |
|
Rider’s usage of MSBuild is particularly poor since they try to do shortcuts. I wouldn’t be amazed if they broke things. I’ll try to review this over the weekend so we can get it merged in. |
|
Just a friendly reminder and an update on the following PRs.
|
|
That work sounds fantastic! I’ve merged this PR in in the meantime so we can keep moving forward. |
Example: IUIAnimationInterpolator2::SetInitialValueAndVelocity,
cDimensionthere is a length for bothinitialValueandinitialVelocity), e.g.length(initialValue),length(initialVelocity).IList<MarshallableRelation>to store all relations on a parameterRelationParserto be a proper language parser using RoslynIHasRelatedMarshallableinterfaceMicrosoft.NET.Sdkversions - only 5.0 previews up to5.0.100-preview.5.20230.9(first version to contain the fix).MarshalledElementFactoryTests.ParameterWithStructSizeRelationLogsErrortesting the wrong thing