# subrule_ctx

{% dynamic setvar source_file "src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkSubrule.java" %} {% dynamic setvar version "7.1.0" %} {% dynamic setvar original_path "/rules/lib/builtins/subrule_ctx" %} {% include "_buttons.html" %} A context object passed to the implementation function of a subrule.

## Members

- actions
- fragments
- label
- toolchains

## actions

    actions subrule_ctx.actions

Contains methods for declaring output files and the actions that produce them

## fragments

    fragments subrule_ctx.fragments

Allows access to configuration fragments in target configuration.

## label

    Label subrule_ctx.label

The label of the target currently being analyzed

## toolchains

    ToolchainContext subrule_ctx.toolchains

Contains methods for declaring output files and the actions that produce them