Skip to content

Commit

Permalink
dev: if specified, dev generate bazel before other targets
Browse files Browse the repository at this point in the history
The results of this generation can impact most of the other generation
targets, so it should be done first.

Release justification: Non-production code changes
Release note: None
  • Loading branch information
rickystewart committed Sep 6, 2022
1 parent af1a53a commit 45d8472
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fi
set -euo pipefail

# Bump this counter to force rebuilding `dev` on all machines.
DEV_VERSION=54
DEV_VERSION=55

THIS_DIR=$(cd "$(dirname "$0")" && pwd)
BINARY_DIR=$THIS_DIR/bin/dev-versions
Expand Down
7 changes: 7 additions & 0 deletions pkg/cmd/dev/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ func (d *dev) generate(cmd *cobra.Command, targets []string) error {
for _, target := range targets {
targetsMap[target] = struct{}{}
}
// NB: We have to run the bazel generator first if it's specified.
if _, ok := targetsMap["bazel"]; ok {
delete(targetsMap, "bazel")
if err := generatorTargetMapping["bazel"](cmd); err != nil {
return err
}
}
{
// In this case, generating both go and cgo would duplicate work.
// Generate go_nocgo instead.
Expand Down

0 comments on commit 45d8472

Please sign in to comment.