# Copyright 2020 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("//third_party/closure_compiler/compile_js.gni") import("//tools/grit/grit_rule.gni") import("//tools/grit/preprocess_grit.gni") import("//tools/polymer/html_to_js.gni") import("//ui/webui/resources/tools/generate_grd.gni") preprocess_folder = "preprocessed" preprocess_manifest = "preprocessed_manifest.json" preprocess_gen_manifest = "preprocessed_gen_manifest.json" generate_grd("build_grd") { grd_prefix = "commander" out_grd = "$target_gen_dir/${grd_prefix}_resources.grd" input_files = [ "commander.html" ] input_files_base_dir = rebase_path(".", "//") deps = [ ":preprocess", ":preprocess_generated", ] manifest_files = [ "$target_gen_dir/$preprocess_manifest", "$target_gen_dir/$preprocess_gen_manifest", ] } preprocess_grit("preprocess") { in_folder = "./" out_folder = "$target_gen_dir/$preprocess_folder" out_manifest = "$target_gen_dir/$preprocess_manifest" in_files = [ "browser_proxy.js", "types.js", ] } preprocess_grit("preprocess_generated") { deps = [ ":web_components" ] in_folder = target_gen_dir out_folder = "$target_gen_dir/$preprocess_folder" out_manifest = "$target_gen_dir/$preprocess_gen_manifest" in_files = [ "app.js", "icons.js", "option.js", ] } grit("commander_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/commander_resources.grd" deps = [ ":build_grd" ] outputs = [ "grit/commander_resources.h", "grit/commander_resources_map.cc", "grit/commander_resources_map.h", "commander_resources.pak", ] output_dir = "$root_gen_dir/chrome" } js_type_check("closure_compile") { is_polymer3 = true deps = [ ":app", ":browser_proxy", ":option", ":types", ] } js_library("app") { deps = [ ":browser_proxy", ":option", ":types", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//ui/webui/resources/js:cr.m", ] } js_library("browser_proxy") { deps = [ "//ui/webui/resources/js:cr.m" ] } js_library("option") { deps = [ ":icons", ":types", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", ] } js_library("icons") { } js_library("types") { } html_to_js("web_components") { js_files = [ "app.js", "option.js", "icons.js", ] }