Skip to content

Commit

Permalink
Bazel Docs: Fix links for "deps" and "data" attributes in the build e…
Browse files Browse the repository at this point in the history
…ncyclopedia.

They're considered "typical", not "common" attributes.

PiperOrigin-RevId: 439917467
  • Loading branch information
fweikert authored and copybara-github committed Apr 6, 2022
1 parent c9f9d7b commit d491a88
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public RuleClass build(RuleClass.Builder builder, final RuleDefinitionEnvironmen
/* <!-- #BLAZE_RULE(java_library).ATTRIBUTE(data) -->
The list of files needed by this library at runtime.
See general comments about <code>data</code> at
<a href="${link common-definitions#common-attributes}">Attributes common to all build rules
</a>.
<a href="${link common-definitions#typical-attributes}">Typical attributes defined by
most build rules</a>.
<p>
When building a <code>java_library</code>, Bazel doesn't put these files anywhere; if the
<code>data</code> files are generated files then Bazel generates them. When building a
Expand All @@ -75,8 +75,8 @@ public RuleClass build(RuleClass.Builder builder, final RuleDefinitionEnvironmen
/* <!-- #BLAZE_RULE(java_library).ATTRIBUTE(deps) -->
The list of libraries to link into this library.
See general comments about <code>deps</code> at
<a href="${link common-definitions#common-attributes}">Attributes common to all build rules
</a>.
<a href="${link common-definitions#typical-attributes}">Typical attributes defined by
most build rules</a>.
<p>
The jars built by <code>java_library</code> rules listed in <code>deps</code> will be on
the compile-time classpath of this rule. Furthermore the transitive closure of their
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
/* <!-- #BLAZE_RULE($java_rule).ATTRIBUTE(deps) -->
The list of other libraries to be linked in to the target.
See general comments about <code>deps</code> at
<a href="common-definitions.html#common-attributes">Attributes common to all build rules
</a>.
<a href="common-definitions.html#typical-attributes">Typical attributes defined by
most build rules</a>.
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.override(
builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
/* <!-- #BLAZE_RULE($base_py).ATTRIBUTE(deps) -->
The list of other libraries to be linked in to the binary target.
See general comments about <code>deps</code> at
<a href="${link common-definitions#common-attributes}">
Attributes common to all build rules</a>.
<a href="${link common-definitions#typical-attributes}">
Typical attributes defined by most build rules</a>.
These are generally
<a href="${link py_library}"><code>py_library</code></a> rules.
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,24 @@ All other files required at runtime (whether scripts or data) belong in the
<code>data</code> attribute.
</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("srcs", LABEL_LIST)
.mandatory()
.allowedFileTypes(FileTypeSet.ANY_FILE))
.add(attr("srcs", LABEL_LIST).mandatory().allowedFileTypes(FileTypeSet.ANY_FILE))
/* <!-- #BLAZE_RULE($sh_target).ATTRIBUTE(deps) -->
The list of "library" targets to be aggregated into this target.
See general comments about <code>deps</code>
at <a href="${link common-definitions#common.deps}">Attributes common to all build rules
</a>.
at <a href="${link common-definitions#typical.deps}">Typical attributes defined by
most build rules</a>.
<p>
This attribute should be used to list other <code>sh_library</code> rules that provide
interpreted program source code depended on by the code in <code>srcs</code>. The files
provided by these rules will be present among the <code>runfiles</code> of this target.
</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.override(builder.copy("deps")
.allowedRuleClasses("sh_library")
.allowedRuleClassesWithWarning(ALLOWED_RULES_IN_DEPS_WITH_WARNING)
.allowedFileTypes())
.override(
builder
.copy("deps")
.allowedRuleClasses("sh_library")
.allowedRuleClassesWithWarning(ALLOWED_RULES_IN_DEPS_WITH_WARNING)
.allowedFileTypes())
.build();
}

Expand Down

0 comments on commit d491a88

Please sign in to comment.