mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 14:32:49 +00:00
81e428fd39
This has a few advantages: - We can track dependencies more precisely - ninja can assemble things in parallel as they're ready rather than sequentially all at once. - It is easier to customize SDKs depending on target platform, e.g. Fuchsia. This CL also has a number of cleanups: - Defining is_fuchsia and is_fuchsia host so we don't always have to check - Piping through toolchain overrides in more places - Fixing bugs in copy_tree.py, not using list_files.py, which is broken on Windows related #29558 R=whesse@google.com Review-Url: https://codereview.chromium.org/2848943003 .
58 lines
1.6 KiB
Plaintext
58 lines
1.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.
|
|
#
|
|
# 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
|
|
}
|
|
|
|
common_args = [
|
|
"--from",
|
|
rebase_path(source),
|
|
"--to",
|
|
rebase_path(dest),
|
|
]
|
|
if (defined(invoker.exclude)) {
|
|
common_args += [
|
|
"--exclude",
|
|
invoker.exclude,
|
|
]
|
|
}
|
|
|
|
dry_run_args = common_args + [ "--dry-run" ]
|
|
input_files = exec_script("$_dart_root/tools/copy_tree.py",
|
|
dry_run_args,
|
|
"list lines")
|
|
inputs = input_files
|
|
relative_files = rebase_path(input_files, rebase_path(source))
|
|
|
|
output_files = []
|
|
foreach(input, relative_files) {
|
|
output_files += [ "$dest/$input" ]
|
|
}
|
|
|
|
outputs = output_files
|
|
script = "$_dart_root/tools/copy_tree.py"
|
|
args = common_args
|
|
}
|
|
}
|