Skip to content

Commit

Permalink
Update config_apis_test to properly use the 'config' module.
Browse files Browse the repository at this point in the history
#5577

PiperOrigin-RevId: 223033716
  • Loading branch information
juliexxia authored and Copybara-Service committed Nov 27, 2018
1 parent 3176ce8 commit 9734da6
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,89 @@
<a name="#int_setting"></a>
## int_setting

<pre>
int_setting(<a href="#int_setting-name">name</a>)
</pre>



### Attributes

<table class="params-table">
<colgroup>
<col class="col-param" />
<col class="col-description" />
</colgroup>
<tbody>
<tr id="int_setting-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>
</tbody>
</table>


<a name="#string_flag"></a>
## string_flag

<pre>
string_flag(<a href="#string_flag-name">name</a>)
</pre>



### Attributes

<table class="params-table">
<colgroup>
<col class="col-param" />
<col class="col-description" />
</colgroup>
<tbody>
<tr id="string_flag-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>
</tbody>
</table>


## _build_setting_impl

<pre>
_build_setting_impl(<a href="#_build_setting_impl-ctx">ctx</a>)
</pre>



### Parameters

<table class="params-table">
<colgroup>
<col class="col-param" />
<col class="col-description" />
</colgroup>
<tbody>
<tr id="_build_setting_impl-ctx>
<td><code>ctx</code></td>
<td>
required.
</td>
</tr>
</tbody>
</table>


## exercise_the_api

<pre>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
def exercise_the_api():
# TODO(juliexxia): This isn't actually where this module would be used.
# Move this to the rule definition when the relevant parameter is set up.
_var5 = config.int(flag = True)
_var6 = configuration_field("foo", "bar")

exercise_the_api()

def _build_setting_impl(ctx):
return []

string_flag = rule(
implementation = _build_setting_impl,
build_setting = config.string(flag = True),
)

int_setting = rule(
implementation = _build_setting_impl,
build_setting = config.int(flag = False),
)

0 comments on commit 9734da6

Please sign in to comment.