blob: 8be2e228a9b3699e20401d7dbd35e31f98334d22 [file] [log] [blame]
# Copyright 2018 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.
import("//tools/grit/grit_rule.gni")
import("//tools/typescript/ts_library.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
bluetooth_grd_prefix = "bluetooth_internals"
public_mojo_grdp_file = "$target_gen_dir/public_mojo_resources.grdp"
internals_mojo_grdp_file = "$target_gen_dir/internals_mojo_resources.grdp"
resources_grd_file = "$target_gen_dir/resources.grd"
generate_grd("build_public_mojo_grdp") {
grd_prefix = bluetooth_grd_prefix
out_grd = public_mojo_grdp_file
input_files = [
"adapter.mojom-webui.js",
"uuid.mojom-webui.js",
"device.mojom-webui.js",
]
input_files_base_dir =
rebase_path("$root_gen_dir/mojom-webui/device/bluetooth/public/mojom/",
root_build_dir)
}
generate_grd("build_internal_mojo_grdp") {
grd_prefix = bluetooth_grd_prefix
out_grd = internals_mojo_grdp_file
input_files = [ "bluetooth_internals.mojom-webui.js" ]
input_files_base_dir = rebase_path(
"$root_gen_dir/mojom-webui/chrome/browser/ui/webui/bluetooth_internals/",
root_build_dir)
}
generate_grd("build_grd") {
grd_prefix = bluetooth_grd_prefix
out_grd = resources_grd_file
deps = [
":build_internal_mojo_grdp",
":build_public_mojo_grdp",
":build_ts",
]
input_files = [
"bluetooth_internals.css",
"bluetooth_internals.html",
"menu.svg",
]
input_files_base_dir = rebase_path(".", "//")
grdp_files = [
public_mojo_grdp_file,
internals_mojo_grdp_file,
]
manifest_files = [ "$target_gen_dir/tsconfig.manifest" ]
}
# TODO(crbug.com/1337318): This page should be converted to TypeScript but this
# will be a lot of work. Passing the JavaScript files through the TypeScript
# compiler will provide basic static checks (e.g. syntax) without validating
# types.
ts_library("build_ts") {
root_dir = "."
out_dir = "$target_gen_dir/tsc"
tsconfig_base = "tsconfig_base.json"
in_files = [
"adapter_broker.js",
"adapter_page.js",
"debug_log_page.js",
"characteristic_list.js",
"descriptor_list.js",
"device_broker.js",
"device_collection.js",
"device_details_page.js",
"device_table.js",
"device_utils.js",
"devices_page.js",
"expandable_list.js",
"bluetooth_internals.js",
"main.js",
"object_fieldset.js",
"page_manager.js",
"page.js",
"service_list.js",
"sidebar.js",
"snackbar.js",
"value_control.js",
]
deps = [ "//ui/webui/resources:library" ]
}
grit("resources") {
enable_input_discovery_for_gn_analyze = false
source = resources_grd_file
deps = [
":build_grd",
"//chrome/browser/ui/webui/bluetooth_internals:mojo_bindings_js",
"//device/bluetooth/public/mojom:deprecated_experimental_interfaces_js",
"//device/bluetooth/public/mojom:mojom_js",
]
outputs = [
"grit/bluetooth_internals_resources.h",
"grit/bluetooth_internals_resources_map.h",
"grit/bluetooth_internals_resources_map.cc",
"bluetooth_internals_resources.pak",
]
output_dir = "$root_gen_dir/chrome"
}