|
|
@@ -93,15 +93,8 @@ class Generator {
|
|
|
for moduleName in (moduleNames + options.extraModuleImports).sorted() {
|
|
|
println("import \(moduleName)")
|
|
|
}
|
|
|
- // Build systems like Bazel will generate the Swift service definitions in a different module
|
|
|
- // than the rest of the protos defined in the same file (because they are generated by separate
|
|
|
- // build rules that invoke the separate generator plugins). So, we need to specify module
|
|
|
- // mappings to import the service protos as well as and any other proto modules that the file
|
|
|
- // imports.
|
|
|
+ // Add imports for required modules
|
|
|
let moduleMappings = options.protoToModuleMappings
|
|
|
- if let serviceProtoModuleName = moduleMappings.moduleName(forFile: file) {
|
|
|
- println("import \(serviceProtoModuleName)")
|
|
|
- }
|
|
|
for importedProtoModuleName in moduleMappings.neededModules(forFile: file) ?? [] {
|
|
|
println("import \(importedProtoModuleName)")
|
|
|
}
|