Builds a fuchsia package.

This rule produces a fuchsia package which can be published to a package server and loaded on a device.

The rule will return both package manifest json file which can be used later in the build system and an archive (.far) of the package which can be shared.

This macro will expand out into several fuchsia tasks that can be run by a bazel invocation. Given a package definition, the following targets will be created.

    name = "pkg",
    components = [":my_component"],
    tools = [":my_tool"]
  • pkg.help: Calling run on this target will show the valid macro-expanded targets
  • pkg.publish: Calling run on this target will publish the package
  • pkg.my_component: Calling run on this target will call ffx component run with the component url if it is fuchsia_component instance and will call ffx driver register if it is a fuchsia_driver_component.
  • pkg.my_tool: Calling run on this target will call ffx driver run-tool if the tool is a fuchsia_driver_tool


Name Description Default
name The target name. -
package_name An optional name to use for this package, defaults to name. None
archive_name An option name for the far file. None
platform Optionally override the platform to build the package for. None
fuchsia_api_level The API level to build for. None
components A list of components to add to this package. The dependencies
of these targets will have their debug symbols stripped and added to
the build-id directory.
resources A list of additional resources to add to this package. These
resources will not have debug symbols stripped.
tools Additional tools that should be added to this package. []
subpackages Additional subpackages that should be added to this package. []
subpackages_to_flatten The list of subpackages included in this package.
The packages included in this list will be cracked open and all the
components included will be include in the parent package.
tags Forward additional tags to all generated targets. []
kwargs extra attributes to pass along to the build rule. -