mirror of https://github.com/k3s-io/k3s
bazel: generate pkg/generated/bindata.go at build time
parent
aab5cb4c34
commit
b9a029db6d
|
@ -70,6 +70,7 @@ filegroup(
|
|||
"//staging:all-srcs",
|
||||
"//test:all-srcs",
|
||||
"//third_party:all-srcs",
|
||||
"//translations:all-srcs",
|
||||
"//vendor:all-srcs",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
|
|
|
@ -42,7 +42,7 @@ pushd "${KUBE_ROOT}" >/dev/null
|
|||
# These are files for e2e tests.
|
||||
BINDATA_OUTPUT="test/e2e/generated/bindata.go"
|
||||
go-bindata -nometadata -o "${BINDATA_OUTPUT}.tmp" -pkg generated \
|
||||
-ignore .jpg -ignore .png -ignore .md \
|
||||
-ignore .jpg -ignore .png -ignore .md -ignore 'BUILD(\.bazel)?' \
|
||||
"test/e2e/testing-manifests/..." \
|
||||
"test/images/..." \
|
||||
"test/fixtures/..."
|
||||
|
@ -64,7 +64,7 @@ rm -f "${BINDATA_OUTPUT}.tmp"
|
|||
# These are files for runtime code
|
||||
BINDATA_OUTPUT="pkg/generated/bindata.go"
|
||||
go-bindata -nometadata -nocompress -o "${BINDATA_OUTPUT}.tmp" -pkg generated \
|
||||
-ignore .jpg -ignore .png -ignore .md \
|
||||
-ignore .jpg -ignore .png -ignore .md -ignore 'BUILD(\.bazel)?' \
|
||||
"translations/..."
|
||||
|
||||
gofmt -s -w "${BINDATA_OUTPUT}.tmp"
|
||||
|
|
|
@ -5,6 +5,24 @@ load(
|
|||
"go_library",
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "bindata",
|
||||
srcs = [
|
||||
"//translations:all-srcs",
|
||||
],
|
||||
outs = ["bindata.go"],
|
||||
cmd = """
|
||||
$(location //vendor/github.com/jteeuwen/go-bindata/go-bindata:go-bindata) \
|
||||
-nometadata -nocompress -o "$(OUTS)" -pkg generated \
|
||||
-prefix $$(pwd) \
|
||||
-ignore .jpg -ignore .png -ignore .md -ignore 'BUILD(\.bazel)?' \
|
||||
$(SRCS)
|
||||
""",
|
||||
tools = [
|
||||
"//vendor/github.com/jteeuwen/go-bindata/go-bindata",
|
||||
],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
|
|
|
@ -30,7 +30,7 @@ genrule(
|
|||
$(location //vendor/github.com/jteeuwen/go-bindata/go-bindata:go-bindata) \
|
||||
-nometadata -o "$(OUTS)" -pkg generated \
|
||||
-prefix $$(pwd) \
|
||||
-ignore .jpg -ignore .png -ignore .md \
|
||||
-ignore .jpg -ignore .png -ignore .md -ignore 'BUILD(\.bazel)?' \
|
||||
$(SRCS)
|
||||
""",
|
||||
tools = [
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
Loading…
Reference in New Issue