2023-01-02 00:14:48 +00:00
|
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
|
|
|
|
2023-01-03 20:26:51 +00:00
|
|
|
# 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}",
|
|
|
|
}
|
|
|
|
|
2023-01-02 00:14:48 +00:00
|
|
|
go_library(
|
|
|
|
name = "copy_to_directory_lib",
|
2023-01-03 20:26:51 +00:00
|
|
|
srcs = [
|
|
|
|
"main.go",
|
|
|
|
"stamp.go",
|
|
|
|
],
|
2023-01-02 00:14:48 +00:00
|
|
|
importpath = "github.com/aspect-build/bazel-lib/tools/copy_to_directory",
|
|
|
|
visibility = ["//visibility:public"],
|
2023-01-03 20:26:51 +00:00
|
|
|
x_defs = _GO_STAMP_X_DEFS,
|
2023-01-03 17:42:20 +00:00
|
|
|
deps = [
|
|
|
|
"@com_github_gobwas_glob//:glob",
|
|
|
|
"@org_golang_x_exp//maps",
|
|
|
|
],
|
2023-01-02 00:14:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
go_binary(
|
|
|
|
name = "copy_to_directory",
|
|
|
|
embed = [":copy_to_directory_lib"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|