| # Copyright 2017 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/android/rules.gni") |
| import("//build/config/python.gni") |
| |
| template("mustache_pass") { |
| action(target_name) { |
| forward_variables_from(invoker, TESTONLY_AND_VISIBILITY + [ "deps" ]) |
| sources = [ invoker.input ] |
| if (defined(invoker.config_file)) { |
| sources += [ invoker.config_file ] |
| } |
| if (defined(invoker.delta_config_file)) { |
| sources += [ invoker.delta_config_file ] |
| } |
| |
| script = "//chrome/android/webapk/shell_apk/mustache_pass.py" |
| |
| outputs = [ invoker.output ] |
| |
| args = [ |
| "--template", |
| rebase_path(invoker.input, root_build_dir), |
| "--output", |
| rebase_path(invoker.output, root_build_dir), |
| ] |
| if (defined(invoker.config_file)) { |
| args += [ |
| "--config_file", |
| rebase_path(invoker.config_file, root_build_dir), |
| ] |
| } |
| if (defined(invoker.delta_config_file)) { |
| args += [ |
| "--delta_config_file", |
| rebase_path(invoker.delta_config_file, root_build_dir), |
| ] |
| } |
| if (defined(invoker.extra_variables)) { |
| extra_variables = invoker.extra_variables |
| args += [ "--extra_variables=${extra_variables}" ] |
| } |
| } |
| } |