@@ -18,50 +18,33 @@ load(
1818 "@bazel_skylib//lib:partial.bzl" ,
1919 "partial" ,
2020)
21- load (
22- "@bazel_skylib//lib:paths.bzl" ,
23- "paths" ,
24- )
2521load ("@rules_cc//cc/common:cc_common.bzl" , "cc_common" )
2622load ("@rules_cc//cc/common:cc_info.bzl" , "CcInfo" )
2723load ("//apple/internal:providers.bzl" , "new_appledynamicframeworkinfo" )
2824
2925def _framework_provider_partial_impl (
3026 * ,
3127 actions ,
32- bin_root_path ,
3328 binary_artifact ,
34- bundle_name ,
3529 bundle_only ,
36- cc_features ,
30+ cc_configured_features_init ,
3731 cc_info ,
3832 cc_toolchain ,
33+ disabled_features ,
34+ features ,
3935 rule_label ):
4036 """Implementation for the framework provider partial."""
4137
42- # Create a directory structure that the linker can use to reference this
43- # framework. It follows the pattern of
44- # any_path/MyFramework.framework/MyFramework. The absolute path and files are
45- # propagated using the AppleDynamicFrameworkInfo provider.
46- framework_dir = paths .join ("frameworks" , "%s.framework" % bundle_name )
47- framework_file = actions .declare_file (
48- paths .join (framework_dir , bundle_name ),
49- )
50- actions .symlink (
51- target_file = binary_artifact ,
52- output = framework_file ,
53- )
54-
55- absolute_framework_dir = paths .join (
56- bin_root_path ,
57- rule_label .package ,
58- framework_dir ,
38+ feature_configuration = cc_configured_features_init (
39+ cc_toolchain = cc_toolchain ,
40+ language = "objc" ,
41+ requested_features = features ,
42+ unsupported_features = disabled_features ,
5943 )
60-
6144 library_to_link = cc_common .create_library_to_link (
6245 actions = actions ,
6346 cc_toolchain = cc_toolchain ,
64- feature_configuration = cc_features ,
47+ feature_configuration = feature_configuration ,
6548 dynamic_library = binary_artifact ,
6649 )
6750 linker_input = cc_common .create_linker_input (
@@ -80,10 +63,7 @@ def _framework_provider_partial_impl(
8063 )
8164
8265 framework_provider = new_appledynamicframeworkinfo (
83- binary = binary_artifact ,
8466 cc_info = wrapper_cc_info ,
85- framework_dirs = depset ([absolute_framework_dir ]),
86- framework_files = depset ([framework_file ]),
8767 )
8868
8969 return struct (
@@ -93,13 +73,13 @@ def _framework_provider_partial_impl(
9373def framework_provider_partial (
9474 * ,
9575 actions ,
96- bin_root_path ,
9776 binary_artifact ,
98- bundle_name ,
9977 bundle_only ,
100- cc_features ,
78+ cc_configured_features_init ,
10179 cc_info ,
10280 cc_toolchain ,
81+ disabled_features ,
82+ features ,
10383 rule_label ):
10484 """Constructor for the framework provider partial.
10585
@@ -110,14 +90,15 @@ def framework_provider_partial(
11090
11191 Args:
11292 actions: The actions provider from `ctx.actions`.
113- bin_root_path: The path to the root `-bin` directory.
11493 binary_artifact: The linked dynamic framework binary.
115- bundle_name: The name of the output bundle.
11694 bundle_only: Only include the bundle but do not link the framework
117- cc_features: List of enabled C++ features.
95+ cc_configured_features_init: A lambda that is the same as cc_common.configure_features(...)
96+ without the need for a `ctx`.
11897 cc_info: The CcInfo provider containing information about the
11998 targets linked into the dynamic framework.
12099 cc_toolchain: The C++ toolchain to use.
100+ disabled_features: List of features to be disabled for C++ actions.
101+ features: List of features to be enabled for C++ actions.
121102 rule_label: The label of the target being analyzed.
122103
123104 Returns:
@@ -128,12 +109,12 @@ def framework_provider_partial(
128109 return partial .make (
129110 _framework_provider_partial_impl ,
130111 actions = actions ,
131- bin_root_path = bin_root_path ,
132112 binary_artifact = binary_artifact ,
133- bundle_name = bundle_name ,
134113 bundle_only = bundle_only ,
135- cc_features = cc_features ,
114+ cc_configured_features_init = cc_configured_features_init ,
136115 cc_info = cc_info ,
137116 cc_toolchain = cc_toolchain ,
117+ disabled_features = disabled_features ,
118+ features = features ,
138119 rule_label = rule_label ,
139120 )
0 commit comments