Index: sdk/BUILD.gn |
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn |
index 6ec91aeaba7524ef29cd30ff56dd321f3b11d584..82a9a1ab2334d3dd6bc691348a4aedc7d051e564 100644 |
--- a/sdk/BUILD.gn |
+++ b/sdk/BUILD.gn |
@@ -210,6 +210,103 @@ _analyzer_source_dirs = [ |
"kernel", |
] |
+# From here down to the copy_trees() invocation, we collect all the information |
+# about trees that need to be copied in the list of scopes, copy_tree_specs. |
+copy_tree_specs = [] |
+ |
+# This loop generates rules for copying analyzer sources into lib/ |
+foreach(analyzer_source_dir, _analyzer_source_dirs) { |
+ copy_tree_specs += [{ |
+ target = "copy_${analyzer_source_dir}_source_dir" |
+ visibility = [ ":copy_analyzer_sources" ] |
+ source = "../pkg/$analyzer_source_dir" |
+ dest = "$root_out_dir/dart-sdk/lib/$analyzer_source_dir" |
+ ignore_patterns = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore,packages,test,testcases" |
+ }] |
+} |
+ |
+# This rule copies dartdoc templates to |
+# bin/snapshots/resources/dartdoc/templates |
+copy_tree_specs += [{ |
+ target = "copy_dartdoc_templates" |
+ visibility = [ ":copy_dartdoc_files" ] |
+ source = "../third_party/pkg/dartdoc/lib/templates" |
+ dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/templates" |
+ ignore_patterns = "{}" |
+}] |
+ |
+# This rule copies dartdoc resources to |
+# bin/snapshots/resources/dartdoc/resources |
+copy_tree_specs += [{ |
+ target = "copy_dartdoc_resources" |
+ visibility = [ ":copy_dartdoc_files" ] |
+ source = "../third_party/pkg/dartdoc/lib/resources" |
+ dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/resources" |
+ ignore_patterns = "{}" |
+}] |
+ |
+# This rule copies js needed by ddc to lib/dev_compiler |
+copy_tree_specs += [{ |
+ target = "copy_dev_compiler_js" |
+ visibility = [ |
+ ":copy_dev_compiler_sdk", |
+ ":copy_dev_compiler_require_js", |
+ ":copy_dev_compiler_tools", |
+ ] |
+ source = "../pkg/dev_compiler/lib/js" |
+ dest = "$root_out_dir/dart-sdk/lib/dev_compiler" |
+ ignore_patterns = "{}" |
+}] |
+ |
+# This rule copies pub assets to lib/_internal/pub/asset |
+copy_tree_specs += [{ |
+ target = "copy_pub_assets" |
+ visibility = [ |
+ ":create_common_sdk", |
+ ":copy_7zip", |
+ ] |
+ deps = [ |
+ ":copy_libraries", |
+ ] |
+ source = "../third_party/pkg/pub/lib/src/asset" |
+ dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset" |
+ ignore_patterns = "{}" |
+}] |
+ |
+# This loop generates rules to copy libraries to lib/ |
+foreach(library, _full_sdk_libraries) { |
+ copy_tree_specs += [{ |
+ target = "copy_${library}_library" |
+ visibility = [ |
+ ":copy_platform_sdk_libraries", |
+ ":copy_full_sdk_libraries", |
+ ] |
+ source = "lib/$library" |
+ dest = "$root_out_dir/dart-sdk/lib/$library" |
+ ignore_patterns = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore" |
+ }] |
+} |
+ |
+if (is_win) { |
+ copy_tree_specs += [{ |
+ target = "copy_7zip" |
+ visibility = [ ":create_common_sdk" ] |
+ deps = [ |
+ ":copy_libraries", |
+ ":copy_pub_assets", |
+ ] |
+ source = "../third_party/7zip" |
+ dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset/7zip" |
+ ignore_patterns = ".svn" |
+ }] |
+} |
+ |
+# This generates targets for everything in copy_tree_specs. The targets have the |
+# same name as the "target" fields in the scopes of copy_tree_specs. |
+copy_trees("copy_trees") { |
+ sources = copy_tree_specs |
+} |
+ |
# Copies the Dart VM binary into bin/ |
copy("copy_dart") { |
visibility = [ ":create_common_sdk" ] |
@@ -372,16 +469,6 @@ group("copy_full_sdk_snapshots") { |
} |
} |
-# This loop generates rules for copying analyzer sources into lib/ |
-foreach(analyzer_source_dir, _analyzer_source_dirs) { |
- copy_tree("copy_${analyzer_source_dir}_source_dir") { |
- visibility = [ ":copy_analyzer_sources" ] |
- source = "../pkg/$analyzer_source_dir" |
- dest = "$root_out_dir/dart-sdk/lib/$analyzer_source_dir" |
- exclude = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore,packages,test,testcases" |
- } |
-} |
- |
# This is the main rule for copying analyzer sources to lib/ |
group("copy_analyzer_sources") { |
visibility = [ ":create_common_sdk" ] |
@@ -391,22 +478,6 @@ group("copy_analyzer_sources") { |
} |
} |
-# This rule copies dartdoc templates to |
-# bin/snapshots/resources/dartdoc/templates |
-copy_tree("copy_dartdoc_templates") { |
- visibility = [ ":copy_dartdoc_files" ] |
- source = "../third_party/pkg/dartdoc/lib/templates" |
- dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/templates" |
-} |
- |
-# This rule copies dartdoc resources to |
-# bin/snapshots/resources/dartdoc/resources |
-copy_tree("copy_dartdoc_resources") { |
- visibility = [ ":copy_dartdoc_files" ] |
- source = "../third_party/pkg/dartdoc/lib/resources" |
- dest = "$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/resources" |
-} |
- |
# This rule writes the .packages file for dartdoc resources. |
write_file("$root_out_dir/dart-sdk/bin/snapshots/resources/dartdoc/.packages", |
"dartdoc:.") |
@@ -481,17 +552,6 @@ copy("copy_dev_compiler_summary") { |
] |
} |
-# This rule copies js needed by ddc to lib/dev_compiler |
-copy_tree("copy_dev_compiler_js") { |
- visibility = [ |
- ":copy_dev_compiler_sdk", |
- ":copy_dev_compiler_require_js", |
- ":copy_dev_compiler_tools", |
- ] |
- source = "../pkg/dev_compiler/lib/js" |
- dest = "$root_out_dir/dart-sdk/lib/dev_compiler" |
-} |
- |
# This rule copies require.js to lib/dev_compiler/amd |
copy("copy_dev_compiler_require_js") { |
visibility = [ ":copy_dev_compiler_sdk" ] |
@@ -562,32 +622,6 @@ copy("copy_platform_files") { |
] |
} |
-# This rule copies pub assets to lib/_internal/pub/asset |
-copy_tree("copy_pub_assets") { |
- visibility = [ |
- ":create_common_sdk", |
- ":copy_7zip", |
- ] |
- deps = [ |
- ":copy_libraries", |
- ] |
- source = "../third_party/pkg/pub/lib/src/asset" |
- dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset" |
-} |
- |
-# This loop generates rules to copy libraries to lib/ |
-foreach(library, _full_sdk_libraries) { |
- copy_tree("copy_${library}_library") { |
- visibility = [ |
- ":copy_platform_sdk_libraries", |
- ":copy_full_sdk_libraries", |
- ] |
- source = "lib/$library" |
- dest = "$root_out_dir/dart-sdk/lib/$library" |
- exclude = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore" |
- } |
-} |
- |
# This is the main rule to copy libraries in _platform_sdk_libraries to lib/ |
group("copy_platform_sdk_libraries") { |
visibility = [ |
@@ -624,19 +658,6 @@ group("copy_libraries") { |
} |
} |
-if (is_win) { |
- copy_tree("copy_7zip") { |
- visibility = [ ":create_common_sdk" ] |
- deps = [ |
- ":copy_libraries", |
- ":copy_pub_assets", |
- ] |
- source = "../third_party/7zip" |
- dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset/7zip" |
- exclude = ".svn" |
- } |
-} |
- |
# This rule writes the version file. |
action("write_version_file") { |
visibility = [ ":create_common_sdk" ] |