Skip to content

Commit

Permalink
chore(internal/gapicgen): enable metadata gen (#3707)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz committed Feb 17, 2021
1 parent 2f76bec commit 6f4f401
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/gapicgen/cmd/genbot/Dockerfile
Expand Up @@ -33,7 +33,7 @@ RUN GO111MODULE=on go get \
golang.org/x/lint/golint@latest \
golang.org/x/tools/cmd/goimports@latest \
honnef.co/go/tools/cmd/staticcheck@latest \
github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.17.0
github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@v0.18.2
ENV PATH="${PATH}:/root/go/bin"

# Source: http://debuggable.com/posts/disable-strict-host-checking-for-git-clone:49896ff3-0ac0-4263-9703-1eae4834cda3
Expand Down
4 changes: 4 additions & 0 deletions internal/gapicgen/generator/config.go
Expand Up @@ -42,6 +42,10 @@ type microgenConfig struct {
// useful if a client needs to be deprecated, but retained in the repo
// metadata.
stopGeneration bool

// disableMetadata is used to toggle generation of the gapic_metadata.json
// file for the client library.
disableMetadata bool
}

var microgenGapicConfigs = []*microgenConfig{
Expand Down
3 changes: 3 additions & 0 deletions internal/gapicgen/generator/gapics.go
Expand Up @@ -178,6 +178,9 @@ func (g *GapicGenerator) microgen(conf *microgenConfig) error {
if conf.gRPCServiceConfigPath != "" {
args = append(args, "--go_gapic_opt", fmt.Sprintf("grpc-service-config=%s", conf.gRPCServiceConfigPath))
}
if !conf.disableMetadata {
args = append(args, "--go_gapic_opt", "metadata")
}
args = append(args, protoFiles...)
c := command("protoc", args...)
c.Dir = g.googleapisDir
Expand Down

0 comments on commit 6f4f401

Please sign in to comment.