Skip to content

Commit

Permalink
Make AppleDynamicFrameworkInfo public (#2620)
Browse files Browse the repository at this point in the history
`apple_common.AppleDynamicFramework` was public, so we need our version
to be public as well. There are rulesets that depend on the info in it.

Signed-off-by: Brentley Jones <github@brentleyjones.com>
  • Loading branch information
brentleyjones authored Dec 11, 2024
1 parent 348f5a4 commit 4c9163a
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 79 deletions.
3 changes: 1 addition & 2 deletions apple/internal/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ bzl_library(
":entitlements_support",
":providers",
":rule_support",
"//apple/internal/providers:apple_dynamic_framework_info",
"@bazel_skylib//lib:collections",
"@build_bazel_apple_support//lib:lipo",
],
Expand Down Expand Up @@ -426,6 +425,7 @@ bzl_library(
"//apple:__subpackages__",
],
deps = [
"//apple/internal:providers",
"//apple/internal/partials:app_assets_validation",
"//apple/internal/partials:app_intents_metadata_bundle",
"//apple/internal/partials:apple_bundle_info",
Expand All @@ -451,7 +451,6 @@ bzl_library(
"//apple/internal/partials:swift_dynamic_framework",
"//apple/internal/partials:swift_framework",
"//apple/internal/partials:watchos_stub",
"//apple/internal/providers:apple_dynamic_framework_info",
],
)

Expand Down
8 changes: 4 additions & 4 deletions apple/internal/apple_framework_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ load(
"//apple/internal:framework_import_support.bzl",
"framework_import_support",
)
load(
"//apple/internal:providers.bzl",
"new_appledynamicframeworkinfo",
)
load(
"//apple/internal:rule_attrs.bzl",
"rule_attrs",
Expand All @@ -69,10 +73,6 @@ load(
"//apple/internal/aspects:swift_usage_aspect.bzl",
"SwiftUsageInfo",
)
load(
"//apple/internal/providers:apple_dynamic_framework_info.bzl",
"new_appledynamicframeworkinfo",
)
load(
"//apple/internal/providers:framework_import_bundle_info.bzl",
"AppleFrameworkImportBundleInfo",
Expand Down
10 changes: 5 additions & 5 deletions apple/internal/apple_xcframework_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ load(
"framework_import_support",
)
load("//apple/internal:intermediates.bzl", "intermediates")
load(
"//apple/internal:providers.bzl",
"AppleDynamicFrameworkInfo",
"new_appledynamicframeworkinfo",
)
load("//apple/internal:rule_attrs.bzl", "rule_attrs")
load(
"//apple/internal/aspects:swift_usage_aspect.bzl",
"SwiftUsageInfo",
)
load(
"//apple/internal/providers:apple_dynamic_framework_info.bzl",
"AppleDynamicFrameworkInfo",
"new_appledynamicframeworkinfo",
)
load(
"//apple/internal/providers:framework_import_bundle_info.bzl",
"AppleFrameworkImportBundleInfo",
Expand Down
5 changes: 1 addition & 4 deletions apple/internal/linking_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ load(
)
load(
"//apple/internal:providers.bzl",
"AppleDynamicFrameworkInfo",
"AppleExecutableBinaryInfo",
"new_appledebugoutputsinfo",
)
load(
"//apple/internal/providers:apple_dynamic_framework_info.bzl",
"AppleDynamicFrameworkInfo",
)

ObjcInfo = apple_common.Objc

Expand Down
2 changes: 1 addition & 1 deletion apple/internal/partials/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ bzl_library(
],
deps = [
"//apple/internal:framework_import_support",
"//apple/internal/providers:apple_dynamic_framework_info",
"//apple/internal:providers",
"@bazel_skylib//lib:partial",
"@bazel_skylib//lib:paths",
],
Expand Down
5 changes: 1 addition & 4 deletions apple/internal/partials/framework_provider.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ load(
"@bazel_skylib//lib:paths.bzl",
"paths",
)
load(
"//apple/internal/providers:apple_dynamic_framework_info.bzl",
"new_appledynamicframeworkinfo",
)
load("//apple/internal:providers.bzl", "new_appledynamicframeworkinfo")

def _framework_provider_partial_impl(
*,
Expand Down
38 changes: 38 additions & 0 deletions apple/internal/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,44 @@ dependencies of the given target if any were generated.
init = _make_banned_init(provider_name = "AppleDsymBundleInfo"),
)

_AppleDynamicFrameworkInfo = provider(
doc = "Contains information about an Apple dynamic framework.",
fields = {
"framework_dirs": """\
The framework path names used as link inputs in order to link against the
dynamic framework.
""",
"framework_files": """\
The full set of artifacts that should be included as inputs to link against the
dynamic framework.
""",
"binary": "The dylib binary artifact of the dynamic framework.",
"cc_info": """\
A `CcInfo` which contains information about the transitive dependencies linked
into the binary.
""",
},
)

# TODO: Remove when we drop 7.x
AppleDynamicFrameworkInfo = getattr(
apple_common,
"AppleDynamicFramework",
_AppleDynamicFrameworkInfo,
)

# TODO: Remove when we drop 7.x
def new_appledynamicframeworkinfo(**kwargs):
legacy_initializer = getattr(
apple_common,
"new_dynamic_framework_provider",
None,
)
if legacy_initializer:
return legacy_initializer(**kwargs)

return AppleDynamicFrameworkInfo(**kwargs)

_AppleExecutableBinaryInfo = provider(
doc = """
Contains the executable binary output that was built using
Expand Down
10 changes: 0 additions & 10 deletions apple/internal/providers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ bzl_library(
],
)

bzl_library(
name = "apple_dynamic_framework_info",
srcs = ["apple_dynamic_framework_info.bzl"],
visibility = [
# Visibility set to subpackages since this provider is used
# by a number of rules in `internal`.
"//apple/internal:__subpackages__",
],
)

bzl_library(
name = "embeddable_info",
srcs = ["embeddable_info.bzl"],
Expand Down
49 changes: 0 additions & 49 deletions apple/internal/providers/apple_dynamic_framework_info.bzl

This file was deleted.

2 changes: 2 additions & 0 deletions apple/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ load(
_AppleCodesigningDossierInfo = "AppleCodesigningDossierInfo",
_AppleDebugOutputsInfo = "AppleDebugOutputsInfo",
_AppleDsymBundleInfo = "AppleDsymBundleInfo",
_AppleDynamicFrameworkInfo = "AppleDynamicFrameworkInfo",
_AppleExecutableBinaryInfo = "AppleExecutableBinaryInfo",
_AppleExtraOutputsInfo = "AppleExtraOutputsInfo",
_AppleFrameworkBundleInfo = "AppleFrameworkBundleInfo",
Expand Down Expand Up @@ -89,6 +90,7 @@ AppleBundleVersionInfo = _AppleBundleVersionInfo
AppleCodesigningDossierInfo = _AppleCodesigningDossierInfo
AppleDebugOutputsInfo = _AppleDebugOutputsInfo
AppleDsymBundleInfo = _AppleDsymBundleInfo
AppleDynamicFrameworkInfo = _AppleDynamicFrameworkInfo
AppleExecutableBinaryInfo = _AppleExecutableBinaryInfo
AppleExtraOutputsInfo = _AppleExtraOutputsInfo
AppleFrameworkBundleInfo = _AppleFrameworkBundleInfo
Expand Down
21 changes: 21 additions & 0 deletions doc/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,27 @@ Provides information for an Apple dSYM bundle.
| <a id="AppleDsymBundleInfo-transitive_dsyms"></a>transitive_dsyms | `depset` containing `File` references to each of the dSYM bundles that act as transitive dependencies of the given target if any were generated. |


<a id="AppleDynamicFrameworkInfo"></a>

## AppleDynamicFrameworkInfo

<pre>
AppleDynamicFrameworkInfo(<a href="#AppleDynamicFrameworkInfo-framework_dirs">framework_dirs</a>, <a href="#AppleDynamicFrameworkInfo-framework_files">framework_files</a>, <a href="#AppleDynamicFrameworkInfo-binary">binary</a>, <a href="#AppleDynamicFrameworkInfo-cc_info">cc_info</a>)
</pre>

Contains information about an Apple dynamic framework.

**FIELDS**


| Name | Description |
| :------------- | :------------- |
| <a id="AppleDynamicFrameworkInfo-framework_dirs"></a>framework_dirs | The framework path names used as link inputs in order to link against the dynamic framework. |
| <a id="AppleDynamicFrameworkInfo-framework_files"></a>framework_files | The full set of artifacts that should be included as inputs to link against the dynamic framework. |
| <a id="AppleDynamicFrameworkInfo-binary"></a>binary | The dylib binary artifact of the dynamic framework. |
| <a id="AppleDynamicFrameworkInfo-cc_info"></a>cc_info | A `CcInfo` which contains information about the transitive dependencies linked into the binary. |


<a id="AppleExecutableBinaryInfo"></a>

## AppleExecutableBinaryInfo
Expand Down

0 comments on commit 4c9163a

Please sign in to comment.