bazel-lib/tools/copy_to_directory/BUILD.bazel

33 lines
971 B
Python
Raw Normal View History

load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
# Under --stamp, the Go linker will fill in these placeholders with VCS info
# see https://github.com/bazelbuild/rules_go/blob/master/go/core.rst#stamping-with-the-workspace-status-script
_GO_STAMP_X_DEFS = {
"BuildTime": "{BUILD_TIMESTAMP}",
"GitCommit": "{STABLE_BUILD_SCM_SHA}",
"GitStatus": "{STABLE_BUILD_SCM_LOCAL_CHANGES}",
"HostName": "{BUILD_HOST}",
"Release": "{STABLE_BUILD_SCM_TAG}",
}
go_library(
name = "copy_to_directory_lib",
srcs = [
"main.go",
"stamp.go",
],
importpath = "github.com/aspect-build/bazel-lib/tools/copy_to_directory",
visibility = ["//visibility:public"],
x_defs = _GO_STAMP_X_DEFS,
deps = [
"@com_github_gobwas_glob//:glob",
"@org_golang_x_exp//maps",
],
)
go_binary(
name = "copy_to_directory",
embed = [":copy_to_directory_lib"],
visibility = ["//visibility:public"],
)