| 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("../../utils/invoke_dart.gni") | 5 import("../../build/executable_suffix.gni") |
| 6 import("../../build/prebuilt_dart_sdk.gni") |
| 6 | 7 |
| 7 # Currently paths here are hard coded for convenience in building Mojo/Flutter. | 8 # Currently paths here are hard coded for convenience in building Mojo/Flutter. |
| 8 declare_args() { | 9 declare_args() { |
| 9 # Specify the path to a host compatible version of the Dart SDK. | 10 # Specify the path to a host compatible version of the Dart SDK. |
| 10 # This SDK is used to compile the Observatory frontend sources. | 11 # This SDK is used to compile the Observatory frontend sources. |
| 11 dart_host_sdk = rebase_path("//third_party/dart-sdk/dart-sdk") | 12 dart_host_sdk = rebase_path("//third_party/dart-sdk/dart-sdk") |
| 12 | 13 |
| 13 # Specify the path to a host compatible version of pub. | 14 # Specify the path to a host compatible version of pub. |
| 14 # This is used to compile the Observatory frontend sources. | 15 # This is used to compile the Observatory frontend sources. |
| 15 # | 16 # |
| 16 # The observatory build tool searches for pub first using this GN arg, then | 17 # The observatory build tool searches for pub first using this GN arg, then |
| 17 # for the checked-in SDK, and if that doesn't work, it uses the dart_bootstrap | 18 # for the checked-in SDK, and if that doesn't work, it uses the dart_bootstrap |
| 18 # built as part of the build to invoke pub. If this arg is set to a non-empty | 19 # built as part of the build to invoke pub. If this arg is set to a non-empty |
| 19 # string, we assume that there is no need for dart_bootstrap. If it is set to | 20 # string, we assume that there is no need for dart_bootstrap. If it is set to |
| 20 # "", then we assume that there may be a need for dart_bootstrap. | 21 # "", then we assume that there may be a need for dart_bootstrap. |
| 21 dart_host_pub_exe = rebase_path("$dart_host_sdk/bin/pub") | 22 dart_host_pub_exe = rebase_path("$dart_host_sdk/bin/pub") |
| 22 } | 23 } |
| 23 | 24 |
| 24 # Construct arguments to the observatory tool for finding pub. | 25 # Construct arguments to the observatory tool for finding pub. |
| 25 pub_build_deps = [] | 26 pub_build_deps = [] |
| 26 pub_build_args = [] | 27 pub_build_args = [] |
| 27 if (dart_host_pub_exe != "") { | 28 if (dart_host_pub_exe != "") { |
| 28 pub_build_args = [ | 29 pub_build_args = [ |
| 29 "--pub-executable", | 30 "--pub-executable", |
| 30 dart_host_pub_exe, | 31 dart_host_pub_exe, |
| 31 ] | 32 ] |
| 32 } else { | 33 } else if (!prebuilt_dart_exe_works) { |
| 33 pub_build_deps += [ "../bin:dart_bootstrap($host_toolchain)" ] | 34 pub_build_deps += [ "../bin:dart_bootstrap($host_toolchain)" ] |
| 34 | 35 |
| 35 dart_out_dir = | 36 dart_out_dir = |
| 36 get_label_info("../bin:dart_bootstrap($host_toolchain)", "root_out_dir") | 37 get_label_info("../bin:dart_bootstrap($host_toolchain)", "root_out_dir") |
| 37 dart_bootstrap = | 38 dart_bootstrap = rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") |
| 38 rebase_path("$dart_out_dir/dart_bootstrap$dart_executable_suffix") | |
| 39 | 39 |
| 40 pub_build_args = [ | 40 pub_build_args = [ |
| 41 "--sdk=True", | 41 "--sdk=True", |
| 42 "--dart-executable", | 42 "--dart-executable", |
| 43 dart_bootstrap, | 43 dart_bootstrap, |
| 44 ] | 44 ] |
| 45 } else { |
| 46 pub_build_args = [ "--sdk=True" ] |
| 45 } | 47 } |
| 46 | 48 |
| 47 current_dir = rebase_path(".", "//") | 49 current_dir = rebase_path(".", "//") |
| 48 | 50 |
| 49 # Helper build rules for packaging the Dart observatory resources. | 51 # Helper build rules for packaging the Dart observatory resources. |
| 50 observatory_sources_gypi = | 52 observatory_sources_gypi = |
| 51 exec_script("../../tools/gypi_to_gn.py", | 53 exec_script("../../tools/gypi_to_gn.py", |
| 52 [ rebase_path("../observatory/observatory_sources.gypi") ], | 54 [ rebase_path("../observatory/observatory_sources.gypi") ], |
| 53 "scope", | 55 "scope", |
| 54 [ "../observatory/observatory_sources.gypi" ]) | 56 [ "../observatory/observatory_sources.gypi" ]) |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 234 |
| 233 source_set("standalone_observatory_archive") { | 235 source_set("standalone_observatory_archive") { |
| 234 deps = [ | 236 deps = [ |
| 235 ":standalone_archive_observatory", | 237 ":standalone_archive_observatory", |
| 236 ] | 238 ] |
| 237 | 239 |
| 238 sources = [ | 240 sources = [ |
| 239 rebase_path("$root_gen_dir/observatory/standalone_archive_observatory.cc"), | 241 rebase_path("$root_gen_dir/observatory/standalone_archive_observatory.cc"), |
| 240 ] | 242 ] |
| 241 } | 243 } |
| OLD | NEW |