| # 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_tests:host_go_test.bzl", "host_go_test") | |
| package(default_applicable_licenses = ["//:license"]) | |
| # Note: Host-only target matching platform-only deps via target_compatible_with. | |
| go_library( | |
| name = "build", | |
| srcs = [ | |
| "archive.go", | |
| "blobs.go", | |
| "config.go", | |
| "contents.go", | |
| "delta.go", | |
| "doc.go", | |
| "manifest.go", | |
| "package.go", | |
| "snapshot.go", | |
| "subpackages.go", | |
| "testutil.go", | |
| ], | |
| importpath = "go.fuchsia.dev/fuchsia/src/testing/host-target-testing/build", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//src/testing/host-target-testing:__subpackages__"], | |
| deps = [ | |
| "//src/lib/versioning/version-history/go:version-history", | |
| "//src/sys/pkg/lib/far/go:far", | |
| "//src/sys/pkg/lib/merkle", | |
| "//src/testing/host-target-testing/ignores", | |
| "//src/testing/host-target-testing/pkg", | |
| ], | |
| ) | |
| host_go_test( | |
| name = "host-target-testing-build-test", | |
| srcs = [ | |
| "config_test.go", | |
| "contents_test.go", | |
| "delta_test.go", | |
| "manifest_test.go", | |
| "package_test.go", | |
| "snapshot_test.go", | |
| ], | |
| embed = [":build"], | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//src/testing/host-target-testing:__pkg__"], | |
| deps = [ | |
| # GN bundles subpackages into //third_party/golibs:github.com/google/go-cmp; | |
| # Bazel requires the :github.com/google/go-cmp/cmp subpackage target. | |
| "//third_party/golibs:github.com/google/go-cmp/cmp", # @bazel2gn:path_overwrite://third_party/golibs:github.com/google/go-cmp | |
| ], | |
| ) |