Skylib module containing a library rule for aggregating rules files.

bzl_library

Creates a logical collection of Starlark .bzl and .scl files.

Example: Suppose your project has the following structure:

[workspace]/
    WORKSPACE
    BUILD
    checkstyle/
        BUILD
        checkstyle.bzl
    lua/
        BUILD
        lua.bzl
        luarocks.bzl

In this case, you can have bzl_library targets in checkstyle/BUILD and lua/BUILD:

checkstyle/BUILD:

load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

bzl_library(
    name = "checkstyle-rules",
    srcs = ["checkstyle.bzl"],
)

lua/BUILD:

load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

bzl_library(
    name = "lua-rules",
    srcs = [
        "lua.bzl",
        "luarocks.bzl",
    ],
)

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
depsList of other bzl_library or filegroup targets that are required by the Starlark files listed in srcs.List of labelsoptional[]
srcsList of .bzl and .scl files that are processed to create this target.List of labelsoptional[]

StarlarkLibraryInfo

Information on contained Starlark rules.

FIELDS

NameDescription
srcsTop level rules files.
transitive_srcsTransitive closure of rules files required for interpretation of the srcs