Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1779)

Unified Diff: build/copy_tree.gni

Issue 2848943003: [infra] Assembles the SDK using GN rather than create_sdk.py (Closed)
Patch Set: Move copy_dev_compiler_tools out of the default full SDK build Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/win/BUILD.gn ('k') | build/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/copy_tree.gni
diff --git a/build/copy_tree.gni b/build/copy_tree.gni
new file mode 100644
index 0000000000000000000000000000000000000000..b3a4c0c298500121f2cd111b9aa6f287c0315876
--- /dev/null
+++ b/build/copy_tree.gni
@@ -0,0 +1,57 @@
+# 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
+ }
+}
« no previous file with comments | « build/config/win/BUILD.gn ('k') | build/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698