Skip to content

Commit b7eb892

Browse files
authored
Support swift plugins in mixed_language_library (#1493)
1 parent 1696c73 commit b7eb892

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

doc/rules.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,8 @@ swift_library(
10671067
mixed_language_library(<a href="#mixed_language_library-name">name</a>, <a href="#mixed_language_library-alwayslink">alwayslink</a>, <a href="#mixed_language_library-clang_copts">clang_copts</a>, <a href="#mixed_language_library-clang_defines">clang_defines</a>, <a href="#mixed_language_library-clang_srcs">clang_srcs</a>, <a href="#mixed_language_library-data">data</a>,
10681068
<a href="#mixed_language_library-enable_modules">enable_modules</a>, <a href="#mixed_language_library-hdrs">hdrs</a>, <a href="#mixed_language_library-includes">includes</a>, <a href="#mixed_language_library-linkopts">linkopts</a>, <a href="#mixed_language_library-module_map">module_map</a>, <a href="#mixed_language_library-module_name">module_name</a>,
10691069
<a href="#mixed_language_library-non_arc_srcs">non_arc_srcs</a>, <a href="#mixed_language_library-package_name">package_name</a>, <a href="#mixed_language_library-private_deps">private_deps</a>, <a href="#mixed_language_library-sdk_dylibs">sdk_dylibs</a>, <a href="#mixed_language_library-sdk_frameworks">sdk_frameworks</a>,
1070-
<a href="#mixed_language_library-swift_copts">swift_copts</a>, <a href="#mixed_language_library-swift_defines">swift_defines</a>, <a href="#mixed_language_library-swift_srcs">swift_srcs</a>, <a href="#mixed_language_library-swiftc_inputs">swiftc_inputs</a>, <a href="#mixed_language_library-textual_hdrs">textual_hdrs</a>,
1071-
<a href="#mixed_language_library-umbrella_header">umbrella_header</a>, <a href="#mixed_language_library-weak_sdk_frameworks">weak_sdk_frameworks</a>, <a href="#mixed_language_library-deps">deps</a>, <a href="#mixed_language_library-kwargs">kwargs</a>)
1070+
<a href="#mixed_language_library-swift_copts">swift_copts</a>, <a href="#mixed_language_library-swift_defines">swift_defines</a>, <a href="#mixed_language_library-swift_plugins">swift_plugins</a>, <a href="#mixed_language_library-swift_srcs">swift_srcs</a>, <a href="#mixed_language_library-swiftc_inputs">swiftc_inputs</a>,
1071+
<a href="#mixed_language_library-textual_hdrs">textual_hdrs</a>, <a href="#mixed_language_library-umbrella_header">umbrella_header</a>, <a href="#mixed_language_library-weak_sdk_frameworks">weak_sdk_frameworks</a>, <a href="#mixed_language_library-deps">deps</a>, <a href="#mixed_language_library-kwargs">kwargs</a>)
10721072
</pre>
10731073

10741074
Creates a mixed language library from a Clang and Swift library target pair.
@@ -1101,6 +1101,7 @@ Once that is the case, this macro will be deprecated.
11011101
| <a id="mixed_language_library-sdk_frameworks"></a>sdk_frameworks | A list of SDK frameworks to link with (e.g. "AddressBook", "QuartzCore").<br><br>When linking a top level Apple binary, all SDK frameworks listed in that binary's transitive dependency graph are linked. | `[]` |
11021102
| <a id="mixed_language_library-swift_copts"></a>swift_copts | The compiler flags for the swift library. | `[]` |
11031103
| <a id="mixed_language_library-swift_defines"></a>swift_defines | A list of Swift defines to add to the compilation command line.<br><br>Note that unlike C-family languages, Swift defines do not have values; they are simply identifiers that are either defined or undefined. So strings in this list should be simple identifiers, not `name=value` pairs.<br><br>Each string is prepended with `-D` and added to the command line. Unlike `swift_copts`, these flags are added for the target and every target that depends on it, so use this attribute with caution. It is preferred that you add defines directly to `swift_copts`, only using this feature in the rare case that a library needs to propagate a symbol up to those that depend on it. | `[]` |
1104+
| <a id="mixed_language_library-swift_plugins"></a>swift_plugins | A list of Swift plugins for the swift library. | `[]` |
11041105
| <a id="mixed_language_library-swift_srcs"></a>swift_srcs | The sources for the swift library. | none |
11051106
| <a id="mixed_language_library-swiftc_inputs"></a>swiftc_inputs | Additional files that are referenced using `$(location ...)` in attributes that support location expansion. | `[]` |
11061107
| <a id="mixed_language_library-textual_hdrs"></a>textual_hdrs | The list of C, C++, Objective-C, or Objective-C++ files that are included as headers by source files in this rule or by users of this library. Unlike `hdrs`, these will not be compiled separately from the sources. | `[]` |

mixed_language/mixed_language_library.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def mixed_language_library(
5353
sdk_frameworks = [],
5454
swift_copts = [],
5555
swift_defines = [],
56+
swift_plugins = [],
5657
swift_srcs,
5758
swiftc_inputs = [],
5859
textual_hdrs = [],
@@ -152,6 +153,7 @@ def mixed_language_library(
152153
It is preferred that you add defines directly to `swift_copts`, only
153154
using this feature in the rare case that a library needs to
154155
propagate a symbol up to those that depend on it.
156+
swift_plugins: A list of Swift plugins for the swift library.
155157
swift_srcs: The sources for the swift library.
156158
swiftc_inputs: Additional files that are referenced using
157159
`$(location ...)` in attributes that support location expansion.
@@ -319,6 +321,7 @@ a mixed language Swift library, use a clang only library rule like \
319321
linkopts = linkopts,
320322
module_name = module_name,
321323
package_name = package_name,
324+
plugins = swift_plugins,
322325
private_deps = private_deps,
323326
swiftc_inputs = swiftc_inputs,
324327
tags = internal_tags,

0 commit comments

Comments
 (0)