blob: b3d1e1822b6e3d63dce35dba230d4e0f5ca9eb48 [file]
# Copyright 2026 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.
load("//build/bazel/rules/host:defs.bzl", "cc_binary_host_tool")
package(default_visibility = ["//visibility:public"])
cc_binary_host_tool(
name = "truncate",
srcs = ["truncate.cc"],
)
genrule(
name = "gen_version_info_txt",
srcs = [
"//build/info:latest_commit_hash",
"//build/info:minimum_utc_stamp",
],
outs = ["ffx_version_info.txt"],
cmd = "$(location gn_write_version_info.sh) $@ $(location //build/info:latest_commit_hash) $(location //build/info:minimum_utc_stamp)",
tools = ["gn_write_version_info.sh"],
)
genrule(
name = "version_info_bin",
srcs = [":ffx_version_info.txt"],
outs = ["version_info.bin"],
cmd = "$(location :truncate) $< $@ 64",
tools = [":truncate"],
)
genrule(
name = "build_version_bin",
srcs = ["//build/info:version"],
outs = ["build_version.bin"],
cmd = "$(location :truncate) $< $@ 64",
tools = [":truncate"],
)