Skip to content

Commit c00a35f

Browse files
authored
Fix ios_extension with resources (#2439)
1 parent 9c6eb04 commit c00a35f

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

apple/internal/ios_rules.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,7 @@ def _ios_extension_impl(ctx):
11501150
attr = ctx.attr,
11511151
res_attrs = [
11521152
"app_icons",
1153+
"resources",
11531154
"strings",
11541155
],
11551156
)

test/starlark_tests/ios_extension_tests.bzl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,17 @@ def ios_extension_test_suite(name):
259259
tags = [name],
260260
)
261261

262+
# Test ext with resources bundles them at the top level
263+
archive_contents_test(
264+
name = "{}_contains_resources_test".format(name),
265+
build_type = "simulator",
266+
target_under_test = "//test/starlark_tests/targets_under_test/ios:ext_with_resources",
267+
contains = [
268+
"$BUNDLE_ROOT/additional.txt",
269+
],
270+
tags = [name],
271+
)
272+
262273
# Test dSYM binaries and linkmaps from framework embedded via 'data' are propagated correctly
263274
# at the top-level ios_extension rule, and present through the 'dsysms' and 'linkmaps' output
264275
# groups.

test/starlark_tests/targets_under_test/ios/BUILD

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4905,3 +4905,28 @@ docc_archive(
49054905
fallback_bundle_version = "1.0",
49064906
fallback_display_name = "BasicFramework",
49074907
)
4908+
4909+
# ---------------------------------------------------------------------------------------
4910+
# Target for extension resource bundling.
4911+
4912+
ios_extension(
4913+
name = "ext_with_resources",
4914+
bundle_id = "com.google.example.ext_with_resources",
4915+
entitlements = "//test/starlark_tests/resources:entitlements.plist",
4916+
families = [
4917+
"iphone",
4918+
"ipad",
4919+
],
4920+
infoplists = [
4921+
"//test/starlark_tests/resources:Info.plist",
4922+
],
4923+
minimum_os_version = common.min_os_ios.baseline,
4924+
provisioning_profile = "//test/testdata/provisioning:integration_testing_ios.mobileprovision",
4925+
resources = [
4926+
"//test/starlark_tests/resources:additional.txt",
4927+
],
4928+
tags = common.fixture_tags,
4929+
deps = [
4930+
"//test/starlark_tests/resources:objc_main_lib",
4931+
],
4932+
)

0 commit comments

Comments
 (0)