From da630a25bbdea2ad1edd717da8bb52c2d182d30c Mon Sep 17 00:00:00 2001 From: Thiago Cruz Date: Mon, 25 Mar 2024 17:43:06 -0400 Subject: [PATCH] Allow consumers to set always_include_developer_search_paths in swift_library (#852) https://github.com/bazelbuild/rules_swift/pull/1162 --- rules/library.bzl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rules/library.bzl b/rules/library.bzl index 4a716e4f..0a407b9b 100644 --- a/rules/library.bzl +++ b/rules/library.bzl @@ -579,6 +579,7 @@ def apple_library( testonly = kwargs.pop("testonly", False) features = kwargs.pop("features", []) 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: @@ -957,8 +958,15 @@ def apple_library( ) if swift_sources: + swift_kwargs = kwargs + # To be backward compatible with rules_apple 2.x - swift_kwargs = dicts.add(kwargs, {"plugins": plugins} if plugins else {}) + if plugins: + swift_kwargs = dicts.add(swift_kwargs, {"plugins": plugins}) + + # Allow consumers to opt-in to https://github.com/bazelbuild/rules_swift/pull/1162 + if always_include_developer_search_paths: + swift_kwargs = dicts.add(swift_kwargs, {"always_include_developer_search_paths": always_include_developer_search_paths}) swift_library( name = swift_libname,