blob: 6d43a68f47251b0e1996ee0f342f5d523dd53d84 [file]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("dart_controller_no_snapshot") {
sources = [
"$target_gen_dir/dart_embedder_patch_resources.cc",
"$target_gen_dir/dart_embedder_service_isolate_resources.cc",
"builtin.cc",
"builtin.h",
"builtin_natives.cc",
"dart_controller.cc",
"dart_controller.h",
"isolate_data.h",
"mojo_natives.cc",
"mojo_natives.h",
]
deps = [
":generate_dart_embedder_patch_resources_cc",
":generate_dart_embedder_service_isolate_resources_cc",
"//base",
"//base:i18n",
"//crypto",
"//dart/runtime:libdart",
"//dart/runtime/bin:libdart_embedder_noio",
"//mojo/public/c/system",
"//mojo/public/cpp/system",
]
defines = []
if (is_debug) {
defines += [ "DEBUG" ]
} else {
defines += [ "NDEBUG" ]
}
include_dirs = [ "//dart/runtime" ]
}
action("generate_dart_embedder_patch_resources_cc") {
inputs = [
"//dart/runtime/tools/create_resources.py",
"//mojo/dart/embedder/core/natives_patch.dart",
]
output = "$target_gen_dir/dart_embedder_patch_resources.cc"
outputs = [
output,
]
# Patch files
natives_patch_path =
rebase_path("//mojo/dart/embedder/core/natives_patch.dart")
root_path = rebase_path("//mojo/dart/embedder/")
script = "//dart/runtime/tools/create_resources.py"
args = [
"--output",
rebase_path(output),
"--outer_namespace",
"mojo",
"--inner_namespace",
"dart",
"--table_name",
"dart_embedder_patch",
"--root_prefix",
root_path,
natives_patch_path,
]
}
action("generate_dart_embedder_service_isolate_resources_cc") {
deps = [
":deploy_observatory",
]
inputs = [
"//dart/runtime/tools/create_resources.py",
"//mojo/dart/embedder/vmservice/loader.dart",
"//mojo/dart/embedder/vmservice/main.dart",
"//mojo/dart/embedder/vmservice/resources.dart",
"//mojo/dart/embedder/vmservice/server.dart",
]
output = "$target_gen_dir/dart_embedder_service_isolate_resources.cc"
outputs = [
output,
]
root_path = rebase_path("//mojo/dart/embedder/")
script = "//dart/runtime/tools/create_resources.py"
# Source files
loader_path = rebase_path("//mojo/dart/embedder/vmservice/loader.dart")
main_path = rebase_path("//mojo/dart/embedder/vmservice/main.dart")
resources_path = rebase_path("//mojo/dart/embedder/vmservice/resources.dart")
server_path = rebase_path("//mojo/dart/embedder/vmservice/server.dart")
args = [
"--output",
rebase_path(output),
"--outer_namespace",
"mojo",
"--inner_namespace",
"dart",
"--table_name",
"dart_embedder_service_isolate",
"--root_prefix",
root_path,
"--client_root",
rebase_path("$root_out_dir/observatory/deployed/web/"),
# Source files
loader_path,
main_path,
resources_path,
server_path,
]
}
observatory_sources_gypi =
exec_script("../../../dart/tools/gypi_to_gn.py",
[ rebase_path(
"//dart/runtime/observatory/observatory_sources.gypi") ],
"scope",
[ "//dart/runtime/observatory/observatory_sources.gypi" ])
copy("copy_observatory") {
sources = rebase_path(observatory_sources_gypi.sources,
"",
"../../../dart/runtime/observatory")
outputs = [
"$root_gen_dir/observatory_copy/{{source_root_relative_dir}}/{{source_file_part}}",
]
}
action("write_observatory_pubspec_yaml") {
deps = [
":copy_observatory",
]
script = "//dart/tools/observatory_tool.py"
inputs = [
rebase_path("//dart/runtime/observatory/pubspec.yaml"),
]
args = [
"--silent=True",
"--pub-executable",
rebase_path("//third_party/dart-sdk/dart-sdk/bin/pub"),
"--directory",
rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"),
"--command",
"rewrite",
rebase_path("//dart/runtime/observatory/pubspec.yaml"),
rebase_path(
"$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml"),
"../../third_party/",
rebase_path("../../../dart/third_party/"),
]
outputs = [
"$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml",
]
}
action("copy_observatory_deps") {
deps = [
":write_observatory_pubspec_yaml",
]
script = "//dart/tools/observatory_tool.py"
inputs = [
script,
"$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml",
]
args = [
"--silent=True",
"--pub-executable",
rebase_path("//third_party/dart-sdk/dart-sdk/bin/pub"),
"--directory",
rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"),
"--command",
"get",
]
outputs = [
"$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.lock",
]
}
action("pub_build_observatory") {
sources =
rebase_path(observatory_sources_gypi.sources,
"",
"$root_gen_dir/observatory_copy/dart/runtime/observatory")
deps = [
":copy_observatory_deps",
]
script = "//dart/tools/observatory_tool.py"
inputs = [
script,
]
inputs += sources
args = [
"--silent=True",
"--pub-executable",
rebase_path("//third_party/dart-sdk/dart-sdk/bin/pub"),
"--directory",
rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"),
"--command",
"build",
rebase_path("$root_out_dir/observatory/build"),
]
outputs = [
"$root_out_dir/observatory/build/web/index.html",
"$root_out_dir/observatory/build/web/index.html_bootstrap.dart.js",
]
}
action("deploy_observatory") {
deps = [
":pub_build_observatory",
]
script = "//dart/tools/observatory_tool.py"
inputs = [
script,
"$root_out_dir/observatory/build/web/index.html",
"$root_out_dir/observatory/build/web/index.html_bootstrap.dart.js",
]
args = [
"--silent=True",
"--pub-executable",
rebase_path("//third_party/dart-sdk/dart-sdk/bin/pub"),
"--directory",
rebase_path("$root_out_dir/observatory"),
"--command",
"deploy",
]
outputs = [
"$root_out_dir/observatory/deployed/web/index.html",
"$root_out_dir/observatory/deployed/web/index.html_bootstrap.dart.js",
]
}