diff --git a/dev b/dev index f432f6ccc551..08f92372f938 100755 --- a/dev +++ b/dev @@ -3,7 +3,7 @@ set -euo pipefail # Bump this counter to force rebuilding `dev` on all machines. -DEV_VERSION=8 +DEV_VERSION=9 THIS_DIR=$(cd "$(dirname "$0")" && pwd) BINARY_DIR=$THIS_DIR/bin/dev-versions diff --git a/pkg/cmd/dev/generate.go b/pkg/cmd/dev/generate.go index 45767a808f94..6401407db1b2 100644 --- a/pkg/cmd/dev/generate.go +++ b/pkg/cmd/dev/generate.go @@ -50,9 +50,10 @@ func makeGenerateCmd(runE func(cmd *cobra.Command, args []string) error) *cobra. func (d *dev) generate(cmd *cobra.Command, targets []string) error { var generatorTargetMapping = map[string]func(cmd *cobra.Command) error{ - "bazel": d.generateBazel, - "docs": d.generateDocs, - "go": d.generateGo, + "bazel": d.generateBazel, + "docs": d.generateDocs, + "go": d.generateGo, + "protobuf": d.generateProtobuf, } if len(targets) == 0 { @@ -177,3 +178,13 @@ func (d *dev) generateGo(cmd *cobra.Command) error { } return d.hoistGeneratedCode(ctx, workspace, bazelBin) } + +func (d *dev) generateProtobuf(cmd *cobra.Command) error { + // The bazel target //pkg/gen:go_proto builds and hoists the protobuf + // go files. + return d.exec.CommandContextInheritingStdStreams( + cmd.Context(), "bazel", append(append([]string{"run"}, + mustGetRemoteCacheArgs(remoteCacheAddr)...), + "//pkg/gen:go_proto")..., + ) +}