Upload upstream chromium 114.0.5735.31
[platform/framework/web/chromium-efl.git] / tools / polymer / html_to_js.gni
1 # Copyright 2020 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/chromeos/ui_mode.gni")
6
7 # Note: Don't use html_to_js() in new code. Instead see html_to_wrapper()
8 assert(is_chromeos_ash)
9
10 template("html_to_js") {
11   action(target_name) {
12     script = "//tools/polymer/html_to_js.py"
13     forward_variables_from(invoker, [ "visibility" ])
14
15     inputs = []
16     outputs = []
17
18     foreach(js_file, invoker.js_files) {
19       extension = get_path_info(js_file, "extension")
20       assert(extension == "js" || extension == "ts")
21
22       html_file = get_path_info(js_file, "dir") + "/" +
23                   get_path_info(js_file, "name") + ".html"
24       inputs += [
25         js_file,
26         html_file,
27       ]
28       outputs += [ "$target_gen_dir/" + js_file ]
29     }
30
31     args = [
32              "--in_folder",
33              rebase_path(".", root_build_dir),
34              "--out_folder",
35              rebase_path(target_gen_dir, root_build_dir),
36              "--js_files",
37            ] + invoker.js_files
38   }
39 }