Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 # Currently paths here are hard coded for convenience in building Mojo/Flutter. | |
| 6 declare_args() { | |
| 7 # Specify the path to a host compatible version of the Dart SDK. | |
| 8 # This SDK is used to compile the Observatory frontend sources. | |
| 9 dart_host_sdk = rebase_path("//third_party/dart-sdk/dart-sdk") | |
| 10 | |
| 11 # Specify the path to a host compatible version of pub. | |
| 12 # This is used to compile the Observatory frontend sources. | |
| 13 dart_host_pub_exe = rebase_path("$dart_host_sdk/pub") | |
|
rmacnak
2015/10/26 22:17:24
$dart_host_sdk/bin/pub
| |
| 14 } | |
| 15 | |
| 16 # Helper build rules for packaging the Dart observatory resources. | |
| 17 observatory_sources_gypi = | |
| 18 exec_script("../../tools/gypi_to_gn.py", | |
| 19 [ rebase_path( | |
| 20 "//dart/runtime/observatory/observatory_sources.gypi") ], | |
| 21 "scope", | |
| 22 [ "//dart/runtime/observatory/observatory_sources.gypi" ]) | |
| 23 | |
| 24 copy("copy_observatory") { | |
| 25 sources = rebase_path(observatory_sources_gypi.sources, | |
| 26 "", | |
| 27 ".") | |
| 28 outputs = [ | |
| 29 "$root_gen_dir/observatory_copy/{{source_root_relative_dir}}/{{source_file_p art}}", | |
| 30 ] | |
| 31 } | |
| 32 | |
| 33 action("write_observatory_pubspec_yaml") { | |
| 34 deps = [ | |
| 35 ":copy_observatory", | |
| 36 ] | |
| 37 | |
| 38 script = "../../tools/observatory_tool.py" | |
| 39 | |
| 40 inputs = [ | |
| 41 rebase_path("pubspec.yaml"), | |
| 42 ] | |
| 43 | |
| 44 args = [ | |
| 45 "--silent=True", | |
| 46 "--pub-executable", | |
| 47 rebase_path("//third_party/dart-sdk/dart-sdk/bin/pub"), | |
| 48 "--directory", | |
| 49 rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"), | |
| 50 "--command", | |
| 51 "rewrite", | |
| 52 rebase_path("//dart/runtime/observatory/pubspec.yaml"), | |
| 53 rebase_path( | |
| 54 "$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml"), | |
| 55 "../../third_party/", | |
| 56 rebase_path("../../../dart/third_party/"), | |
| 57 ] | |
| 58 | |
| 59 outputs = [ | |
| 60 "$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml", | |
| 61 ] | |
| 62 } | |
| 63 | |
| 64 action("copy_observatory_deps") { | |
| 65 deps = [ | |
| 66 ":write_observatory_pubspec_yaml", | |
| 67 ] | |
| 68 | |
| 69 script = "//dart/tools/observatory_tool.py" | |
| 70 | |
| 71 inputs = [ | |
| 72 script, | |
| 73 "$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml", | |
| 74 ] | |
| 75 | |
| 76 args = [ | |
| 77 "--silent=True", | |
| 78 "--pub-executable", | |
| 79 rebase_path("//third_party/dart-sdk/dart-sdk/bin/pub"), | |
|
rmacnak
2015/10/26 22:17:24
$dart_host_pub_exe
| |
| 80 "--directory", | |
| 81 rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"), | |
| 82 "--command", | |
| 83 "get", | |
| 84 ] | |
| 85 | |
| 86 outputs = [ | |
| 87 "$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.lock", | |
| 88 ] | |
| 89 } | |
| 90 | |
| 91 action("pub_build_observatory") { | |
| 92 sources = | |
| 93 rebase_path(observatory_sources_gypi.sources, | |
| 94 "", | |
| 95 "$root_gen_dir/observatory_copy/dart/runtime/observatory") | |
| 96 | |
| 97 deps = [ | |
| 98 ":copy_observatory", | |
| 99 ":copy_observatory_deps", | |
| 100 ] | |
| 101 | |
| 102 script = "//dart/tools/observatory_tool.py" | |
| 103 | |
| 104 inputs = [ | |
| 105 script, | |
| 106 ] | |
| 107 inputs += sources | |
| 108 | |
| 109 args = [ | |
| 110 "--silent=True", | |
| 111 "--pub-executable", | |
| 112 rebase_path("//third_party/dart-sdk/dart-sdk/bin/pub"), | |
|
rmacnak
2015/10/26 22:17:24
$dart_host_pub_exe
| |
| 113 "--directory", | |
| 114 rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"), | |
| 115 "--command", | |
| 116 "build", | |
| 117 rebase_path("$root_out_dir/observatory/build"), | |
| 118 ] | |
| 119 | |
| 120 outputs = [ | |
| 121 "$root_out_dir/observatory/build/web/index.html", | |
| 122 "$root_out_dir/observatory/build/web/index.html.polymer.bootstrap.dart.js", | |
| 123 ] | |
| 124 } | |
| 125 | |
| 126 action("deploy_observatory") { | |
| 127 deps = [ | |
| 128 ":pub_build_observatory", | |
| 129 ] | |
| 130 | |
| 131 script = "//dart/tools/observatory_tool.py" | |
| 132 | |
| 133 inputs = [ | |
| 134 script, | |
| 135 "$root_out_dir/observatory/build/web/index.html", | |
| 136 "$root_out_dir/observatory/build/web/index.html.polymer.bootstrap.dart.js", | |
| 137 ] | |
| 138 | |
| 139 args = [ | |
| 140 "--silent=True", | |
| 141 "--pub-executable", | |
| 142 rebase_path("//third_party/dart-sdk/dart-sdk/bin/pub"), | |
|
rmacnak
2015/10/26 22:17:24
$dart_host_pub_exe
| |
| 143 "--directory", | |
| 144 rebase_path("$root_out_dir/observatory"), | |
| 145 "--command", | |
| 146 "deploy", | |
| 147 ] | |
| 148 | |
| 149 outputs = [ | |
| 150 "$root_out_dir/observatory/deployed/web/index.html", | |
| 151 "$root_out_dir/observatory/deployed/web/index.html.polymer.bootstrap.dart.js ", | |
| 152 ] | |
| 153 } | |
| 154 | |
| 155 action("archive_observatory") { | |
| 156 deps = [ | |
| 157 ":deploy_observatory", | |
| 158 ] | |
| 159 | |
| 160 script = "//dart/runtime/tools/create_archive.py" | |
| 161 | |
| 162 inputs = [ | |
| 163 script, | |
| 164 "$root_out_dir/observatory/deployed/web/index.html", | |
| 165 "$root_out_dir/observatory/deployed/web/index.html.polymer.bootstrap.dart.js ", | |
| 166 ] | |
| 167 | |
| 168 args = [ | |
| 169 "--output", | |
| 170 rebase_path("$root_gen_dir/observatory/observatory_archive.cc"), | |
| 171 "--tar_output", | |
| 172 rebase_path("$root_gen_dir/observatory/observatory_archive.tar"), | |
| 173 "--outer_namespace", "dart", | |
| 174 "--inner_namespace", "observatory", | |
| 175 "--name", "observatory_assets_archive", | |
| 176 "--client_root", rebase_path("$root_out_dir/observatory/deployed/web/"), | |
| 177 ] | |
| 178 | |
| 179 outputs = [ | |
| 180 "$root_gen_dir/observatory/observatory_archive.cc", | |
| 181 "$root_gen_dir/observatory/observatory_archive.tar", | |
| 182 ] | |
| 183 } | |
| OLD | NEW |