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
Add always_include_developer_search_paths to mixed_language_library (#1539)
This allows Swift code in the library to depend on XCTest.
If this was passed in `kwargs`, it gets passed along to the internal
`objc_library` targets:
```
~/Development/rules_swift master $ bazel build //examples/apple/mixed_language:MixedAnswer
ERROR: /Users/jschear/Development/rules_swift/examples/apple/mixed_language/BUILD:5:23: //examples/apple/mixed_language:MixedAnswer_headers: no such attribute 'always_include_developer_search_paths' in 'objc_library' rule
ERROR: /Users/jschear/Development/rules_swift/examples/apple/mixed_language/BUILD:5:23: //examples/apple/mixed_language:MixedAnswer_clang: no such attribute 'always_include_developer_search_paths' in 'objc_library' rule
```
We _could_ alternatively `.pop` it off of `kwargs` before passing to
`objc_library`, but tracking which attributes belong to `swift_library`
vs. `obj_library` and which are shared can get a bit complex.
| <aid="mixed_language_library-name"></a>name | The name of the target. | none |
1089
+
| <aid="mixed_language_library-always_include_developer_search_paths"></a>always_include_developer_search_paths | If `True`, the developer framework search paths will be added to the swift compilation command. This enables a Swift module to access `XCTest` without having to mark the target as `testonly = True`. |`False`|
1088
1090
| <aid="mixed_language_library-alwayslink"></a>alwayslink | If true, any binary that depends (directly or indirectly) on this library will link in all the object files for the files listed in `clang_srcs` and `swift_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. |`False`|
1089
1091
| <aid="mixed_language_library-clang_copts"></a>clang_copts | The compiler flags for the clang library. These will only be used for the clang library. If you want them to affect the swift library as well, you need to pass them with `-Xcc` in `swift_copts`. |`[]`|
1090
1092
| <aid="mixed_language_library-clang_defines"></a>clang_defines | Extra clang `-D` flags to pass to the compiler. They should be in the form `KEY=VALUE` or simply `KEY` and are passed not only to the compiler for this target (as `clang_copts` are) but also to all dependers of this target. Subject to "Make variable" substitution and Bourne shell tokenization. |`[]`|
0 commit comments