| Index: runtime/observatory/BUILD.gn
|
| diff --git a/runtime/observatory/BUILD.gn b/runtime/observatory/BUILD.gn
|
| index 3943253ca45cb305c75f978f8205e03b9fe49a29..a476414b477f8722685288e99add32551c7c5f79 100644
|
| --- a/runtime/observatory/BUILD.gn
|
| +++ b/runtime/observatory/BUILD.gn
|
| @@ -41,23 +41,24 @@ action("write_observatory_pubspec_yaml") {
|
| rebase_path("pubspec.yaml"),
|
| ]
|
|
|
| + current_dir = rebase_path(".", "//")
|
| args = [
|
| "--silent=True",
|
| "--pub-executable",
|
| dart_host_pub_exe,
|
| "--directory",
|
| - rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"),
|
| + rebase_path("$root_gen_dir/observatory_copy/$current_dir/"),
|
| "--command",
|
| "rewrite",
|
| rebase_path("../observatory/pubspec.yaml"),
|
| rebase_path(
|
| - "$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml"),
|
| + "$root_gen_dir/observatory_copy/$current_dir/pubspec.yaml"),
|
| "../../third_party/",
|
| rebase_path("../../third_party/"),
|
| ]
|
|
|
| outputs = [
|
| - "$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml",
|
| + "$root_gen_dir/observatory_copy/$current_dir/pubspec.yaml",
|
| ]
|
| }
|
|
|
| @@ -68,9 +69,10 @@ action("copy_observatory_deps") {
|
|
|
| script = "../../tools/observatory_tool.py"
|
|
|
| + current_dir = rebase_path(".", "//")
|
| inputs = [
|
| script,
|
| - "$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml",
|
| + "$root_gen_dir/observatory_copy/$current_dir/pubspec.yaml",
|
| ]
|
|
|
| args = [
|
| @@ -78,23 +80,24 @@ action("copy_observatory_deps") {
|
| "--pub-executable",
|
| dart_host_pub_exe,
|
| "--stamp",
|
| - rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/packages.stamp"),
|
| + rebase_path("$root_gen_dir/observatory_copy/$current_dir/packages.stamp"),
|
| "--directory",
|
| - rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"),
|
| + rebase_path("$root_gen_dir/observatory_copy/$current_dir/"),
|
| "--command",
|
| "get",
|
| ]
|
|
|
| outputs = [
|
| - "$root_gen_dir/observatory_copy/dart/runtime/observatory/packages.stamp",
|
| + "$root_gen_dir/observatory_copy/$current_dir/packages.stamp",
|
| ]
|
| }
|
|
|
| action("pub_build_observatory") {
|
| + current_dir = rebase_path(".", "//")
|
| sources =
|
| rebase_path(observatory_sources_gypi.sources,
|
| "",
|
| - "$root_gen_dir/observatory_copy/dart/runtime/observatory")
|
| + "$root_gen_dir/observatory_copy/$current_dir")
|
|
|
| deps = [
|
| ":copy_observatory",
|
| @@ -105,7 +108,7 @@ action("pub_build_observatory") {
|
|
|
| inputs = [
|
| script,
|
| - "$root_gen_dir/observatory_copy/dart/runtime/observatory/packages.stamp",
|
| + "$root_gen_dir/observatory_copy/$current_dir/packages.stamp",
|
| ]
|
| inputs += sources
|
|
|
| @@ -114,7 +117,7 @@ action("pub_build_observatory") {
|
| "--pub-executable",
|
| dart_host_pub_exe,
|
| "--directory",
|
| - rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"),
|
| + rebase_path("$root_gen_dir/observatory_copy/$current_dir/"),
|
| "--command",
|
| "build",
|
| rebase_path("$root_out_dir/observatory/build"),
|
| @@ -152,41 +155,70 @@ action("deploy_observatory") {
|
| ]
|
| }
|
|
|
| -action("archive_observatory") {
|
| - deps = [
|
| - ":deploy_observatory",
|
| - ]
|
| +template("observatory_archive") {
|
| + assert(defined(invoker.inner_namespace),
|
| + "Need inner_namespace in $target_name")
|
| + assert(defined(invoker.outer_namespace),
|
| + "Need outer_namespace in $target_name")
|
| + action(target_name) {
|
| + deps = [
|
| + ":deploy_observatory",
|
| + ]
|
|
|
| - script = "../tools/create_archive.py"
|
| + script = "../tools/create_archive.py"
|
|
|
| inputs = [
|
| script,
|
| "$root_out_dir/observatory/deployed/web/main.dart.js",
|
| ]
|
|
|
| - args = [
|
| - "--output",
|
| - rebase_path("$root_gen_dir/observatory/observatory_archive.cc"),
|
| - "--tar_output",
|
| - rebase_path("$root_gen_dir/observatory/observatory_archive.tar"),
|
| - "--outer_namespace", "dart",
|
| - "--inner_namespace", "observatory",
|
| - "--name", "observatory_assets_archive",
|
| - "--client_root", rebase_path("$root_out_dir/observatory/deployed/web/"),
|
| + inner_namespace = invoker.inner_namespace
|
| + outer_namespace = invoker.outer_namespace
|
| + output_name = target_name
|
| + args = [
|
| + "--output",
|
| + rebase_path("$root_gen_dir/observatory/${output_name}.cc"),
|
| + "--tar_output",
|
| + rebase_path("$root_gen_dir/observatory/${output_name}.tar"),
|
| + "--outer_namespace", outer_namespace,
|
| + "--inner_namespace", inner_namespace,
|
| + "--name", "observatory_assets_archive",
|
| + "--client_root", rebase_path("$root_out_dir/observatory/deployed/web/"),
|
| + ]
|
| +
|
| + outputs = [
|
| + "$root_gen_dir/observatory/${output_name}.cc",
|
| + "$root_gen_dir/observatory/${output_name}.tar",
|
| + ]
|
| + }
|
| +}
|
| +
|
| +observatory_archive("embedded_archive_observatory") {
|
| + outer_namespace = "dart"
|
| + inner_namespace = "observatory"
|
| +}
|
| +
|
| +source_set("embedded_observatory_archive") {
|
| + deps = [
|
| + ":embedded_archive_observatory",
|
| ]
|
|
|
| - outputs = [
|
| - "$root_gen_dir/observatory/observatory_archive.cc",
|
| - "$root_gen_dir/observatory/observatory_archive.tar",
|
| + sources = [
|
| + rebase_path("$root_gen_dir/observatory/embedded_archive_observatory.cc"),
|
| ]
|
| }
|
|
|
| -source_set("embedded_observatory_archive") {
|
| +observatory_archive("standalone_archive_observatory") {
|
| + outer_namespace = "dart"
|
| + inner_namespace = "bin"
|
| +}
|
| +
|
| +source_set("standalone_observatory_archive") {
|
| deps = [
|
| - ":archive_observatory",
|
| + ":standalone_archive_observatory",
|
| ]
|
|
|
| sources = [
|
| - rebase_path("$root_gen_dir/observatory/observatory_archive.cc"),
|
| + rebase_path("$root_gen_dir/observatory/standalone_archive_observatory.cc"),
|
| ]
|
| }
|
|
|