Files
react-native-devtools-frontend/scripts/build/ninja/rollup.gni
T
Tim van der Lippe 7988ab3e62 Introduce GN node_action template
This template abstracts away from the `node.py` script, as well as
making sure that the JS script is properly added to the inputs
array. Before, it was easy to forget to add the JS script to the
inputs array, which can lead to GN incorrectly determining there
is no need to rebuild, while in fact the script itself changed.

R=szuend@chromium.org

Bug: 1170706
Change-Id: I759f3ef3088381ea7e4cefcb8524d7d240b46fb9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2650148
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-01-27 12:08:04 +00:00

46 lines
1.3 KiB
Plaintext

# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("./node.gni")
import("./vars.gni")
template("rollup") {
assert(defined(invoker.entrypoint),
"You must define the 'entrypoint' for a rollup target")
node_action(target_name) {
script = "node_modules/rollup/dist/bin/rollup"
forward_variables_from(invoker,
[
"visibility",
"deps",
"public_deps",
])
inputs = [
invoker.entrypoint,
devtools_location_prepend + "front_end/rollup.config.js",
]
args = [
# TODO(crbug.com/1098074): We need to hide warnings that are written stderr,
# as Chromium does not process the returncode of the subprocess correctly
# and instead looks if `stderr` is empty.
"--silent",
"--plugin",
"terser",
"--config",
rebase_path(devtools_location_prepend + "front_end/rollup.config.js",
root_build_dir),
"--input",
rebase_path(invoker.entrypoint, root_build_dir),
"--file",
rebase_path(invoker.output_file_location, root_build_dir),
]
outputs = [ invoker.output_file_location ]
}
}