chromium/chrome/browser/resources/chromeos/accessibility/braille_ime/BUILD.gn

# Copyright 2018 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/chromeos/ui_mode.gni")
import("//tools/typescript/ts_library.gni")
import("../tools/run_jsbundler.gni")

assert(is_chromeos_ash)

braille_ime_out_dir =
    "$root_out_dir/resources/chromeos/accessibility/braille_ime"
tsc_out_dir = "$target_gen_dir/tsc"

# TS files to compile.
ts_modules = []

# JS files required by TS compiler.
js_deps = []

group("build") {
  deps = [
    ":braille_ime_manifest",
    ":copied_files",
  ]
}

ts_library("ts_build") {
  in_files = js_deps + ts_modules
  out_dir = tsc_out_dir
  definitions = []
  tsconfig_base = "../tsconfig.base.json"
}

copy("braille_ime_manifest") {
  sources = [ "manifest.json" ]
  outputs = [
    "$root_out_dir/resources/chromeos/accessibility/braille_ime/manifest.json",
  ]
}

run_jsbundler("copied_files") {
  mode = "copy"
  dest_dir = braille_ime_out_dir
  deps = [ ":ts_build" ]
  sources = [
    "braille_ime.js",
    "main.js",
  ]
  sources += filter_include(get_target_outputs(":ts_build"), [ "*.js" ])

  rewrite_rules = [
    rebase_path(tsc_out_dir, root_build_dir) + ":",
    rebase_path(".", root_build_dir) + ":",
  ]
}