File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
PluginExamples/Sources/CustomProtoPath
Plugins/SwiftProtobufPlugin Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 77 " Main.proto"
88 ],
99 "visibility" : " public" ,
10- "protoPath " : " protos"
10+ "protoPaths " : [ " protos" ]
1111 }
1212 ]
1313}
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ struct SwiftProtobufPlugin {
8686 var implementationOnlyImports : Bool ?
8787 /// Whether import statements should be preceded with visibility.
8888 var useAccessLevelOnImports : Bool ?
89- /// Overrides the path to look for protobuf files
90- var protoPath : String ?
89+ /// Overrides the paths to look for protobuf files
90+ var protoPaths : [ String ] ?
9191 }
9292
9393 /// The path to the `protoc` binary.
@@ -173,15 +173,16 @@ struct SwiftProtobufPlugin {
173173 " --swift_out= \( outputDirectory) " ,
174174 ]
175175
176- let protoDirectory =
177- if let protoPath = invocation. protoPath {
178- directory. appending ( protoPath)
179- } else {
180- directory
181- }
182176
183- protocArgs. append ( " -I " )
184- protocArgs. append ( " \( protoDirectory) " )
177+ if let protoPaths = invocation. protoPaths {
178+ for protoPath in protoPaths {
179+ protocArgs. append ( " -I " )
180+ protocArgs. append ( " \( directory. appending ( protoPath) ) " )
181+ }
182+ } else {
183+ protocArgs. append ( " -I " )
184+ protocArgs. append ( " \( directory) " )
185+ }
185186
186187 // Add the visibility if it was set
187188 if let visibility = invocation. visibility {
You can’t perform that action at this time.
0 commit comments