-
Notifications
You must be signed in to change notification settings - Fork 36
[web_generator] Add Support for Parsing IDL Files #377
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
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.
Nice, thanks Nike!
final inputName = inputFileName.replaceFirst('_input', ''); | ||
|
||
final outputActualPath = | ||
p.join('.dart_tool', 'idl', '${inputName}_actual.dart'); |
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.
Let's use a temp directory instead using dart:io
.
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.
@kevmoo suggested I write it to .dart_tool
. It was originally in a temp directory ignored in the .gitignore
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.
Ah, I meant more that we dynamically generate the temp directory and clean it up each time instead of keeping a temp directory alive.
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.
What if we might want to look at the actual output and compare?
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.
You'd just comment out the deletion if you're debugging locally. I'm not sure when .dart_tool
cleans up any writes to it, maybe @kevmoo knows more there. Keeping alive test artifacts seems like a bad idea though.
final outputActualPath = | ||
p.join('.dart_tool', 'idl', '${inputName}_actual.dart'); | ||
final outputExpectedPath = | ||
p.join(testGenFolder, '${inputName}_expected.dart'); |
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.
Did you mean to include these files in this PR? I only see the input IDL files.
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.
I didn't have expected files (for all cases) because the test cases threw errors, and I wanted to resolve them to at least get an idea of how the output would look like before placing expected files
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.
Got it, I'm guessing they'll be added in this PR at some point later then.
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.
I wanted us to discuss about what was going wrong before then
@srujzs – running tests. Is this good? |
We chatted a bit before about some of the failures for the expected files and I believe Nike is still planning on adding the expected outputs into this PR before we can land. |
All tests are passing now @srujzs |
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.
Looking good! Just one final nit.
autosubmit label was removed for dart-lang/web/377, because This PR has not met approval requirements for merging. The PR author is not a member of dart-team and needs 1 more review(s) in order to merge this PR.
|
Fixes #374
This Pull Request extends the functionality of IDL generation by allowing support for parsing individual IDL files and definitions.
This also contains an integration test suite
integration/idl_test.dart
for testing IDL generation against expected files inintegration/idl/
For more information, check #374