From faa81afb4c0a5160dbaec88f3234b9dca519ef85 Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Wed, 6 Jul 2022 19:44:00 -0700 Subject: [PATCH] cmd/dev: add generate execgen subcommand Release note: None --- dev | 2 +- pkg/cmd/dev/generate.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dev b/dev index b6161ef7bf6f..796d134d2972 100755 --- a/dev +++ b/dev @@ -3,7 +3,7 @@ set -euo pipefail # Bump this counter to force rebuilding `dev` on all machines. -DEV_VERSION=39 +DEV_VERSION=40 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 c06018148a92..baff06353719 100644 --- a/pkg/cmd/dev/generate.go +++ b/pkg/cmd/dev/generate.go @@ -37,6 +37,7 @@ func makeGenerateCmd(runE func(cmd *cobra.Command, args []string) error) *cobra. dev generate bazel # DEPS.bzl and BUILD.bazel files dev generate cgo # files that help non-Bazel systems (IDEs, go) link to our C dependencies dev generate docs # generates documentation + dev generate execgen # generates execgen go code (subset of 'dev generate go') dev generate go # generates go code (execgen, stringer, protobufs, etc.), plus everything 'cgo' generates dev generate go_nocgo # generates go code (execgen, stringer, protobufs, etc.) dev generate protobuf # *.pb.go files (subset of 'dev generate go') @@ -63,6 +64,7 @@ func (d *dev) generate(cmd *cobra.Command, targets []string) error { "bazel": d.generateBazel, "cgo": d.generateCgo, "docs": d.generateDocs, + "execgen": d.generateExecgen, "go": d.generateGo, "go_nocgo": d.generateGoNoCgo, "protobuf": d.generateProtobuf, @@ -154,6 +156,10 @@ func (d *dev) generateDocs(cmd *cobra.Command) error { return d.generateRedactSafe(ctx) } +func (d *dev) generateExecgen(cmd *cobra.Command) error { + return d.generateTarget(cmd.Context(), "//pkg/gen:execgen") +} + func (d *dev) generateGoAndDocs(cmd *cobra.Command) error { ctx := cmd.Context() if err := d.generateTarget(ctx, "//pkg/gen"); err != nil {