# fragments

{% dynamic setvar source_file "src/main/java/com/google/devtools/build/lib/starlarkbuildapi/FragmentCollectionApi.java" %} {% dynamic setvar version "7.2.0" %} {% dynamic setvar original_path "/rules/lib/builtins/fragments" %} {% include "_buttons.html" %} A collection of configuration fragments available in the current rule implementation context. Access a specific fragment by its field name. For example, `ctx.fragments.java`

Only configuration fragments which are declared in the rule definition may be accessed in this collection.

See the configuration fragment reference for a list of available fragments and the rules documentation for how to use them.