run_add_from_clone()

def run_add_from_clone(name, clone_from, deps, help, type, visibility)

Adds a rule that clones the exec from an existing rule.

The new rule is merged with the cloned rule: the new rule’s fields take precedence, and the exec/target is taken from the cloned rule. Dependencies are extended (not replaced).

Args

  • name: string: The name of the new rule.
  • clone_from: string: The name of an existing rule to clone the exec from.
  • deps: list: Additional dependencies to add to the cloned rule’s dependencies.
  • help: The help message for the rule (defaults to cloned rule’s help).
  • type: The exec type (Run|Setup|Optional (default)|PreCommit|Clean|Test). Defaults to cloned rule’s type.
  • visibility: Rule visibility: Public|Private|Rules[]. See visibility.star for more info.

run_add_serialized()

def run_add_serialized(name, rules, deps, help, type, visibility)

Takes a list of existing rules and creates a serial execution chain.

The first rule in the list is not cloned. Each subsequent rule is cloned with an additional dependency on the previous rule in the chain, ensuring they execute one after another in order.

The cloned rules are named <name>_<index> where <index> is the position in the list (starting from 1).

Args

  • name: string: The base name used to derive cloned rule names (<name>_1, <name>_2, …).
  • rules: list: List of existing rule names to serialize.
  • deps: list: Additional dependencies to add to every cloned rule.
  • help: The help message for cloned rules (defaults to cloned rule’s help).
  • type: The exec type (Run|Setup|Optional (default)|PreCommit|Clean|Test). Defaults to cloned rule’s type.
  • visibility: Rule visibility: Public|Private|Rules[]. See visibility.star for more info.

run_add_target()

def run_add_target(name, deps, help, type, platforms, visibility)

Adds a target to the workspace.

This rule can be used to consolidate dependencies into a single target.

Args

  • name: string: The name of the rule.
  • deps: list: List of dependencies for the target.
  • help: The help message for the rule.
  • type: See run_add_exec()
  • platforms: List of platforms to build the target for (default is all).
  • visibility: Rule visibility: Public|Private|Rules[]. See visibility.star for more info.

run_add_target_precommit()

def run_add_target_precommit(name, deps, help, platforms, visibility)

Adds a target to the workspace that //:pre-commit will depend on.

This rule can be used to consolidate PreCommit dependencies into a single target.

Args

  • name: string: The name of the rule.
  • deps: list: List of dependencies for the target.
  • help: The help message for the rule.
  • platforms: List of platforms to build the target for (default is all).
  • visibility: Rule visibility: Public|Private|Rules[]. See visibility.star for more info.

run_add_target_test()

def run_add_target_test(name, deps, help, platforms, visibility)

Adds a target to the workspace that //:test will depend on.

This rule can be used to consolidate test dependencies into a single target.

Args

  • name: string: The name of the rule.
  • deps: list: List of dependencies for the target.
  • help: The help message for the rule.
  • platforms: List of platforms to build the target for (default is all).
  • visibility: Rule visibility: Public|Private|Rules[]. See visibility.star for more info.