@@ -193,6 +193,9 @@ func Generate(genModule bool) (err error) {
193193 protoDir := filepath .Join ("desc" , "proto" )
194194 thirdPartyProtoDir := filepath .Join ("desc" , "proto" , "third_party" )
195195 protoParser .ImportPaths = []string {protoDir , thirdPartyProtoDir }
196+ for _ , v := range config .C .Gen .Zrpcclient .ProtoInclude {
197+ protoParser .ImportPaths = append (protoParser .ImportPaths , v )
198+ }
196199 protoParser .IncludeSourceCodeInfo = true
197200
198201 rel , err := filepath .Rel (config .C .ProtoDir (), fp )
@@ -281,8 +284,8 @@ func Generate(genModule bool) (err error) {
281284 }())
282285 }
283286
284- if len (config .C .Gen .ProtoInclude ) > 0 {
285- protocCmd += fmt .Sprintf (" -I%s " , strings .Join (config .C .Gen .ProtoInclude , " -I" ))
287+ if len (config .C .Gen .Zrpcclient . ProtoInclude ) > 0 {
288+ protocCmd += fmt .Sprintf (" -I%s " , strings .Join (config .C .Gen .Zrpcclient . ProtoInclude , " -I" ))
286289 }
287290
288291 logx .Debugf (protocCmd )
@@ -427,6 +430,10 @@ func generatePluginFiles(plugins []plugin.Plugin) error {
427430 protoParser .InferImportPaths = false
428431
429432 protoParser .ImportPaths = []string {pluginProtoDir , pluginThirdPartyProtoDir }
433+
434+ for _ , v := range config .C .Gen .Zrpcclient .ProtoInclude {
435+ protoParser .ImportPaths = append (protoParser .ImportPaths , v )
436+ }
430437 protoParser .IncludeSourceCodeInfo = true
431438
432439 rel , err := filepath .Rel (pluginProtoDir , fp )
@@ -504,8 +511,8 @@ func generatePluginFiles(plugins []plugin.Plugin) error {
504511 }())
505512 }
506513
507- if len (config .C .Gen .ProtoInclude ) > 0 {
508- protocCmd += fmt .Sprintf (" -I%s " , strings .Join (config .C .Gen .ProtoInclude , " -I" ))
514+ if len (config .C .Gen .Zrpcclient . ProtoInclude ) > 0 {
515+ protocCmd += fmt .Sprintf (" -I%s " , strings .Join (config .C .Gen .Zrpcclient . ProtoInclude , " -I" ))
509516 }
510517
511518 logx .Debugf (protocCmd )
@@ -677,8 +684,8 @@ func genPluginNoRpcServiceExcludeThirdPartyProto(plugin plugin.Plugin, goModule,
677684 }(),
678685 )
679686
680- if len (config .C .Gen .ProtoInclude ) > 0 {
681- command += fmt .Sprintf (" -I%s " , strings .Join (config .C .Gen .ProtoInclude , " -I" ))
687+ if len (config .C .Gen .Zrpcclient . ProtoInclude ) > 0 {
688+ command += fmt .Sprintf (" -I%s " , strings .Join (config .C .Gen .Zrpcclient . ProtoInclude , " -I" ))
682689 }
683690
684691 logx .Debug (command )
0 commit comments