diff --git a/rules/library.bzl b/rules/library.bzl index 3d098c5a..fcad348b 100644 --- a/rules/library.bzl +++ b/rules/library.bzl @@ -1,5 +1,6 @@ """Library rules""" +load("@bazel_skylib//lib:dicts.bzl", "dicts") load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_skylib//lib:sets.bzl", "sets") load("@bazel_skylib//lib:selects.bzl", "selects") @@ -582,6 +583,7 @@ def apple_library( defines = kwargs.pop("defines", []) testonly = kwargs.pop("testonly", False) features = kwargs.pop("features", []) + plugins = kwargs.pop("plugins", None) for (k, v) in {"momc_copts": momc_copts, "mapc_copts": mapc_copts, "ibtool_copts": ibtool_copts}.items(): if v: @@ -960,6 +962,9 @@ def apple_library( ) if swift_sources: + # To be backward compatible with rules_apple 2.x + swift_kwargs = dicts.add(kwargs, {"plugins": plugins} if plugins else {}) + swift_library( name = swift_libname, module_name = module_name, @@ -985,7 +990,7 @@ def apple_library( tags = tags_manual, defines = defines + swift_defines, testonly = testonly, - **kwargs + **swift_kwargs ) lib_names.append(swift_libname)