chore: document JQ_BIN make var

This commit is contained in:
Alex Eagle 2023-07-26 13:10:41 -07:00
parent 4231d45afc
commit c6e9fa0e62
3 changed files with 27 additions and 1 deletions

13
docs/jq.md generated
View File

@ -110,6 +110,19 @@ jq(
)
```
You could also use it directly from a `genrule` by referencing the toolchain, and the `JQ_BIN`
"Make variable" it exposes:
```
genrule(
name = "case_genrule",
srcs = ["a.json"],
outs = ["genrule_output.json"],
cmd = "$(JQ_BIN) '.' $(location a.json) > $@",
toolchains = ["@jq_toolchains//:resolved_toolchain"],
)
```
**PARAMETERS**

2
docs/repo_utils.md generated
View File

@ -130,7 +130,7 @@ Returns the name of the host operating system
**RETURNS**
The string "windows", "linux" or "darwin" that describes the host os
The string "windows", "linux", "freebsd" or "darwin" that describes the host os
<a id="repo_utils.platform"></a>

View File

@ -109,6 +109,19 @@ def jq(name, srcs, filter = None, filter_file = None, args = [], out = None, **k
)
```
You could also use it directly from a `genrule` by referencing the toolchain, and the `JQ_BIN`
"Make variable" it exposes:
```
genrule(
name = "case_genrule",
srcs = ["a.json"],
outs = ["genrule_output.json"],
cmd = "$(JQ_BIN) '.' $(location a.json) > $@",
toolchains = ["@jq_toolchains//:resolved_toolchain"],
)
```
Args:
name: Name of the rule
srcs: List of input files. May be empty.