-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[pigeon] Recursively create output target files #4458
Changes from 7 commits
2611c6e
f90f49f
e51dbe3
7464301
c659eac
fc9f638
2cb30a0
88ed03c
83972c9
56a5fec
9da076c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -389,6 +389,7 @@ IOSink? _openSink(String? output, {String basePath = ''}) { | |
sink = stdout; | ||
} else { | ||
file = File(path.posix.join(basePath, output)); | ||
file.createSync(recursive: true); | ||
sink = file.openWrite(); | ||
} | ||
return sink; | ||
|
@@ -472,6 +473,7 @@ class DartGeneratorAdapter implements GeneratorAdapter { | |
final DartOptions dartOptionsWithHeader = _dartOptionsWithCopyrightHeader( | ||
options.dartOptions, | ||
options.copyrightHeader, | ||
dartOutPath: options.dartOut, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this change related to the fix? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made this change to investigate something, but then I forgot to revert it. Later, I mistakenly assumed that I had made the change intentionally, and I apologize for that. |
||
basePath: options.basePath ?? '', | ||
); | ||
const DartGenerator generator = DartGenerator(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -366,6 +366,13 @@ Future<int> _runCommandLineTests() async { | |
'--ast_out', | ||
tempOutput | ||
], | ||
// Test writing a file in a directory that doesn't exist | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: missing final period. |
||
<String>[ | ||
'--input', | ||
'pigeons/message.dart', | ||
'--dart_out', | ||
'$tempDir/subdirectory/does/not/exist/message.g.dart', | ||
], | ||
]; | ||
|
||
int exitCode = 0; | ||
|
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.
How about "Fixes generation failures when an output file is in a directory that doesn't already exist."