Skip to content

Commit

Permalink
compat
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Aug 11, 2023
1 parent f161ad4 commit eb96faa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apple/internal/apple_xcframework_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def _apple_dynamic_xcframework_import_impl(ctx):

if xcframework_library.swift_module_interface:
# Create SwiftInfo provider
swift_toolchain = swift_common.get_toolchain(ctx, "_swift_toolchain")
swift_toolchain = ctx.attr._toolchain[SwiftToolchainInfo]
providers.append(
framework_import_support.swift_info_from_module_interface(
actions = actions,
Expand Down Expand Up @@ -638,7 +638,7 @@ def _apple_static_xcframework_import_impl(ctx):

if xcframework_library.swift_module_interface:
# Create SwiftInfo provider
swift_toolchain = swift_common.get_toolchain(ctx, "_swift_toolchain")
swift_toolchain = ctx.attr._toolchain[SwiftToolchainInfo]
providers.append(
framework_import_support.swift_info_from_module_interface(
actions = actions,
Expand Down Expand Up @@ -694,7 +694,7 @@ objc_library(
implementation = _apple_dynamic_xcframework_import_impl,
attrs = dicts.add(
rule_factory.common_tool_attributes,
swift_common.toolchain_attrs(toolchain_attr_name = "_swift_toolchain"),
swift_common.toolchain_attrs(),
{
"xcframework_imports": attr.label_list(
allow_empty = False,
Expand Down Expand Up @@ -769,7 +769,7 @@ objc_library(
implementation = _apple_static_xcframework_import_impl,
attrs = dicts.add(
rule_factory.common_tool_attributes,
swift_common.toolchain_attrs(toolchain_attr_name = "_swift_toolchain"),
swift_common.toolchain_attrs(),
{
"alwayslink": attr.bool(
default = False,
Expand Down
14 changes: 14 additions & 0 deletions test/starlark_tests/targets_under_test/ios/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2290,9 +2290,23 @@ swift_library(
tags = common.fixture_tags,
deps = [
"//test/starlark_tests/targets_under_test/apple:ios_imported_static_xcframework_depends_on_base",
"//test/starlark_tests/targets_under_test/apple:ios_imported_swift_static_xcframework",
],
)

genrule(
name = "static_swift_xcframework_depending_swift_lib_src",
outs = ["SwiftWithStaticSwiftFramework.swift"],
cmd = """cat > $@ <<EOF
import generated_swift_static_xcframework
func main() {
let sc = generated_swift_static_xcframework.SharedClass()
sc.doSomethingShared()
}
EOF
""",
)

genrule(
name = "swift_multi_level_static_xcframework_src",
outs = ["SwiftMultiLevelStaticXCFramework.swift"],
Expand Down

0 comments on commit eb96faa

Please sign in to comment.