blob: 766b33e1b4d8f79d71472863f2d6696b0398231d [file]
# Copyright 2024 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.
#
# A starlark input file for bazel cquery that prints two lines of output
# that contain the paths of a fuchsia package archive, and its manifest file.
#
# All paths are relative to the Bazel execroot.
#
# Example use:
# bazel cquery <config-options>
# --output=starlark --starlark:file=/path/to/this/file \
# //path/to/fuchsia:package
#
def format(target):
package_info = providers(target)["@@fuchsia_rules_common+//packages:providers.bzl%FuchsiaPackageInfo"]
lines = [
package_info.far_file.path,
package_info.package_manifest.path,
]
return "\n".join(lines)