Chromium Code Reviews| Index: runtime/vm/BUILD.gn |
| diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn |
| index 0634496bc59b76a131deec048f35c97d6ad484c1..fe20b99c3c4256c9bd3ffe4816187dd95f54a814 100644 |
| --- a/runtime/vm/BUILD.gn |
| +++ b/runtime/vm/BUILD.gn |
| @@ -415,130 +415,128 @@ template("concatenate_patch") { |
| } |
| if (!defined(is_fuchsia) || !is_fuchsia) { |
| + template("generate_patched_sdk") { |
| + assert(defined(invoker.libraries), "Need libraries in $target_name") |
| -template("generate_patched_sdk") { |
| - assert(defined(invoker.libraries), "Need libraries in $target_name") |
| + concatenation_target_names = [] |
| + concatenation_files = [] |
| - concatenation_target_names = [] |
| - concatenation_files = [] |
| + # Concatenate vm library patches. |
| + foreach(library, invoker.libraries) { |
| + name = library[1] |
| - # Concatenate vm library patches. |
| - foreach(library, invoker.libraries) { |
| - name = library[1] |
| + target_output = "$target_gen_dir/patches/${name}_patch.dart" |
| + concatenate_patch("concatenate_${name}_patch") { |
| + libname = name |
| + dir = library[0] |
| + output = target_output |
| + } |
| + concatenation_target_names += [ ":concatenate_${name}_patch" ] |
| + concatenation_files += [ target_output ] |
| + } |
| - target_output = "$target_gen_dir/patches/${name}_patch.dart" |
| - concatenate_patch("concatenate_${name}_patch") { |
| - libname = name |
| - dir = library[0] |
| - output = target_output |
| + # Build the patched sdk out of the concatenated patches and the special |
| + # libraries. |
| + action(target_name) { |
| + deps = concatenation_target_names |
| + |
| + patches_dir = "$target_gen_dir/patches" |
| + patched_sdk_dir = "$root_out_dir/patched_sdk" |
|
Vyacheslav Egorov (Google)
2016/11/01 09:05:38
This is the only line that has changed.
Here $ta
|
| + |
| + script = "../../tools/patch_sdk.py" |
| + |
| + # We list all files which make up the sdk (modulo patches) and get them back |
| + # as a GN list object. |
| + shared_sdk_sources = exec_script("../../tools/list_dart_files.py", |
| + [ "../../sdk/lib" ], |
| + "list lines") |
| + |
| + # We list the `patch_sdk.dart` tool here because the [script] (which is |
| + # implicitly an input) will call it. |
| + inputs = [ |
| + "../../tools/patch_sdk.dart", |
| + ] |
| + |
| + # Files below are not patches, they will not be in [concatenation_files] but |
| + # the `patch_sdk.dart` script will copy them into the patched sdk. |
| + inputs += [ |
| + "../lib/typed_data.dart", |
| + "../bin/builtin.dart", |
| + "../bin/vmservice/vmservice_io.dart", |
| + "../bin/vmservice/loader.dart", |
| + "../bin/vmservice/server.dart", |
| + ] |
| + |
| + # Add all the normal sdk sources. |
| + inputs += shared_sdk_sources |
| + |
| + # Add all the concatenated patch files. |
| + inputs += concatenation_files |
| + |
| + outputs = [ |
| + # Instead of listing all outputs we list a single well-known one. |
| + "${patched_sdk_dir}/lib/core/core.dart", |
| + ] |
| + |
| + args = [ |
| + "vm", |
| + rebase_path("../../sdk"), |
| + rebase_path(patches_dir, root_build_dir), |
| + rebase_path(patched_sdk_dir, root_build_dir), |
| + ] |
| } |
| - concatenation_target_names += [ ":concatenate_${name}_patch" ] |
| - concatenation_files += [ target_output ] |
| } |
| - # Build the patched sdk out of the concatenated patches and the special |
| - # libraries. |
| - action(target_name) { |
| - deps = concatenation_target_names |
| - |
| - patches_dir = "$target_gen_dir/patches" |
| - patched_sdk_dir = "$target_gen_dir/patched_sdk" |
| - |
| - script = "../../tools/patch_sdk.py" |
| - |
| - # We list all files which make up the sdk (modulo patches) and get them back |
| - # as a GN list object. |
| - shared_sdk_sources = exec_script("../../tools/list_dart_files.py", |
| - [ "../../sdk/lib" ], |
| - "list lines") |
| - |
| - # We list the `patch_sdk.dart` tool here because the [script] (which is |
| - # implicitly an input) will call it. |
| - inputs = [ |
| - "../../tools/patch_sdk.dart", |
| - ] |
| - |
| - # Files below are not patches, they will not be in [concatenation_files] but |
| - # the `patch_sdk.dart` script will copy them into the patched sdk. |
| - inputs += [ |
| - "../lib/typed_data.dart", |
| - "../bin/builtin.dart", |
| - "../bin/vmservice/vmservice_io.dart", |
| - "../bin/vmservice/loader.dart", |
| - "../bin/vmservice/server.dart", |
| - ] |
| - |
| - # Add all the normal sdk sources. |
| - inputs += shared_sdk_sources |
| - |
| - # Add all the concatenated patch files. |
| - inputs += concatenation_files |
| - |
| - outputs = [ |
| - # Instead of listing all outputs we list a single well-known one. |
| - "${patched_sdk_dir}/lib/core/core.dart", |
| - ] |
| - |
| - args = [ |
| - "vm", |
| - rebase_path("../../sdk"), |
| - rebase_path(patches_dir, root_build_dir), |
| - rebase_path(patched_sdk_dir, root_build_dir), |
| + generate_patched_sdk("patched_sdk") { |
| + libraries = [ |
| + [ |
| + "lib", |
| + "async", |
| + ], |
| + [ |
| + "lib", |
| + "collection", |
| + ], |
| + [ |
| + "lib", |
| + "convert", |
| + ], |
| + [ |
| + "lib", |
| + "core", |
| + ], |
| + [ |
| + "lib", |
| + "developer", |
| + ], |
| + [ |
| + "lib", |
| + "internal", |
| + ], |
| + [ |
| + "lib", |
| + "isolate", |
| + ], |
| + [ |
| + "lib", |
| + "math", |
| + ], |
| + [ |
| + "lib", |
| + "mirrors", |
| + ], |
| + [ |
| + "lib", |
| + "profiler", |
| + ], |
| + [ |
| + "lib", |
| + "vmservice", |
| + ], |
| + [ |
| + "bin", |
| + "io", |
| + ], |
| ] |
| } |
| } |
| - |
| -generate_patched_sdk("patched_sdk") { |
| - libraries = [ |
| - [ |
| - "lib", |
| - "async", |
| - ], |
| - [ |
| - "lib", |
| - "collection", |
| - ], |
| - [ |
| - "lib", |
| - "convert", |
| - ], |
| - [ |
| - "lib", |
| - "core", |
| - ], |
| - [ |
| - "lib", |
| - "developer", |
| - ], |
| - [ |
| - "lib", |
| - "internal", |
| - ], |
| - [ |
| - "lib", |
| - "isolate", |
| - ], |
| - [ |
| - "lib", |
| - "math", |
| - ], |
| - [ |
| - "lib", |
| - "mirrors", |
| - ], |
| - [ |
| - "lib", |
| - "profiler", |
| - ], |
| - [ |
| - "lib", |
| - "vmservice", |
| - ], |
| - [ |
| - "bin", |
| - "io", |
| - ], |
| - ] |
| -} |
| - |
| -} |