blob: 6d49d0207c25b828e63e0855e513a8e5c2e0b3bf [file] [log] [blame]
# Copyright 2019 The Fuchsia 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/info/info.gni")
import("//build/package.gni")
write_file(build_info_files.product, build_info_product)
write_file(build_info_files.board, build_info_board)
if (build_info_files.version != build_info_files.latest_commit_date) {
write_file(build_info_files.version, build_info_version)
}
package("build-info") {
deps = [
":latest-commit-date.txt",
]
resources = [
{
dest = "product"
path = build_info_files.product
},
{
dest = "board"
path = build_info_files.board
},
{
dest = "version"
path = build_info_files.version
},
{
dest = "snapshot"
path = build_info_files.jiri_snapshot
},
{
dest = "latest-commit-date"
path = build_info_files.latest_commit_date
},
]
}
action("latest-commit-date.txt") {
visibility = [ ":*" ]
# The script at tools/gen-latest-commit-date.sh script runs the following
# command to compute the latest commit date:
#
# GIT_CONFIG_NOSYSTEM=1 TZ=UTC git --git-dir="$INTEGRATION"/.git log --date=iso-strict-local --format=%cd -n 1 > "$OUTPUT"
#
# That command uses the following files, which means we need to depend on them
# in order to ensure that this GN target will be considered dirty if the
# output of that command would change.
sources = [
"//integration/.git/HEAD",
"//integration/.git/index",
]
outputs = [
build_info_files.latest_commit_date,
]
script = "gen-latest-commit-date.sh"
args = rebase_path([ "//integration/" ] + outputs, root_build_dir)
}