-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update config_apis_test to properly use the 'config' module.
#5577 PiperOrigin-RevId: 223033716
- Loading branch information
Showing
2 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
src/test/java/com/google/devtools/build/skydoc/testdata/config_apis_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
16 changes: 13 additions & 3 deletions
16
src/test/java/com/google/devtools/build/skydoc/testdata/config_apis_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 |
---|---|---|
@@ -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), | ||
) |