From 6234080eb9eba204f1ce66d2761ac7d531765e7a Mon Sep 17 00:00:00 2001 From: Florian Weikert Date: Thu, 23 Jul 2015 14:43:55 +0000 Subject: Updated Skylark documentation in order to mention load()'s new alias feature -- MOS_MIGRATED_REVID=98933598 --- site/docs/skylark/concepts.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'site/docs/skylark/concepts.md') 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. -- cgit v1.2.3