Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/dev: add generate execgen subcommand #83961

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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