diff --git a/doc_build/BUILD b/doc_build/BUILD index d45155b0..a6f9d883 100644 --- a/doc_build/BUILD +++ b/doc_build/BUILD @@ -19,7 +19,6 @@ How to: git commit -m 'update docs' docs/latest.md """ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@rules_python//python:defs.bzl", "py_binary") load("@stardoc//stardoc:stardoc.bzl", "stardoc") load("//:version.bzl", "version") @@ -111,14 +110,9 @@ stardoc( ], ) -# gather all rules that should be documented -bzl_library( +alias( name = "rules_pkg_lib", - srcs = [ - "//:version.bzl", - "//pkg:bzl_srcs", - "@bazel_skylib//lib:paths", - ], + actual = "//pkg:rules_pkg_lib", visibility = ["//visibility:public"], ) diff --git a/pkg/BUILD b/pkg/BUILD index b3115f58..fecaba40 100644 --- a/pkg/BUILD +++ b/pkg/BUILD @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@rules_pkg//pkg/private:make_starlark_library.bzl", "starlark_library") # -*- coding: utf-8 -*- @@ -65,6 +66,18 @@ starlark_library( visibility = ["//visibility:public"], ) +# gather all rules that should be documented +bzl_library( + name = "rules_pkg_lib", + srcs = [ + "//:version.bzl", + "//pkg:bzl_srcs", + "@bazel_skylib//lib:paths", + "@rules_python//python:defs_bzl", + ], + visibility = ["//visibility:public"], +) + # Used by pkg_rpm in rpm.bzl. py_binary( name = "make_rpm", diff --git a/pkg/private/make_starlark_library.bzl b/pkg/private/make_starlark_library.bzl index c6b0dee9..c9c847a0 100644 --- a/pkg/private/make_starlark_library.bzl +++ b/pkg/private/make_starlark_library.bzl @@ -9,13 +9,10 @@ def _make_starlark_library(ctx): direct = [] transitive = [] for src in ctx.attr.srcs: - if StarlarkLibraryInfo in src: - transitive.append(src[StarlarkLibraryInfo]) - else: - for file in src[DefaultInfo].files.to_list(): - if file.path.endswith(".bzl"): - # print(file.path) - direct.append(file) + for file in src[DefaultInfo].files.to_list(): + if file.path.endswith(".bzl"): + # print(file.path) + direct.append(file) all_files = depset(direct, transitive = transitive) return [ DefaultInfo(files = all_files, runfiles = ctx.runfiles(transitive_files = all_files)),