d907fbb72b
Change-Id: I417ff793567a8adbbc4cc4fd4f77792c9a451f89 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506280 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
88 lines
2.6 KiB
Plaintext
88 lines
2.6 KiB
Plaintext
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
_dart_root = rebase_path("../..")
|
|
|
|
# copy_tree() copies a directory tree rooted at `source` to `dest`, which should
|
|
# be somewhere under $root_out_dir.
|
|
#
|
|
# When dest is a subdirectory of the dest of a different copy_tree() target,
|
|
# the target whose dest is the subdirectory should include the target whose
|
|
# dest is the parent directory in its "deps" list. This prevents races on
|
|
# directory creation that could happen if the two targets were executed
|
|
# concurrently.
|
|
#
|
|
# Optional parameters:
|
|
# exclude - A comma separated list that is passed to shutil.ignore_patterns()
|
|
# in tools/copy_tree.py.
|
|
template("copy_tree") {
|
|
assert(defined(invoker.source), "copy_tree must define 'source'")
|
|
assert(defined(invoker.dest), "copy_tree must define 'dest'")
|
|
source = invoker.source
|
|
dest = invoker.dest
|
|
action(target_name) {
|
|
if (defined(invoker.visibility)) {
|
|
visibility = invoker.visibility
|
|
}
|
|
|
|
deps = []
|
|
if (defined(invoker.deps)) {
|
|
deps += invoker.deps
|
|
}
|
|
|
|
depfile = "$target_gen_dir/$target_name.d"
|
|
stampfile = "$target_gen_dir/$target_name.stamp"
|
|
|
|
common_args = [
|
|
"--from",
|
|
rebase_path(source, root_build_dir),
|
|
"--to",
|
|
rebase_path(dest, root_build_dir),
|
|
"--depfile",
|
|
rebase_path(depfile, root_build_dir),
|
|
"--stamp",
|
|
rebase_path(stampfile, root_build_dir),
|
|
]
|
|
if (defined(invoker.exclude)) {
|
|
common_args += [
|
|
"--exclude",
|
|
invoker.exclude,
|
|
]
|
|
}
|
|
|
|
outputs = [ stampfile ]
|
|
script = "$_dart_root/tools/copy_tree.py"
|
|
args = common_args
|
|
}
|
|
}
|
|
|
|
# DEPRECATED: This can be removed after the uses in the flutter/engine tree
|
|
# are migrated to use copy_tree().
|
|
template("copy_trees") {
|
|
assert(defined(invoker.sources), "$target_name must define 'source'")
|
|
sources = invoker.sources
|
|
copy_tree_source_paths = []
|
|
foreach(copy_tree_spec, sources) {
|
|
copy_tree_source_paths += [
|
|
rebase_path(copy_tree_spec.source),
|
|
copy_tree_spec.ignore_patterns,
|
|
]
|
|
}
|
|
|
|
# A list of lists of input source files for copy_tree.
|
|
foreach(copy_tree_spec, sources) {
|
|
copy_tree(copy_tree_spec.target) {
|
|
visibility = copy_tree_spec.visibility
|
|
source = copy_tree_spec.source
|
|
dest = copy_tree_spec.dest
|
|
if (defined(copy_tree_spec.deps)) {
|
|
deps = copy_tree_spec.deps
|
|
}
|
|
if (copy_tree_spec.ignore_patterns != "{}") {
|
|
exclude = copy_tree_spec.ignore_patterns
|
|
}
|
|
}
|
|
}
|
|
}
|