基本上我想要的只是cp -r src/ dist/
,但由于某种原因,我根本无法让它工作。
目前我正在尝试:
filegroup(
name = "src_files",
srcs = glob([
"src/**",
]),
)
filegroup(
name = "dist_files",
srcs = glob([
"dist/**"
]),
)
genrule(
name = "copy",
srcs = ["//packages/variables:src_files"],
outs = ["//packages/variables:dist_files"],
cmd = "cp -R $(locations //packages/variables:src_files) $(locations //packages/variables:dist_files)"
)
我已经浏览了至少 4 页的 google 和文档,但似乎除非我创建一个 genrule 并在规则中手动指定所有 100 个文件,否则它不会起作用?