Skip to main content

ensure

The following functions are defined in the bxl file: prelude//bxl:ensure.bxl. You can import them in your bxl file by using load("@prelude//bxl:ensure.bxl", "function_name")

Utils functions for working with ctx.output.ensure/ensure_multiple in bxl.

ensure_default_info

def ensure_default_info(
ctx: bxl.Context,
default_info: DefaultInfo,
with_other_outputs: bool = False,
) -> None

Ensures all outputs of the given DefaultInfo.

Parameters:

  • ctx: The bxl context.
  • default_info: The DefaultInfo to ensure.
  • with_other_outputs: Whether to also ensure the other_outputs of the DefaultInfo.

Example:

load("@prelude//bxl:ensure.bxl", "ensure_default_info")
def _impl(ctx):
target = ctx.cli_args.target
default_info = ctx.analysis(target).providers([DefaultInfo].sub_targets["dwp"][DefaultInfo]
ensure_default_info(ctx, default_info)