chromium/chrome/browser/resources/accessibility/embedded_a11y_helper/BUILD.gn

# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/features.gni")
import("//chrome/common/features.gni")
import("//tools/typescript/ts_library.gni")

out_dir = "$root_out_dir/resources/accessibility/embedded_a11y_helper"
tsc_output_dir = "$target_gen_dir/tsc"

group("build") {
  deps = [ ":embedded_a11y_helper_copied_files" ]
}

ts_library("build_ts") {
  in_files = [
    "clipboard_copy.ts",
    "content.ts",
    "service_worker.ts",
  ]
  out_dir = tsc_output_dir
  definitions = [
    "//tools/typescript/definitions/chrome_event.d.ts",
    "//tools/typescript/definitions/runtime.d.ts",
    "//tools/typescript/definitions/tabs.d.ts",
    "//tools/typescript/definitions/storage.d.ts",
    "//tools/typescript/definitions/accessibility_features.d.ts",
    "//tools/typescript/definitions/accessibility_service_private.d.ts",
    "//tools/typescript/definitions/context_menus.d.ts",
    "//tools/typescript/definitions/i18n.d.ts",
    "//tools/typescript/definitions/scripting.d.ts",
  ]
}

copy("embedded_a11y_helper_copied_files") {
  sources = filter_include(get_target_outputs(":build_ts"), [ "*.js" ]) + [
              "../../chromeos/accessibility/common/gdocs_script.js",
              "../../chromeos/accessibility/select_to_speak/sts-icon-128.png",
              "../../chromeos/accessibility/select_to_speak/sts-icon-16.png",
              "../../chromeos/accessibility/select_to_speak/sts-icon-48.png",
            ]
  outputs = [ "$out_dir/{{source_file_part}}" ]
  deps = [ ":build_ts" ]
}