blob: 3eb1f32d79dc2f3c4845726df1a720b5806c5a9d [file] [edit]
<html devsite>
<head>
<meta name="project_path" value="/_project.yaml">
<meta name="book_path" value="/versions/8.2.0/_book.yaml">
</head>
<body>
<h1 class="page-title" id="modules.DefaultInfo">DefaultInfo</h1>
{% dynamic setvar source_file "src/main/java/com/google/devtools/build/lib/starlarkbuildapi/DefaultInfoApi.java" %}
{% dynamic setvar version "8.2.0" %}
{% dynamic setvar original_path "/rules/lib/providers/DefaultInfo" %}
{% include "_buttons.html" %}
<!-- {% raw %} -->
A provider that gives general information about a target's direct and transitive files. Every rule type has this provider, even if it is not returned explicitly by the rule's implementation function. Each <code>DefaultInfo</code> instance has the following fields: <ul><li><code>files</code><li><code>files_to_run</code><li><code>data_runfiles</code><li><code>default_runfiles</code></ul>See the <a href='https://bazel.build/versions/8.2.0/extending/rules'>rules</a> page for extensive guides on how to use this provider.
<h2>Members</h2>
<ul>
<li>
<a href="#DefaultInfo">DefaultInfo</a>
</li>
<li>
<a href="#data_runfiles">data_runfiles</a>
</li>
<li>
<a href="#default_runfiles">default_runfiles</a>
</li>
<li>
<a href="#files">files</a>
</li>
<li>
<a href="#files_to_run">files_to_run</a>
</li>
</ul>
<h2 id="DefaultInfo">DefaultInfo</h2>
<p><pre class="rule-signature"><a class="anchor" href="../providers/DefaultInfo.html">DefaultInfo</a> DefaultInfo(files=None, runfiles=None, data_runfiles=None, default_runfiles=None, executable=None)</pre></p>
<p>The <code>DefaultInfo</code> constructor.
<!-- hide-from-toc is a class used by DevSite for the public Bazel site
(https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
<h3 class="hide-from-toc">Parameters</h3>
<table class="table table-bordered table-condensed table-params">
<colgroup>
<col class="col-param">
<col class="param-description">
</colgroup>
<thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td id="DefaultInfo.files">
<code>files</code>
</td>
<td>
<a class="anchor" href="../builtins/depset.html">depset</a>; or <code>None</code>;
default is <code>None</code><br/>
A <a href='../builtins/depset.html'><code>depset</code></a> of <a href='../builtins/File.html'><code>File</code></a> objects representing the default outputs to build when this target is specified on the bazel command line. By default it is all predeclared outputs.
</td>
</tr>
<tr>
<td id="DefaultInfo.runfiles">
<code>runfiles</code>
</td>
<td>
<a class="anchor" href="../builtins/runfiles.html">runfiles</a>; or <code>None</code>;
default is <code>None</code><br/>
runfiles descriptor describing the files that this target needs when run (via the <code>run</code> command or as a tool dependency).
</td>
</tr>
<tr>
<td id="DefaultInfo.data_runfiles">
<code>data_runfiles</code>
</td>
<td>
<a class="anchor" href="../builtins/runfiles.html">runfiles</a>; or <code>None</code>;
default is <code>None</code><br/>
<p><b>It is recommended that you avoid using this parameter (see <a href='https://bazel.build/versions/8.2.0/extending/rules#runfiles_features_to_avoid'>"runfiles features to avoid"</a>)</b></p> runfiles descriptor describing the runfiles this target needs to run when it is a dependency via the <code>data</code> attribute.
</td>
</tr>
<tr>
<td id="DefaultInfo.default_runfiles">
<code>default_runfiles</code>
</td>
<td>
<a class="anchor" href="../builtins/runfiles.html">runfiles</a>; or <code>None</code>;
default is <code>None</code><br/>
<p><b>It is recommended that you avoid using this parameter (see <a href='https://bazel.build/versions/8.2.0/extending/rules#runfiles_features_to_avoid'>"runfiles features to avoid"</a>)</b></p> runfiles descriptor describing the runfiles this target needs to run when it is a dependency via any attribute other than the <code>data</code> attribute.
</td>
</tr>
<tr>
<td id="DefaultInfo.executable">
<code>executable</code>
</td>
<td>
<a class="anchor" href="../builtins/File.html">File</a>; or <code>None</code>;
default is <code>None</code><br/>
If this rule is marked <a href='../globals/bzl.html#rule.executable'><code>executable</code></a> or <a href='../globals/bzl.html#rule.test'><code>test</code></a>, this is a <a href='../builtins/File.html'><code>File</code></a> object representing the file that should be executed to run the target. By default it is the predeclared output <code>ctx.outputs.executable</code> but it is recommended to pass another file (either predeclared or not) explicitly.
</td>
</tr>
</tbody>
</table>
<h2 id="data_runfiles">data_runfiles</h2>
<p><pre class="rule-signature"><a class="anchor" href="../builtins/runfiles.html">runfiles</a> DefaultInfo.data_runfiles</pre></p>
runfiles descriptor describing the files that this target needs when run in the condition that it is a <code>data</code> dependency attribute. Under most circumstances, use the <code>default_runfiles</code> parameter instead. See <a href='https://bazel.build/versions/8.2.0/extending/rules#runfiles_features_to_avoid'>"runfiles features to avoid"</a> for details.
May return <code>None</code>.
<h2 id="default_runfiles">default_runfiles</h2>
<p><pre class="rule-signature"><a class="anchor" href="../builtins/runfiles.html">runfiles</a> DefaultInfo.default_runfiles</pre></p>
runfiles descriptor describing the files that this target needs when run (via the <code>run</code> command or as a tool dependency).
May return <code>None</code>.
<h2 id="files">files</h2>
<p><pre class="rule-signature"><a class="anchor" href="../builtins/depset.html">depset</a> DefaultInfo.files</pre></p>
A <a href='../builtins/depset.html'><code>depset</code></a> of <a href='../builtins/File.html'><code>File</code></a> objects representing the default outputs to build when this target is specified on the bazel command line. By default it is all predeclared outputs.
May return <code>None</code>.
<h2 id="files_to_run">files_to_run</h2>
<p><pre class="rule-signature"><a class="anchor" href="../providers/FilesToRunProvider.html">FilesToRunProvider</a> DefaultInfo.files_to_run</pre></p>
A <a href='../providers/FilesToRunProvider.html'><code>FilesToRunProvider</code></a> object containing information about the executable and runfiles of the target.
May return <code>None</code>.
</body>
</html>
<!-- {% endraw %} -->