7201845894
* refactor: auto generate electron_version.h from the version file * Update BUILD.gn Co-Authored-By: Jeremy Apthorp <nornagon@nornagon.net>
39 lines
1,020 B
Text
39 lines
1,020 B
Text
template("templated_file") {
|
|
assert(defined(invoker.template), "Need template file to run")
|
|
assert(defined(invoker.output), "Need output file to run")
|
|
|
|
if (defined(invoker.values)) {
|
|
args_path = "$target_gen_dir/$target_name.args"
|
|
write_file(args_path, invoker.values, "json")
|
|
}
|
|
|
|
action(target_name) {
|
|
forward_variables_from(invoker,
|
|
[
|
|
"deps",
|
|
"public_deps",
|
|
"inputs",
|
|
"outputs",
|
|
])
|
|
inputs = [
|
|
invoker.template,
|
|
]
|
|
outputs = [
|
|
invoker.output,
|
|
]
|
|
script = "//electron/build/generate-template.py"
|
|
args = [
|
|
rebase_path(invoker.template),
|
|
rebase_path(invoker.output),
|
|
]
|
|
|
|
if (defined(invoker.values)) {
|
|
args += rebase_path(args_path)
|
|
}
|
|
|
|
if (defined(invoker.args_files)) {
|
|
args += rebase_path(invoker.args_files)
|
|
inputs += invoker.args_files
|
|
}
|
|
}
|
|
}
|