| # 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("@io_bazel_rules_go//go:def.bzl", "go_library") | |
| load("//build/bazel/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS") | |
| load("//build/bazel/rules/host:defs.bzl", "go_binary_host_tool") | |
| package(default_applicable_licenses = ["//:license"]) | |
| exports_files( | |
| [ | |
| "keys/root.json", | |
| "keys/snapshot.json", | |
| "keys/targets.json", | |
| "keys/timestamp.json", | |
| "repository/1.root.json", | |
| "repository/1.snapshot.json", | |
| "repository/1.targets.json", | |
| "repository/root.json", | |
| "repository/snapshot.json", | |
| "repository/targets.json", | |
| "repository/timestamp.json", | |
| ], | |
| visibility = [ | |
| "//src/developer/ffx/lib/pkg:__pkg__", | |
| "//src/sys/pkg/tests/pkg-resolver:__pkg__", | |
| ], | |
| ) | |
| go_library( | |
| name = "lib", | |
| srcs = ["regenerate-metadata.go"], | |
| importpath = "go.fuchsia.dev/fuchsia/src/sys/pkg/tests/pkg-resolver/template", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| deps = [ | |
| "//third_party/golibs:github.com/theupdateframework/go-tuf", | |
| "//third_party/golibs:github.com/theupdateframework/go-tuf/data", # @bazel2gn:skip | |
| "//third_party/golibs:github.com/theupdateframework/go-tuf/pkg/keys", # @bazel2gn:skip | |
| ], | |
| ) | |
| go_binary_host_tool( | |
| name = "regenerate-metadata", | |
| testonly = True, | |
| embed = [":lib"], | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| deps = ["//third_party/golibs:github.com/theupdateframework/go-tuf"], | |
| ) |