Chromium Code Reviews| Index: lib/file_generator.dart |
| diff --git a/lib/file_generator.dart b/lib/file_generator.dart |
| index a53c46fd24571ca9ebd7752494bba1b5ff130f63..19e5faa59291437254795b7748b6e4e1b896c71f 100644 |
| --- a/lib/file_generator.dart |
| +++ b/lib/file_generator.dart |
| @@ -25,6 +25,8 @@ class FileGenerator extends ProtobufContainer { |
| final List<EnumGenerator> enumGenerators = <EnumGenerator>[]; |
| final List<MessageGenerator> messageGenerators = <MessageGenerator>[]; |
| final List<ExtensionGenerator> extensionGenerators = <ExtensionGenerator>[]; |
| + final List<ClientApiGenerator> clientApiGenerators = <ClientApiGenerator>[]; |
| + final List<ServiceGenerator> serviceGenerators = <ServiceGenerator>[]; |
| FileGenerator(this._fileDescriptor, this._parent, this._context) { |
| _context.register(this); |
| @@ -43,6 +45,10 @@ class FileGenerator extends ProtobufContainer { |
| extensionGenerators.add( |
| new ExtensionGenerator(extension, this, _context)); |
| } |
| + for (ServiceDescriptorProto service in _fileDescriptor.service) { |
| + serviceGenerators.add(new ServiceGenerator(service, this, _context)); |
| + clientApiGenerators.add(new ClientApiGenerator(service, this, _context)); |
| + } |
| } |
| String get package => _fileDescriptor.package; |
| @@ -93,6 +99,8 @@ class FileGenerator extends ProtobufContainer { |
| '///\n' |
| 'library $libraryName;\n' |
| '\n' |
| + 'import \'dart:async\';\n' |
|
Søren Gjesse
2015/06/23 12:08:31
Is there any way to only import this if needed?
W
wibling
2015/06/23 13:26:34
I will take a look and see what I can come up with
|
| + '\n' |
| "import 'package:fixnum/fixnum.dart';\n" |
| "import 'package:protobuf/protobuf.dart';" |
| ); |
| @@ -151,6 +159,13 @@ class FileGenerator extends ProtobufContainer { |
| out.println('}'); |
| }); |
| } |
| + |
| + for (ClientApiGenerator c in clientApiGenerators) { |
| + c.generate(out); |
| + } |
| + for (ServiceGenerator s in serviceGenerators) { |
| + s.generate(out); |
| + } |
| } |
| bool get needsMapMixinImport { |