OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("../../build/executable_suffix.gni") | 5 import("../../build/executable_suffix.gni") |
6 import("../../build/prebuilt_dart_sdk.gni") | 6 import("../../build/prebuilt_dart_sdk.gni") |
7 import("../../build/dart_host_toolchain.gni") | 7 import("../../build/dart_host_toolchain.gni") |
| 8 import("observatory_sources.gni") |
8 | 9 |
9 # Construct arguments to the observatory tool for finding pub. | 10 # Construct arguments to the observatory tool for finding pub. |
10 pub_build_deps = [] | 11 pub_build_deps = [] |
11 pub_build_args = [] | 12 pub_build_args = [] |
12 if (!prebuilt_dart_exe_works) { | 13 if (!prebuilt_dart_exe_works) { |
13 pub_build_deps += [ "../bin:dart_bootstrap($dart_host_toolchain)" ] | 14 pub_build_deps += [ "../bin:dart_bootstrap($dart_host_toolchain)" ] |
14 | 15 |
15 dart_out_dir = get_label_info("../bin:dart_bootstrap($dart_host_toolchain)", | 16 dart_out_dir = get_label_info("../bin:dart_bootstrap($dart_host_toolchain)", |
16 "root_out_dir") | 17 "root_out_dir") |
17 dart_bootstrap = rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") | 18 dart_bootstrap = rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") |
18 | 19 |
19 pub_build_args = [ | 20 pub_build_args = [ |
20 "--sdk=True", | 21 "--sdk=True", |
21 "--dart-executable", | 22 "--dart-executable", |
22 dart_bootstrap, | 23 dart_bootstrap, |
23 ] | 24 ] |
24 } else { | 25 } else { |
25 pub_build_args = [ "--sdk=True" ] | 26 pub_build_args = [ "--sdk=True" ] |
26 } | 27 } |
27 | 28 |
28 current_dir = rebase_path(".", "//") | 29 current_dir = rebase_path(".", "//") |
29 | 30 |
30 # Helper build rules for packaging the Dart observatory resources. | 31 # Helper build rules for packaging the Dart observatory resources. |
31 observatory_sources_gypi = | |
32 exec_script("../../tools/gypi_to_gn.py", | |
33 [ rebase_path("../observatory/observatory_sources.gypi") ], | |
34 "scope", | |
35 [ "../observatory/observatory_sources.gypi" ]) | |
36 | |
37 copy("copy_observatory") { | 32 copy("copy_observatory") { |
38 sources = rebase_path(observatory_sources_gypi.sources, "", ".") | 33 sources = rebase_path(observatory_sources, "", ".") |
39 outputs = [ | 34 outputs = [ |
40 "$root_gen_dir/observatory_copy/{{source_root_relative_dir}}/{{source_file_p
art}}", | 35 "$root_gen_dir/observatory_copy/{{source_root_relative_dir}}/{{source_file_p
art}}", |
41 ] | 36 ] |
42 } | 37 } |
43 | 38 |
44 action("write_observatory_pubspec_yaml") { | 39 action("write_observatory_pubspec_yaml") { |
45 deps = [ ":copy_observatory" ] + pub_build_deps | 40 deps = [ ":copy_observatory" ] + pub_build_deps |
46 | 41 |
47 inputs = [ | 42 inputs = [ |
48 rebase_path("pubspec.yaml"), | 43 rebase_path("pubspec.yaml"), |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 "$root_gen_dir/observatory_copy/$current_dir/packages.stamp", | 85 "$root_gen_dir/observatory_copy/$current_dir/packages.stamp", |
91 ] | 86 ] |
92 } | 87 } |
93 | 88 |
94 action("pub_build_observatory") { | 89 action("pub_build_observatory") { |
95 deps = [ | 90 deps = [ |
96 ":copy_observatory", | 91 ":copy_observatory", |
97 ":copy_observatory_deps", | 92 ":copy_observatory_deps", |
98 ] + pub_build_deps | 93 ] + pub_build_deps |
99 | 94 |
100 sources = rebase_path(observatory_sources_gypi.sources, | 95 sources = rebase_path(observatory_sources, |
101 "", | 96 "", |
102 "$root_gen_dir/observatory_copy/$current_dir") | 97 "$root_gen_dir/observatory_copy/$current_dir") |
103 | 98 |
104 inputs = | 99 inputs = |
105 sources + [ "$root_gen_dir/observatory_copy/$current_dir/packages.stamp" ] | 100 sources + [ "$root_gen_dir/observatory_copy/$current_dir/packages.stamp" ] |
106 | 101 |
107 script = "../../tools/observatory_tool.py" | 102 script = "../../tools/observatory_tool.py" |
108 args = pub_build_args + [ | 103 args = pub_build_args + [ |
109 "--silent=True", | 104 "--silent=True", |
110 "--directory", | 105 "--directory", |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 208 |
214 source_set("standalone_observatory_archive") { | 209 source_set("standalone_observatory_archive") { |
215 deps = [ | 210 deps = [ |
216 ":standalone_archive_observatory", | 211 ":standalone_archive_observatory", |
217 ] | 212 ] |
218 | 213 |
219 sources = [ | 214 sources = [ |
220 rebase_path("$root_gen_dir/observatory/standalone_archive_observatory.cc"), | 215 rebase_path("$root_gen_dir/observatory/standalone_archive_observatory.cc"), |
221 ] | 216 ] |
222 } | 217 } |
OLD | NEW |