mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Use the $GO_GENRULE_EXECROOT env var set by go_genrule
This commit is contained in:
parent
6034bf68d0
commit
8fca6fe201
@ -36,17 +36,16 @@ def openapi_library(name, tags, srcs, go_prefix, vendor_prefix = "", openapi_tar
|
||||
# All of bazel's $(location)s are relative to the original working directory, however,
|
||||
# so we must save it first.
|
||||
cmd = " ".join([
|
||||
"ORIG_WD=$$(pwd);",
|
||||
"cd $$GOPATH/src/" + go_prefix + ";",
|
||||
"$$ORIG_WD/$(location //vendor/k8s.io/kube-openapi/cmd/openapi-gen)",
|
||||
"$$GO_GENRULE_EXECROOT/$(location //vendor/k8s.io/kube-openapi/cmd/openapi-gen)",
|
||||
"--v 1",
|
||||
"--logtostderr",
|
||||
"--go-header-file $$ORIG_WD/$(location //" + vendor_prefix + "hack/boilerplate:boilerplate.go.txt)",
|
||||
"--go-header-file $$GO_GENRULE_EXECROOT/$(location //" + vendor_prefix + "hack/boilerplate:boilerplate.go.txt)",
|
||||
"--output-file-base zz_generated.openapi",
|
||||
"--output-package " + go_prefix + "pkg/generated/openapi",
|
||||
"--report-filename tmp_api_violations.report",
|
||||
"--input-dirs " + ",".join([go_prefix + target for target in openapi_targets] + [go_prefix + "vendor/" + target for target in vendor_targets]),
|
||||
"&& cp $$GOPATH/src/" + go_prefix + "pkg/generated/openapi/zz_generated.openapi.go $$ORIG_WD/$(location :zz_generated.openapi.go)",
|
||||
"&& cp $$GOPATH/src/" + go_prefix + "pkg/generated/openapi/zz_generated.openapi.go $$GO_GENRULE_EXECROOT/$(location :zz_generated.openapi.go)",
|
||||
"&& rm tmp_api_violations.report",
|
||||
]),
|
||||
go_deps = deps,
|
||||
|
Loading…
Reference in New Issue
Block a user