@@ -27,10 +27,27 @@ load(
2727 "DocCBundleInfo" ,
2828 "DocCSymbolGraphsInfo" ,
2929)
30+ load (
31+ "//apple/internal:apple_toolchains.bzl" ,
32+ "AppleXPlatToolsToolchainInfo" ,
33+ "apple_toolchain_utils" ,
34+ )
35+ load (
36+ "//apple/internal:features_support.bzl" ,
37+ "features_support" ,
38+ )
39+ load (
40+ "//apple/internal:platform_support.bzl" ,
41+ "platform_support" ,
42+ )
3043load (
3144 "//apple/internal:providers.bzl" ,
3245 "new_applebinaryinfo" ,
3346)
47+ load (
48+ "//apple/internal:swift_support.bzl" ,
49+ "swift_support" ,
50+ )
3451load (
3552 "//apple/internal/aspects:docc_archive_aspect.bzl" ,
3653 "docc_bundle_info_aspect" ,
@@ -42,23 +59,44 @@ def _docc_archive_impl(ctx):
4259 """
4360
4461 apple_fragment = ctx .fragments .apple
62+ apple_xplat_toolchain_info = ctx .attr ._xplat_toolchain [AppleXPlatToolsToolchainInfo ]
4563 default_code_listing_language = ctx .attr .default_code_listing_language
4664 diagnostic_level = ctx .attr .diagnostic_level
4765 enable_inherited_docs = ctx .attr .enable_inherited_docs
4866 execution_requirements = {}
4967 fallback_bundle_identifier = ctx .attr .fallback_bundle_identifier
5068 fallback_bundle_version = ctx .attr .fallback_bundle_version
5169 fallback_display_name = ctx .attr .fallback_display_name
70+ features = features_support .compute_enabled_features (
71+ requested_features = ctx .features ,
72+ unsupported_features = ctx .disabled_features ,
73+ )
5274 hosting_base_path = ctx .attr .hosting_base_path
5375 kinds = ctx .attr .kinds
54- platform = ctx .fragments .apple .single_arch_platform
5576 transform_for_static_hosting = ctx .attr .transform_for_static_hosting
5677 xcode_config = ctx .attr ._xcode_config [apple_common .XcodeVersionConfig ]
5778 dep = ctx .attr .dep
5879 symbol_graphs_info = None
5980 docc_bundle_info = None
6081 docc_build_inputs = []
6182
83+ platform_prerequisites = platform_support .platform_prerequisites (
84+ apple_fragment = ctx .fragments .apple ,
85+ apple_platform_info = platform_support .apple_platform_info_from_rule_ctx (ctx ),
86+ build_settings = apple_xplat_toolchain_info .build_settings ,
87+ config_vars = ctx .var ,
88+ cpp_fragment = ctx .fragments .cpp ,
89+ device_families = None ,
90+ explicit_minimum_deployment_os = None ,
91+ explicit_minimum_os = None ,
92+ features = features ,
93+ objc_fragment = ctx .fragments .objc ,
94+ uses_swift = swift_support .uses_swift ([ctx .attr .dep ]),
95+ xcode_version_config = ctx .attr ._xcode_config [apple_common .XcodeVersionConfig ],
96+ )
97+
98+ platform = platform_prerequisites .platform
99+
62100 if DocCSymbolGraphsInfo in dep :
63101 symbol_graphs_info = dep [DocCSymbolGraphsInfo ]
64102 if DocCBundleInfo in dep :
@@ -167,7 +205,11 @@ def _docc_archive_impl(ctx):
167205
168206docc_archive = rule (
169207 implementation = _docc_archive_impl ,
170- fragments = ["apple" ],
208+ fragments = [
209+ "apple" ,
210+ "cpp" ,
211+ "objc" ,
212+ ],
171213 doc = """
172214Builds a .doccarchive for the given dependency.
173215The target created by this rule can also be `run` to preview the generated documentation in Xcode.
@@ -189,6 +231,8 @@ docc_archive(
189231```""" ,
190232 attrs = dicts .add (
191233 apple_support .action_required_attrs (),
234+ apple_support .platform_constraint_attrs (),
235+ apple_toolchain_utils .shared_attrs (),
192236 {
193237 "dep" : attr .label (
194238 aspects = [
0 commit comments