forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing provider by creating rule in .bzl file RELNOTES: None PiperOrigin-RevId: 251486134
- Loading branch information
1 parent
cc41129
commit 1bce754
Showing
3 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
src/test/java/com/google/devtools/build/skydoc/testdata/cc_api_test/golden.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<!-- Generated with Stardoc: http://skydoc.bazel.build --> | ||
|
||
<a name="#cpp_related_rule"></a> | ||
|
||
## cpp_related_rule | ||
|
||
<pre> | ||
cpp_related_rule(<a href="#cpp_related_rule-name">name</a>, <a href="#cpp_related_rule-first">first</a>, <a href="#cpp_related_rule-fourth">fourth</a>, <a href="#cpp_related_rule-second">second</a>, <a href="#cpp_related_rule-third">third</a>) | ||
</pre> | ||
|
||
This rule does C++-related things. | ||
|
||
### Attributes | ||
|
||
<table class="params-table"> | ||
<colgroup> | ||
<col class="col-param" /> | ||
<col class="col-description" /> | ||
</colgroup> | ||
<tbody> | ||
<tr id="cpp_related_rule-name"> | ||
<td><code>name</code></td> | ||
<td> | ||
<a href="https://bazel.build/docs/build-ref.html#name">Name</a>; required | ||
<p> | ||
A unique name for this target. | ||
</p> | ||
</td> | ||
</tr> | ||
<tr id="cpp_related_rule-first"> | ||
<td><code>first</code></td> | ||
<td> | ||
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; required | ||
</td> | ||
</tr> | ||
<tr id="cpp_related_rule-fourth"> | ||
<td><code>fourth</code></td> | ||
<td> | ||
Boolean; optional | ||
</td> | ||
</tr> | ||
<tr id="cpp_related_rule-second"> | ||
<td><code>second</code></td> | ||
<td> | ||
<a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a>; required | ||
</td> | ||
</tr> | ||
<tr id="cpp_related_rule-third"> | ||
<td><code>third</code></td> | ||
<td> | ||
<a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; required | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
||
<a name="#exercise_the_api"></a> | ||
|
||
## exercise_the_api | ||
|
||
<pre> | ||
exercise_the_api() | ||
</pre> | ||
|
||
|
||
|
||
|
||
|
||
<a name="#my_rule_impl"></a> | ||
|
||
## my_rule_impl | ||
|
||
<pre> | ||
my_rule_impl(<a href="#my_rule_impl-ctx">ctx</a>) | ||
</pre> | ||
|
||
|
||
|
||
### Parameters | ||
|
||
<table class="params-table"> | ||
<colgroup> | ||
<col class="col-param" /> | ||
<col class="col-description" /> | ||
</colgroup> | ||
<tbody> | ||
<tr id="my_rule_impl-ctx"> | ||
<td><code>ctx</code></td> | ||
<td> | ||
required. | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
20 changes: 20 additions & 0 deletions
20
src/test/java/com/google/devtools/build/skydoc/testdata/cc_api_test/input.bzl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""Input file for C++ api test """ | ||
|
||
def exercise_the_api(): | ||
var1 = CcInfo | ||
|
||
exercise_the_api() | ||
|
||
def my_rule_impl(ctx): | ||
return [] | ||
|
||
cpp_related_rule = rule( | ||
implementation = my_rule_impl, | ||
doc = "This rule does C++-related things.", | ||
attrs = { | ||
"first": attr.label(mandatory = True, allow_single_file = True), | ||
"second": attr.string_dict(mandatory = True), | ||
"third": attr.output(mandatory = True), | ||
"fourth": attr.bool(default = False, mandatory = False), | ||
}, | ||
) |