| # Copyright 2021 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/polymer/html_to_js.gni") |
| import("//tools/typescript/ts_library.gni") |
| import("//ui/webui/resources/tools/generate_grd.gni") |
| |
| assert(!is_android, "enterprise_casting is not for android.") |
| |
| resources_grd_file = "$target_gen_dir/resources.grd" |
| |
| html_to_js("web_components") { |
| js_files = [ "enterprise_casting.ts" ] |
| } |
| |
| copy("copy_browser_proxy") { |
| sources = [ "browser_proxy.ts" ] |
| outputs = [ "$target_gen_dir/{{source_file_part}}" ] |
| } |
| |
| copy("copy_mojo") { |
| deps = |
| [ "//chrome/browser/ui/webui/enterprise_casting:mojo_bindings_webui_js" ] |
| mojom_folder = |
| "$root_gen_dir/mojom-webui/chrome/browser/ui/webui/enterprise_casting/" |
| sources = [ "$mojom_folder/enterprise_casting.mojom-webui.js" ] |
| outputs = [ "$target_gen_dir/{{source_file_part}}" ] |
| } |
| |
| ts_library("build_ts") { |
| deps = [ "//third_party/polymer/v3_0:library" ] |
| extra_deps = [ |
| ":copy_browser_proxy", |
| ":copy_mojo", |
| ":web_components", |
| ] |
| root_dir = "$target_gen_dir" |
| out_dir = "$target_gen_dir/tsc" |
| tsconfig_base = "tsconfig_base.json" |
| in_files = [ |
| "browser_proxy.ts", |
| "enterprise_casting.mojom-webui.js", |
| "enterprise_casting.ts", |
| ] |
| } |
| |
| generate_grd("build_grd") { |
| input_files = [ "index.html" ] |
| input_files_base_dir = rebase_path(".", "//") |
| manifest_files = [ "$target_gen_dir/tsconfig.manifest" ] |
| deps = [ ":build_ts" ] |
| |
| grd_prefix = "enterprise_casting" |
| out_grd = resources_grd_file |
| } |
| |
| grit("resources") { |
| # These arguments are needed since the grd is generated at build time. |
| enable_input_discovery_for_gn_analyze = false |
| source = resources_grd_file |
| deps = [ ":build_grd" ] |
| |
| outputs = [ |
| "grit/enterprise_casting_resources.h", |
| "grit/enterprise_casting_resources_map.cc", |
| "grit/enterprise_casting_resources_map.h", |
| "enterprise_casting_resources.pak", |
| ] |
| output_dir = "$root_gen_dir/chrome" |
| } |