mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-06 12:01:40 +08:00
To avoid non-determinism on January 1st of a new year, we have to use the build timestamp from GN to compute the current year. The build timestamp will be the same for all bots, which ensures that all files are built with the same year in the copyright header. R=jacktfranklin@chromium.org Fixed: 1283883 Change-Id: Ifbe581ddb65095ca6ef555625be11a370cb8f238 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3372924 Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
# Copyright 2021 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("//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/clean-css/package.json" ]
|
|
|
|
args = [
|
|
build_timestamp,
|
|
"$is_debug",
|
|
"${invoker.legacy}",
|
|
target_name,
|
|
_src,
|
|
_dest,
|
|
string_join(",", sources),
|
|
]
|
|
|
|
outputs = []
|
|
foreach(_input, sources) {
|
|
_file_name = _input
|
|
if (invoker.legacy) {
|
|
_file_name = "$_file_name.legacy"
|
|
}
|
|
outputs += [ "$target_gen_dir/$_file_name.js" ]
|
|
}
|
|
|
|
data = outputs
|
|
|
|
if (is_debug) {
|
|
metadata = {
|
|
grd_files = outputs
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
set_defaults("generate_css") {
|
|
legacy = false
|
|
}
|