Create a go_bindata bazel macro

This commit is contained in:
Jeff Grafton
2018-04-11 17:24:51 -07:00
parent 75efdf2974
commit b2f8cf1bce
3 changed files with 54 additions and 24 deletions

View File

@@ -4,6 +4,7 @@ load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
load("//build:bindata.bzl", "go_bindata")
go_library(
name = "go_default_library",
@@ -18,24 +19,16 @@ go_library(
],
)
genrule(
go_bindata(
name = "bindata",
srcs = [
"//test/images:all-srcs",
"//test/fixtures:all-srcs",
"//test/e2e/testing-manifests:all-srcs",
"//test/fixtures:all-srcs",
"//test/images:all-srcs",
],
outs = ["bindata.go"],
cmd = """
$(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 'BUILD(\.bazel)?' \
$(SRCS)
""",
tools = [
"//vendor/github.com/jteeuwen/go-bindata/go-bindata",
],
compress = True,
include_metadata = False,
)
filegroup(