Skip to content

Commit

Permalink
cmd/dev: add generate execgen subcommand
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
yuzefovich committed Jul 7, 2022
1 parent 41228d1 commit faa81af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions pkg/cmd/dev/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit faa81af

Please sign in to comment.