chore(*): update plugin default options && add examples

Signed-off-by: storyicon <yuanchao@bilibili.com>
This commit is contained in:
storyicon 2021-07-28 11:57:21 +08:00
parent bc28762992
commit 4f4006ee7d
No known key found for this signature in database
GPG key ID: 245915D985F966CF
18 changed files with 342 additions and 10 deletions

View file

@ -15,8 +15,6 @@
package build
import (
"fmt"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
@ -113,7 +111,6 @@ func CommandInit(log logger.Logger) *cobra.Command {
config.Options = append(config.Options, plugin.Options...)
}
}
fmt.Println(">>>>>>>>>>>>>>", preference.Repositories)
for _, val := range preference.Repositories {
if repo, ok := GetRepositoryFromOptionsValue(val); ok {
config.Repositories[repo.Name] = repo.Pkg

View file

@ -69,6 +69,7 @@ func GetWellKnownPlugins() []*Plugin {
Pkg: "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest",
Options: []string{
"--grpc-gateway_out=.",
"--grpc-gateway_opt=paths=source_relative",
},
},
{
@ -91,14 +92,16 @@ func GetWellKnownPlugins() []*Plugin {
Name: "protoc-gen-gogo",
Pkg: "github.com/gogo/protobuf/protoc-gen-gogo@latest",
Options: []string{
"--gogo_out=.",
"--gogo_out=plugins=grpc:.",
"--gogo_opt=paths=source_relative",
},
},
{
Name: "protoc-gen-gofast",
Pkg: "github.com/gogo/protobuf/protoc-gen-gofast@latest",
Options: []string{
"--gofast_out=.",
"--gofast_out=plugins=grpc:.",
"--gofast_opt=paths=source_relative",
},
},
{