|
| 1 | +<!-- Generated with Stardoc: http://skydoc.bazel.build --> |
| 2 | + |
| 3 | +Skylib module containing a library rule for aggregating rules files. |
| 4 | + |
| 5 | +<a id="bzl_library"></a> |
| 6 | + |
| 7 | +## bzl_library |
| 8 | + |
| 9 | +<pre> |
| 10 | +bzl_library(<a href="#bzl_library-name">name</a>, <a href="#bzl_library-deps">deps</a>, <a href="#bzl_library-srcs">srcs</a>) |
| 11 | +</pre> |
| 12 | + |
| 13 | +Creates a logical collection of Starlark .bzl and .scl files. |
| 14 | + |
| 15 | +Example: |
| 16 | + Suppose your project has the following structure: |
| 17 | + |
| 18 | + ``` |
| 19 | + [workspace]/ |
| 20 | + WORKSPACE |
| 21 | + BUILD |
| 22 | + checkstyle/ |
| 23 | + BUILD |
| 24 | + checkstyle.bzl |
| 25 | + lua/ |
| 26 | + BUILD |
| 27 | + lua.bzl |
| 28 | + luarocks.bzl |
| 29 | + ``` |
| 30 | + |
| 31 | + In this case, you can have `bzl_library` targets in `checkstyle/BUILD` and |
| 32 | + `lua/BUILD`: |
| 33 | + |
| 34 | + `checkstyle/BUILD`: |
| 35 | + |
| 36 | + ```python |
| 37 | + load("@bazel_skylib//:bzl_library.bzl", "bzl_library") |
| 38 | + |
| 39 | + bzl_library( |
| 40 | + name = "checkstyle-rules", |
| 41 | + srcs = ["checkstyle.bzl"], |
| 42 | + ) |
| 43 | + ``` |
| 44 | + |
| 45 | + `lua/BUILD`: |
| 46 | + |
| 47 | + ```python |
| 48 | + load("@bazel_skylib//:bzl_library.bzl", "bzl_library") |
| 49 | + |
| 50 | + bzl_library( |
| 51 | + name = "lua-rules", |
| 52 | + srcs = [ |
| 53 | + "lua.bzl", |
| 54 | + "luarocks.bzl", |
| 55 | + ], |
| 56 | + ) |
| 57 | + ``` |
| 58 | + |
| 59 | + |
| 60 | +**ATTRIBUTES** |
| 61 | + |
| 62 | + |
| 63 | +| Name | Description | Type | Mandatory | Default | |
| 64 | +| :------------- | :------------- | :------------- | :------------- | :------------- | |
| 65 | +| <a id="bzl_library-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | | |
| 66 | +| <a id="bzl_library-deps"></a>deps | List of other <code>bzl_library</code> targets that are required by the Starlark files listed in <code>srcs</code>. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | <code>[]</code> | |
| 67 | +| <a id="bzl_library-srcs"></a>srcs | List of <code>.bzl</code> and <code>.scl</code> files that are processed to create this target. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | <code>[]</code> | |
| 68 | + |
| 69 | + |
| 70 | +<a id="StarlarkLibraryInfo"></a> |
| 71 | + |
| 72 | +## StarlarkLibraryInfo |
| 73 | + |
| 74 | +<pre> |
| 75 | +StarlarkLibraryInfo(<a href="#StarlarkLibraryInfo-srcs">srcs</a>, <a href="#StarlarkLibraryInfo-transitive_srcs">transitive_srcs</a>) |
| 76 | +</pre> |
| 77 | + |
| 78 | +Information on contained Starlark rules. |
| 79 | + |
| 80 | +**FIELDS** |
| 81 | + |
| 82 | + |
| 83 | +| Name | Description | |
| 84 | +| :------------- | :------------- | |
| 85 | +| <a id="StarlarkLibraryInfo-srcs"></a>srcs | Top level rules files. | |
| 86 | +| <a id="StarlarkLibraryInfo-transitive_srcs"></a>transitive_srcs | Transitive closure of rules files required for interpretation of the srcs | |
| 87 | + |
| 88 | + |
0 commit comments