From 18de315b074117bd2a1c10a8f42dffb0215bd6fb Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 15 Jun 2018 06:22:29 -0700 Subject: 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 --- site/docs/skylark/repository_rules.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'site') 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 -- cgit v1.2.3