blob: ddac49fe6143dd84dce867767e245bb9da5f1b1d [file] [log] [blame]
# Copyright 2019 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("//chrome/common/features.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/polymer/html_to_js.gni")
import("//tools/typescript/ts_library.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
assert(is_win || is_mac || is_linux || is_chromeos_lacros)
grit("resources") {
defines = chrome_grit_defines
# These arguments are needed since the grd is generated at build time.
enable_input_discovery_for_gn_analyze = false
source = "$target_gen_dir/resources.grd"
deps = [ ":build_grd" ]
outputs = [
"grit/browser_switch_resources.h",
"grit/browser_switch_resources_map.cc",
"grit/browser_switch_resources_map.h",
"browser_switch_resources.pak",
]
output_dir = "$root_gen_dir/chrome"
}
generate_grd("build_grd") {
grd_prefix = "browser_switch"
out_grd = "$target_gen_dir/resources.grd"
input_files = [
"browser_switch.html",
"internals/browser_switch_internals.html",
]
input_files_base_dir = rebase_path(".", "//")
deps = [ ":build_ts" ]
manifest_files = [ "$target_gen_dir/tsconfig.manifest" ]
}
ts_library("build_ts") {
root_dir = target_gen_dir
out_dir = "$target_gen_dir/tsc"
tsconfig_base = "tsconfig_base.json"
in_files = [
"app.ts",
"browser_switch_proxy.ts",
"internals/browser_switch_internals.ts",
]
definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ]
deps = [
"//third_party/polymer/v3_0:library",
"//ui/webui/resources:library",
]
extra_deps = [
":copy_browser_proxy",
":copy_internals",
":web_components",
]
}
copy("copy_browser_proxy") {
sources = [ "browser_switch_proxy.ts" ]
outputs = [ "$target_gen_dir/{{source_file_part}}" ]
}
copy("copy_internals") {
sources = [ "internals/browser_switch_internals.ts" ]
outputs = [ "$target_gen_dir/internals/{{source_file_part}}" ]
}
html_to_js("web_components") {
js_files = [ "app.ts" ]
}