diff options
author | Klaus Aehlig <aehlig@google.com> | 2018-06-15 06:22:29 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-15 06:23:33 -0700 |
commit | 18de315b074117bd2a1c10a8f42dffb0215bd6fb (patch) | |
tree | 4f976d75907dd2ff713736bfa17152465b932e8a /site | |
parent | cca111fd1f9b4c52f9219f8e59bdcedf3836472f (diff) |
repository_rules.md: update documentation on return values
Since commit 97132c0925031e1b1fb8e9e5dde2233daef9d97b, repository rule
implementations are allowed to return other values than `None`. Describe
the currently supported values and their intended meaning.
Change-Id: I63dbbff4b232b36861aa2a6cfdc69352fa971f4d
PiperOrigin-RevId: 200707564
Diffstat (limited to 'site')
-rw-r--r-- | site/docs/skylark/repository_rules.md | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/site/docs/skylark/repository_rules.md b/site/docs/skylark/repository_rules.md index 8e492ac091..44e40e3240 100644 --- a/site/docs/skylark/repository_rules.md +++ b/site/docs/skylark/repository_rules.md @@ -51,8 +51,15 @@ If an attribute name starts with `_` it is private and users cannot set it. Every repository rule requires an `implementation` function. It contains the actual logic of the rule and is executed strictly in the Loading Phase. -The function has exactly one input parameter, `repository_ctx`, and should -always returns `None`. The input parameter `repository_ctx` can be used to + +The function has exactly one input parameter, `repository_ctx`. The function +returns either `None` to signify that the rule is reproducible, or a dict with a +set of parameters for that rule that would turn that rule into a reproducible +one generating the same repository. For example, for a rule tracking a git +repository that would mean returning a specific commit identifier instead of a +floating branch that was originally specified. + +The input parameter `repository_ctx` can be used to access attribute values, and non-hermetic functions (finding a binary, executing a binary, creating a file in the repository or downloading a file from the Internet). See [the library](lib/repository_ctx.html) for more |