Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(780)

Unified Diff: lib/code_generator.dart

Issue 1192943003: changes for 0.3.9 (Closed) Base URL: https://github.com/dart-lang/dart-protoc-plugin.git@master
Patch Set: made mixins more general Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/file_generator.dart » ('j') | lib/file_generator.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/code_generator.dart
diff --git a/lib/code_generator.dart b/lib/code_generator.dart
index 986db0b60bd1ba3789428b6e4d40836555addf76..cb1daf58ba88b0ec85967f00bb2142ac4e7a9903 100644
--- a/lib/code_generator.dart
+++ b/lib/code_generator.dart
@@ -26,11 +26,16 @@ class CodeGenerator extends ProtobufContainer {
void generate({
Map<String, SingleOptionParser> optionParsers,
OutputConfiguration outputConfiguration}) {
+
+ var extensions = new ExtensionRegistry();
+ Dart_options.registerAllExtensions(extensions);
+
_streamIn
.fold(new BytesBuilder(), (builder, data) => builder..add(data))
.then((builder) => builder.takeBytes())
.then((List<int> bytes) {
- var request = new CodeGeneratorRequest.fromBuffer(bytes);
+ var request =
+ new CodeGeneratorRequest.fromBuffer(bytes, extensions);
var response = new CodeGeneratorResponse();
// Parse the options in the request. Return the errors is any.
@@ -41,7 +46,8 @@ class CodeGenerator extends ProtobufContainer {
return;
}
- var ctx = new GenerationContext(options, outputConfiguration == null
+ var ctx = new GenerationContext(options,
+ outputConfiguration == null
? new DefaultOutputConfiguration() : outputConfiguration);
List<FileGenerator> generators = <FileGenerator>[];
for (FileDescriptorProto file in request.protoFile) {
« no previous file with comments | « no previous file | lib/file_generator.dart » ('j') | lib/file_generator.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698