docs/versions/8.0.0/rules/lib/builtins/Target.mdx
{% dynamic setvar source_file "src/main/java/com/google/devtools/build/lib/starlarkbuildapi/core/TransitiveInfoCollectionApi.java" %} {% dynamic setvar version "8.0.0" %} {% dynamic setvar original_path "/rules/lib/builtins/Target" %} {% include "_buttons.html" %}
<!-- {% raw %} -->The BUILD target for a dependency. Appears in the fields of <code><a href='../builtins/ctx.html#attr'>ctx.attr</a></code> corresponding to <a href='https://bazel.build/versions/8.0.0/extending/rules#dependency_attributes'>dependency attributes</a> (<code><a href='../toplevel/attr.html#label'>label</a></code> or <code><a href='../toplevel/attr.html#label_list'>label_list</a></code>). Has the following fields:
<ul> <li><h3 id='modules.Target.label'>label</h3> <code><a href='../builtins/Label.html'>Label</a> Target.label</code>The identifier of the target.</li>
<li><h3 id='modules.Target.providers'>Providers</h3> The <a href='https://bazel.build/versions/8.0.0/extending/rules#providers'>providers</a> of a rule target can be accessed by type using index notation (<code>target[DefaultInfo]</code>). The presence of providers can be checked using the <code>in</code> operator (<code>SomeInfo in target</code>). </ul> </body> </html> <!-- {% endraw %} -->