aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/docs/skylark/concepts.md
diff options
context:
space:
mode:
authorGravatar Florian Weikert <fwe@google.com>2015-07-23 14:43:55 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-07-27 08:31:26 +0000
commit6234080eb9eba204f1ce66d2761ac7d531765e7a (patch)
treea05c015fd59fc905a6ceda45f5df060f884e6a41 /site/docs/skylark/concepts.md
parent76c27a7740979cec1e9eb8040aa6f10da69474b5 (diff)
Updated Skylark documentation in order to mention load()'s new alias feature
-- MOS_MIGRATED_REVID=98933598
Diffstat (limited to 'site/docs/skylark/concepts.md')
-rw-r--r--site/docs/skylark/concepts.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/site/docs/skylark/concepts.md b/site/docs/skylark/concepts.md
index 2f3838a4df..33f470d060 100644
--- a/site/docs/skylark/concepts.md
+++ b/site/docs/skylark/concepts.md
@@ -18,6 +18,21 @@ imported by using additional arguments to the call to `load`. Arguments must
be string literals (no variable) and `load` statements must appear at
top-level, i.e. they cannot be in a function body.
+`load` also supports aliases, i.e. you can assign different names to the
+imported symbols.
+
+```python
+load("/build_tools/rules/maprule", maprule_alias = "maprule")
+```
+
+You define multiple aliases within one `load` statement. Moreover, the argument
+list can contain both aliases and regular symbol names. The following example is
+perfectly legal (please note when to use quotation marks).
+
+```python
+load("/path/to/my_rules", "some_rule", nice_alias = "some_other_rule", additional_alias = "one_more_rule")
+```
+
Visibility doesn't affect loading. You don't need to use `exports_files`
to make a Skylark file visible.