| # Copyright 2021 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/timestamp.gni") |
| import("./node.gni") |
| import("./vars.gni") |
| |
| template("generate_css") { |
| node_action(target_name) { |
| forward_variables_from(invoker, [ "sources" ]) |
| |
| script = "scripts/build/generate_css_js_files.js" |
| |
| _src = rebase_path(".", root_build_dir) |
| _dest = rebase_path(target_gen_dir, root_build_dir) |
| |
| inputs += |
| [ devtools_location_prepend + "node_modules/cssnano/package.json" ] |
| |
| _minify = is_debug |
| |
| args = [ |
| build_timestamp, |
| "$_minify", |
| target_name, |
| _src, |
| _dest, |
| string_join(",", sources), |
| ] |
| |
| outputs = [] |
| foreach(_input, sources) { |
| outputs += [ "$target_gen_dir/$_input.js" ] |
| } |
| |
| data = outputs |
| |
| if (!devtools_bundle) { |
| metadata = { |
| grd_files = outputs |
| } |
| } |
| } |
| } |