diff --git a/test/starlark_tests/apple_dynamic_xcframework_import_tests.bzl b/test/starlark_tests/apple_dynamic_xcframework_import_tests.bzl index b0ef7575a6..ab291477fd 100644 --- a/test/starlark_tests/apple_dynamic_xcframework_import_tests.bzl +++ b/test/starlark_tests/apple_dynamic_xcframework_import_tests.bzl @@ -63,6 +63,24 @@ def apple_dynamic_xcframework_import_test_suite(name): ], tags = [name], ) + archive_contents_test( + name = "{}_contains_implementation_depending_imported_xcframework_framework_files".format(name), + build_type = "simulator", + target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_implementation_depending_imported_xcframework", + contains = [ + "$BUNDLE_ROOT/Frameworks/generated_dynamic_xcframework_with_headers.framework/Info.plist", + "$BUNDLE_ROOT/Frameworks/generated_dynamic_xcframework_with_headers.framework/generated_dynamic_xcframework_with_headers", + ], + not_contains = [ + "$BUNDLE_ROOT/Frameworks/generated_dynamic_xcframework_with_headers.framework/Headers/", + "$BUNDLE_ROOT/Frameworks/generated_dynamic_xcframework_with_headers.framework/Modules/", + ], + binary_test_file = "$BINARY", + macho_load_commands_contain = [ + "name @rpath/generated_dynamic_xcframework_with_headers.framework/generated_dynamic_xcframework_with_headers (offset 24)", + ], + tags = [name], + ) archive_contents_test( name = "{}_swift_contains_imported_xcframework_framework_files".format(name), build_type = "simulator", @@ -82,6 +100,25 @@ def apple_dynamic_xcframework_import_test_suite(name): ], tags = [name], ) + archive_contents_test( + name = "{}_swift_contains_private_depending_imported_xcframework_framework_files".format(name), + build_type = "simulator", + target_under_test = "//test/starlark_tests/targets_under_test/ios:swift_app_with_private_depending_imported_objc_xcframework", + contains = [ + "$BUNDLE_ROOT/Frameworks/generated_dynamic_xcframework_with_headers.framework/Info.plist", + "$BUNDLE_ROOT/Frameworks/generated_dynamic_xcframework_with_headers.framework/generated_dynamic_xcframework_with_headers", + "$BUNDLE_ROOT/Frameworks/libswiftCore.dylib", + ], + not_contains = [ + "$BUNDLE_ROOT/Frameworks/generated_dynamic_xcframework_with_headers.framework/Headers/", + "$BUNDLE_ROOT/Frameworks/generated_dynamic_xcframework_with_headers.framework/Modules/", + ], + binary_test_file = "$BINARY", + macho_load_commands_contain = [ + "name @rpath/generated_dynamic_xcframework_with_headers.framework/generated_dynamic_xcframework_with_headers (offset 24)", + ], + tags = [name], + ) archive_contents_test( name = "{}_contains_imported_swift_xcframework_framework_files".format(name), build_type = "simulator", @@ -100,6 +137,24 @@ def apple_dynamic_xcframework_import_test_suite(name): ], tags = [name], ) + archive_contents_test( + name = "{}_contains_implementation_depending_imported_swift_xcframework_framework_files".format(name), + build_type = "simulator", + target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_implementation_depending_imported_swift_xcframework", + contains = [ + "$BUNDLE_ROOT/Frameworks/Swift3PFmwkWithGenHeader.framework/Info.plist", + "$BUNDLE_ROOT/Frameworks/Swift3PFmwkWithGenHeader.framework/Swift3PFmwkWithGenHeader", + ], + not_contains = [ + "$BUNDLE_ROOT/Frameworks/Swift3PFmwkWithGenHeader.framework/Headers/", + "$BUNDLE_ROOT/Frameworks/Swift3PFmwkWithGenHeader.framework/Modules/", + ], + binary_test_file = "$BINARY", + macho_load_commands_contain = [ + "name @rpath/Swift3PFmwkWithGenHeader.framework/Swift3PFmwkWithGenHeader (offset 24)", + ], + tags = [name], + ) archive_contents_test( name = "{}_swift_contains_imported_swift_xcframework_framework_files".format(name), build_type = "simulator", @@ -118,6 +173,24 @@ def apple_dynamic_xcframework_import_test_suite(name): ], tags = [name], ) + archive_contents_test( + name = "{}_swift_contains_private_depending_imported_swift_xcframework_framework_files".format(name), + build_type = "simulator", + target_under_test = "//test/starlark_tests/targets_under_test/ios:swift_app_with_private_depending_imported_swift_xcframework", + contains = [ + "$BUNDLE_ROOT/Frameworks/Swift3PFmwkWithGenHeader.framework/Info.plist", + "$BUNDLE_ROOT/Frameworks/Swift3PFmwkWithGenHeader.framework/Swift3PFmwkWithGenHeader", + ], + not_contains = [ + "$BUNDLE_ROOT/Frameworks/Swift3PFmwkWithGenHeader.framework/Headers/", + "$BUNDLE_ROOT/Frameworks/Swift3PFmwkWithGenHeader.framework/Modules/", + ], + binary_test_file = "$BINARY", + macho_load_commands_contain = [ + "name @rpath/Swift3PFmwkWithGenHeader.framework/Swift3PFmwkWithGenHeader (offset 24)", + ], + tags = [name], + ) # Verify the correct XCFramework library was bundled and sliced for the required architecture. binary_contents_test( diff --git a/test/starlark_tests/targets_under_test/ios/BUILD b/test/starlark_tests/targets_under_test/ios/BUILD index 9a96320f6b..dd7a964dda 100644 --- a/test/starlark_tests/targets_under_test/ios/BUILD +++ b/test/starlark_tests/targets_under_test/ios/BUILD @@ -2290,6 +2290,32 @@ objc_library( deps = [":ios_imported_dynamic_xcframework"], ) +ios_application( + name = "app_with_implementation_depending_imported_xcframework", + bundle_id = "com.google.example", + families = [ + "iphone", + "ipad", + ], + infoplists = [ + "//test/starlark_tests/resources:Info.plist", + ], + minimum_os_version = common.min_os_ios.baseline, + provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision", + tags = common.fixture_tags, + deps = [ + ":dynamic_xcframework_implementation_depending_lib", + "//test/starlark_tests/resources:objc_main_lib", + ], +) + +objc_library( + name = "dynamic_xcframework_implementation_depending_lib", + srcs = [":dynamic_xcframework_depending_lib_file"], + tags = common.fixture_tags, + implementation_deps = [":ios_imported_dynamic_xcframework"], +) + write_file( name = "dynamic_xcframework_depending_lib_file", out = "lib_with_imported_objc_xcframework.m", @@ -2331,6 +2357,31 @@ swift_library( deps = [":ios_imported_dynamic_xcframework"], ) +ios_application( + name = "swift_app_with_private_depending_imported_objc_xcframework", + bundle_id = "com.google.example", + families = [ + "iphone", + "ipad", + ], + infoplists = [ + "//test/starlark_tests/resources:Info.plist", + ], + minimum_os_version = common.min_os_ios.baseline, + tags = common.fixture_tags, + deps = [ + ":dynamic_objc_xcframework_private_depending_swift_lib", + "//test/starlark_tests/resources:swift_main_lib", + ], +) + +swift_library( + name = "dynamic_objc_xcframework_private_depending_swift_lib", + srcs = [":swift_with_framework_src"], + tags = common.fixture_tags, + private_deps = [":ios_imported_dynamic_xcframework"], +) + write_file( name = "swift_with_framework_src", out = "SwiftWithObjcFramework.swift", @@ -2401,6 +2452,32 @@ objc_library( deps = [":ios_imported_swift_dynamic_xcframework"], ) +ios_application( + name = "app_with_implementation_depending_imported_swift_xcframework", + bundle_id = "com.google.example", + families = [ + "iphone", + "ipad", + ], + infoplists = [ + "//test/starlark_tests/resources:Info.plist", + ], + minimum_os_version = common.min_os_ios.baseline, + provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision", + tags = common.fixture_tags, + deps = [ + ":dynamic_swift_xcframework_implementation_depending_objc_lib", + "//test/starlark_tests/resources:objc_main_lib", + ], +) + +objc_library( + name = "dynamic_swift_xcframework_implementation_depending_objc_lib", + srcs = [":objc_with_framework_src"], + tags = common.fixture_tags, + implementation_deps = [":ios_imported_swift_dynamic_xcframework"], +) + write_file( name = "objc_with_framework_src", out = "ObjcWithFramework.m", @@ -2442,6 +2519,31 @@ swift_library( deps = [":ios_imported_swift_dynamic_xcframework"], ) +ios_application( + name = "swift_app_with_private_depending_imported_swift_xcframework", + bundle_id = "com.google.example", + families = [ + "iphone", + "ipad", + ], + infoplists = [ + "//test/starlark_tests/resources:Info.plist", + ], + minimum_os_version = common.min_os_ios.baseline, + tags = common.fixture_tags, + deps = [ + ":dynamic_swift_xcframework_private_depending_swift_lib", + "//test/starlark_tests/resources:swift_main_lib", + ], +) + +swift_library( + name = "dynamic_swift_xcframework_private_depending_swift_lib", + srcs = [":swift_with_dynamic_swift_framework_src"], + tags = common.fixture_tags, + private_deps = [":ios_imported_swift_dynamic_xcframework"], +) + write_file( name = "swift_with_dynamic_swift_framework_src", out = "SwiftWithDynamicSwiftFramework.swift",