From dd5985c4629c6c7410fb54c9fd370b3a5c09d5e9 Mon Sep 17 00:00:00 2001 From: Thiago Cruz Date: Thu, 4 Apr 2024 17:58:33 +0100 Subject: [PATCH] Revert "Forward package_name to swift_library part of apple_library (#853)" This reverts commit 3b0ca4c0 --- rules/library.bzl | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/rules/library.bzl b/rules/library.bzl index 1438defc..4e0e7a87 100644 --- a/rules/library.bzl +++ b/rules/library.bzl @@ -27,12 +27,6 @@ GLOBAL_INDEX_STORE_PATH = "bazel-out/_global_index_store" _MANUAL = ["manual"] -_SWIFT_LIBRARY_KWARGS = [ - "always_include_developer_search_paths", - "package_name", - "plugins", -] - def _private_headers_impl(ctx): return [ PrivateHeadersInfo( @@ -585,10 +579,8 @@ def apple_library( defines = kwargs.pop("defines", []) testonly = kwargs.pop("testonly", False) features = kwargs.pop("features", []) - - # Collect the swift_library related kwargs, these are typically only set when provided to allow - # for wider compatibility with rule_swift versions. - swift_kwargs = {arg: kwargs.pop(arg) for arg in _SWIFT_LIBRARY_KWARGS if arg in kwargs} + plugins = kwargs.pop("plugins", None) + always_include_developer_search_paths = kwargs.pop("always_include_developer_search_paths", None) for (k, v) in {"momc_copts": momc_copts, "mapc_copts": mapc_copts, "ibtool_copts": ibtool_copts}.items(): if v: @@ -970,8 +962,8 @@ def apple_library( ) if has_swift_sources: - # Forward the kwargs and the swift specific kwargs to the swift_library - swift_library_kwargs = dicts.add(kwargs, swift_kwargs) + # 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, @@ -997,7 +989,7 @@ def apple_library( tags = tags_manual, defines = defines + swift_defines, testonly = testonly, - **swift_library_kwargs + **swift_kwargs ) lib_names.append(swift_libname)