aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorThomas Van Lenten <thomasvl@google.com>2018-08-24 15:00:13 -0400
committerThomas Van Lenten <thomasvl@google.com>2018-08-24 15:00:13 -0400
commitb5f4086001aa239cb5fc8e34adc1f65e827709e0 (patch)
treed3351803a02211e1b5e2ce64b0a7d3e5184255bc /README.md
parentca5f717ebaf0372b9dc1ea98b97c240f96c4fa09 (diff)
downloadbazel-skylib-b5f4086001aa239cb5fc8e34adc1f65e827709e0.tar.gz
Remove usage and suggests for lib.bzl.
As more things are added, lib.bzl is an anti-pattern as the cost of loading it actually just keeps increasing and most things will never use everything out of it. The pattern the should be used is to directly import the modules one uses.
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 6 insertions, 20 deletions
diff --git a/README.md b/README.md
index d6d83f4..6b80e43 100644
--- a/README.md
+++ b/README.md
@@ -12,8 +12,7 @@ build rules in Bazel.
Each of the `.bzl` files in the `lib` directory defines a "module"&mdash;a
`struct` that contains a set of related functions and/or other symbols that can
-be loaded as a single unit, for convenience. The top-level file `lib.bzl` acts
-as an index from which the other modules can be imported.
+be loaded as a single unit, for convenience.
## Getting Started
@@ -30,17 +29,18 @@ git_repository(
```
Then, in the `BUILD` and/or `*.bzl` files in your own workspace, you can load
-the modules (listed [below](#list-of-modules)) from `lib.bzl` and access the
-symbols by dotting into those structs:
+the modules (listed [below](#list-of-modules)) and access the symbols by
+dotting into those structs:
```python
-load("@bazel_skylib//:lib.bzl", "paths", "shell")
+load("@bazel_skylib//lib/paths.bzl", "paths")
+load("@bazel_skylib//lib/shell.bzl", "shell")
p = paths.basename("foo.bar")
s = shell.quote(p)
```
-## List of modules
+## List of modules (in lib/)
* [collections](lib/collections.bzl)
* [dicts](lib/dicts.bzl)
@@ -78,20 +78,6 @@ Steps to add a module to Skylib:
)
```
-1. Add a line to `lib.bzl` to make the new module accessible from the index:
-
- ```python
- load("@bazel_skylib//lib:things.bzl", "things")
- ```
-
-1. Clients can then use the module by loading it from `lib.bzl`:
-
- ```python
- load("@bazel_skylib//:lib.bzl", "things")
-
- things.manipulate()
- ```
-
1. Add unit tests for your module in the `tests` directory.
## `skylark_library`