You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| <aid="swift_common.compilation_attrs-additional_deps_aspects"></a>additional_deps_aspects | A list of additional aspects that should be applied to `deps`. Defaults to the empty list. These must be passed by the individual rules to avoid potential circular dependencies between the API and the aspects; the API loaded the aspects directly, then those aspects would not be able to load the API. |`[]`|
72
73
| <aid="swift_common.compilation_attrs-additional_deps_providers"></a>additional_deps_providers | A list of lists representing additional providers that should be allowed by the `deps` attribute of the rule. |`[]`|
74
+
| <aid="swift_common.compilation_attrs-include_dev_srch_paths_attrib"></a>include_dev_srch_paths_attrib | A `bool` that indicates whether to include the `always_include_developer_search_paths` attribute. |`False`|
73
75
| <aid="swift_common.compilation_attrs-requires_srcs"></a>requires_srcs | Indicates whether the `srcs` attribute should be marked as mandatory and non-empty. Defaults to `True`. |`True`|
74
76
75
77
**RETURNS**
@@ -85,8 +87,9 @@ A new attribute dictionary that can be added to the attributes of a
| <aid="swift_common.compile-extra_swift_infos"></a>extra_swift_infos | Extra `SwiftInfo` providers that aren't contained by the `deps` of the target being compiled but are required for compilation. |`[]`|
105
108
| <aid="swift_common.compile-feature_configuration"></a>feature_configuration | A feature configuration obtained from `swift_common.configure_features`. | none |
106
109
| <aid="swift_common.compile-generated_header_name"></a>generated_header_name | The name of the Objective-C generated header that should be generated for this module. If omitted, no header will be generated. |`None`|
107
-
| <aid="swift_common.compile-is_test"></a>is_test | Represents if the `testonly` value of the context. | none |
110
+
| <aid="swift_common.compile-is_test"></a>is_test | Deprecated. This argument will be removed in the next major release. Use the `include_dev_srch_paths` attribute instead. Represents if the `testonly` value of the context. |`None`|
111
+
| <aid="swift_common.compile-include_dev_srch_paths"></a>include_dev_srch_paths | A `bool` that indicates whether the developer framework search paths will be added to the compilation command. |`None`|
108
112
| <aid="swift_common.compile-module_name"></a>module_name | The name of the Swift module being compiled. This must be present and valid; use `swift_common.derive_module_name` to generate a default from the target's label if needed. | none |
109
113
| <aid="swift_common.compile-package_name"></a>package_name | The semantic package of the name of the Swift module being compiled. | none |
110
114
| <aid="swift_common.compile-plugins"></a>plugins | A list of `SwiftCompilerPluginInfo` providers that represent plugins that should be loaded by the compiler. |`[]`|
@@ -291,7 +295,8 @@ A `struct` containing four fields:
@@ -316,7 +321,8 @@ command line parameters file, those actions will be created here.
316
321
| <aid="swift_common.create_linking_context_from_compilation_outputs-alwayslink"></a>alwayslink | If True, any binary that depends on the providers returned by this function will link in all of the library's object files, even if some contain no symbols referenced by the binary. |`False`|
317
322
| <aid="swift_common.create_linking_context_from_compilation_outputs-compilation_outputs"></a>compilation_outputs | A `CcCompilationOutputs` value containing the object files to link. Typically, this is the second tuple element in the value returned by `swift_common.compile`. | none |
318
323
| <aid="swift_common.create_linking_context_from_compilation_outputs-feature_configuration"></a>feature_configuration | A feature configuration obtained from `swift_common.configure_features`. | none |
319
-
| <aid="swift_common.create_linking_context_from_compilation_outputs-is_test"></a>is_test | Represents if the `testonly` value of the context. | none |
324
+
| <aid="swift_common.create_linking_context_from_compilation_outputs-is_test"></a>is_test | Deprecated. This argument will be removed in the next major release. Use the `include_dev_srch_paths` attribute instead. Represents if the `testonly` value of the context. |`None`|
325
+
| <aid="swift_common.create_linking_context_from_compilation_outputs-include_dev_srch_paths"></a>include_dev_srch_paths | A `bool` that indicates whether the developer framework search paths will be added to the compilation command. |`None`|
320
326
| <aid="swift_common.create_linking_context_from_compilation_outputs-label"></a>label | The `Label` of the target being built. This is used as the owner of the linker inputs created for post-compile actions (if any), and the label's name component also determines the name of the artifact unless it is overridden by the `name` argument. | none |
321
327
| <aid="swift_common.create_linking_context_from_compilation_outputs-linking_contexts"></a>linking_contexts | A `list` of `CcLinkingContext`s containing libraries from dependencies. |`[]`|
322
328
| <aid="swift_common.create_linking_context_from_compilation_outputs-module_context"></a>module_context | The module context returned by `swift_common.compile` containing information about the Swift module that was compiled. Typically, this is the first tuple element in the value returned by `swift_common.compile`. | none |
Compiles and links Swift code into a static library and Swift module.
@@ -371,6 +371,7 @@ Compiles and links Swift code into a static library and Swift module.
371
371
| <aid="swift_library-deps"></a>deps | A list of targets that are dependencies of the target being built, which will be linked into that target.<br><br>If the Swift toolchain supports implementation-only imports (`private_deps` on `swift_library`), then targets in `deps` are treated as regular (non-implementation-only) imports that are propagated both to their direct and indirect (transitive) dependents.<br><br>Allowed kinds of dependencies are:<br><br>*`swift_c_module`, `swift_import` and `swift_library` (or anything propagating `SwiftInfo`)<br><br>*`cc_library` (or anything propagating `CcInfo`)<br><br>Additionally, on platforms that support Objective-C interop, `objc_library` targets (or anything propagating the `apple_common.Objc` provider) are allowed as dependencies. On platforms that do not support Objective-C interop (such as Linux), those dependencies will be **ignored.**| <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
372
372
| <aid="swift_library-srcs"></a>srcs | A list of `.swift` source files that will be compiled into the library. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | required ||
373
373
| <aid="swift_library-data"></a>data | The list of files needed by this target at runtime.<br><br>Files and targets named in the `data` attribute will appear in the `*.runfiles` area of this target, if it has one. This may include data files needed by a binary or library, or other programs needed by it. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
374
+
| <aid="swift_library-always_include_developer_search_paths"></a>always_include_developer_search_paths | If `True`, the developer framework search paths will be added to the compilation command. This enables a Swift module to access `XCTest` without having to mark the target as `testonly = True`. | Boolean | optional |`False`|
374
375
| <aid="swift_library-alwayslink"></a>alwayslink | If true, any binary that depends (directly or indirectly) on this Swift module will link in all the object files for the files listed in `srcs`, even if some contain no symbols referenced by the binary. This is useful if your code isn't explicitly called by code in the binary; for example, if you rely on runtime checks for protocol conformances added in extensions in the library but do not directly reference any other symbols in the object file that adds that conformance. | Boolean | optional |`False`|
375
376
| <aid="swift_library-copts"></a>copts | Additional compiler options that should be passed to `swiftc`. These strings are subject to `$(location ...)` and ["Make" variable](https://docs.bazel.build/versions/master/be/make-variables.html) expansion. | List of strings | optional |`[]`|
376
377
| <aid="swift_library-defines"></a>defines | A list of 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 `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 `copts`, only using this feature in the rare case that a library needs to propagate a symbol up to those that depend on it. | List of strings | optional |`[]`|
0 commit comments