| # 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("//chrome/common/features.gni") |
| import("//tools/grit/grit_rule.gni") |
| import("//tools/typescript/ts_library.gni") |
| import("//ui/webui/resources/tools/generate_grd.gni") |
| |
| tsc_folder = "tsc" |
| |
| 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/segmentation_internals_resources.h", |
| "grit/segmentation_internals_resources_map.cc", |
| "grit/segmentation_internals_resources_map.h", |
| "segmentation_internals_resources.pak", |
| ] |
| output_dir = "$root_gen_dir/chrome" |
| } |
| |
| generate_grd("build_grd") { |
| grd_prefix = "segmentation_internals" |
| out_grd = "$target_gen_dir/resources.grd" |
| deps = [ ":build_ts" ] |
| manifest_files = [ "$target_gen_dir/tsconfig.manifest" ] |
| input_files = [ "segmentation_internals.html" ] |
| input_files_base_dir = rebase_path(".", "//") |
| } |
| |
| copy("copy_ts") { |
| sources = [ |
| "segmentation_internals.ts", |
| "segmentation_internals_browser_proxy.ts", |
| ] |
| outputs = [ "$target_gen_dir/{{source_file_part}}" ] |
| } |
| |
| copy("copy_mojo") { |
| deps = [ |
| "//chrome/browser/ui/webui/segmentation_internals:mojo_bindings_webui_js", |
| ] |
| mojom_folder = "$root_gen_dir/mojom-webui/chrome/browser/ui/webui/segmentation_internals/" |
| sources = [ "$mojom_folder/segmentation_internals.mojom-webui.js" ] |
| outputs = [ "$target_gen_dir/{{source_file_part}}" ] |
| } |
| |
| ts_library("build_ts") { |
| root_dir = "$target_gen_dir" |
| out_dir = "$target_gen_dir/$tsc_folder" |
| tsconfig_base = "tsconfig_base.json" |
| in_files = [ |
| "segmentation_internals.ts", |
| "segmentation_internals_browser_proxy.ts", |
| "segmentation_internals.mojom-webui.js", |
| ] |
| deps = [ "//ui/webui/resources:library" ] |
| extra_deps = [ |
| ":copy_mojo", |
| ":copy_ts", |
| ] |
| } |