@@ -109,38 +109,25 @@ def _get_framework_info_providers(ctx, old_cc_info, old_objc_provider):
109
109
110
110
def _apple_framework_import_modulemap_impl (ctx ):
111
111
legacy_target = ctx .attr .legacy_target
112
- old_objc_provider = legacy_target [apple_common .Objc ]
112
+ objc_provider = legacy_target [apple_common .Objc ]
113
113
old_cc_info = legacy_target [CcInfo ]
114
114
115
115
# Merge providers
116
- objc_provider_fields = {
117
- "providers" : [old_objc_provider ],
118
- # Adding the module_map to the headers.
119
- # This "hack" is just a way to propagate the module map. swift_rules has a field in its provider
120
- # called swiftc_inputs where you can pass extra dependencies to the compiler. Unfortunately
121
- # the objc provider has no such field. The "hack" is to pass the module map as a header so that
122
- # it makes it to the list of dependencies. Since it doesn't end in .h it gets ignored but it's
123
- # still propagated as a dependency. This "hack" is based on:
124
- # a) https://github.com/bazelbuild/rules_apple/blob/313eeb838497e230f01a7367ae4555aaf0cac62e/apple/internal/apple_framework_import.bzl#L98
125
- # b) https://github.com/bazel-ios/rules_ios/blob/1755c694f8d5cc1ed256bba7ccf122a3fbc4addf/rules/framework.bzl#L247
126
- "header" : old_objc_provider .module_map ,
127
- }
128
- new_objc_provider = apple_common .new_objc_provider (** objc_provider_fields )
129
116
new_cc_info = cc_common .merge_cc_infos (
130
117
cc_infos = [
131
118
old_cc_info ,
132
- CcInfo (compilation_context = cc_common .create_compilation_context (headers = old_objc_provider .module_map )),
119
+ CcInfo (compilation_context = cc_common .create_compilation_context (headers = objc_provider .module_map )),
133
120
],
134
121
)
135
122
136
- additional_providers = _get_framework_info_providers (ctx , old_cc_info , old_objc_provider )
123
+ additional_providers = _get_framework_info_providers (ctx , old_cc_info , objc_provider )
137
124
138
125
# Seems that there is no way to iterate on the existing providers, so what is possible instead
139
126
# is to list here the keys to all of them (you can see the keys for the existing providers of a
140
127
# target by just printing the target)
141
128
# For more information refer to https://groups.google.com/forum/#!topic/bazel-discuss/4KkflTjmUyk
142
129
other_provider_keys = [AppleFrameworkImportInfo , SwiftUsageInfo , apple_common .AppleDynamicFramework , OutputGroupInfo , DefaultInfo ]
143
- return additional_providers + [new_objc_provider , new_cc_info ] + \
130
+ return additional_providers + [objc_provider , new_cc_info ] + \
144
131
[legacy_target [provider_key ] for provider_key in other_provider_keys if provider_key in legacy_target ]
145
132
146
133
_apple_framework_import_modulemap = rule (
0 commit comments