Skip to content

Commit

Permalink
Change unstripped_shared_libraries from AndroidApkUnderTestInfo to An…
Browse files Browse the repository at this point in the history
…droidApkInfo

Summary: As per feedback from D56561120

Reviewed By: IanChilds

Differential Revision: D56985458

fbshipit-source-id: 2dbcb6c0c143215368d083ab6a834033ca2f726e
  • Loading branch information
vener91 authored and facebook-github-bot committed May 6, 2024
1 parent 26d4425 commit dcfc23e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions android/android_apk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ def android_apk_impl(ctx: AnalysisContext) -> list[Provider]:
install_info = get_install_info(ctx, output_apk = output_apk, manifest = resources_info.manifest, exopackage_info = exopackage_info, definitely_has_native_libs = definitely_has_native_libs)

return [
AndroidApkInfo(apk = output_apk, manifest = resources_info.manifest, materialized_artifacts = android_binary_info.materialized_artifacts),
AndroidApkInfo(
apk = output_apk,
manifest = resources_info.manifest,
materialized_artifacts = android_binary_info.materialized_artifacts,
unstripped_shared_libraries = native_library_info.unstripped_shared_libraries,
),
AndroidApkUnderTestInfo(
java_packaging_deps = set([dep.label.raw_target() for dep in java_packaging_deps]),
keystore = keystore,
Expand All @@ -80,7 +85,6 @@ def android_apk_impl(ctx: AnalysisContext) -> list[Provider]:
resource_infos = set([info.raw_target for info in resources_info.unfiltered_resource_infos]),
r_dot_java_packages = set([info.specified_r_dot_java_package for info in resources_info.unfiltered_resource_infos if info.specified_r_dot_java_package]),
shared_libraries = set(native_library_info.shared_libraries),
unstripped_shared_libraries = native_library_info.unstripped_shared_libraries,
),
DefaultInfo(default_output = default_output, other_outputs = install_info.files.values() + android_binary_info.materialized_artifacts, sub_targets = sub_targets | class_to_srcs_subtargets),
install_info,
Expand Down
2 changes: 1 addition & 1 deletion android/android_providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ AndroidApkInfo = provider(
"apk": provider_field(typing.Any, default = None),
"manifest": provider_field(typing.Any, default = None),
"materialized_artifacts": provider_field(typing.Any, default = None),
"unstripped_shared_libraries": provider_field(typing.Any, default = None), # artifact
},
)

Expand All @@ -138,7 +139,6 @@ AndroidApkUnderTestInfo = provider(
"resource_infos": provider_field(typing.Any, default = None), # set_type("ResourceInfos")
"r_dot_java_packages": provider_field(typing.Any, default = None), # set_type(str)
"shared_libraries": provider_field(typing.Any, default = None), # set_type(raw_target)
"unstripped_shared_libraries": provider_field(typing.Any, default = None), # artifact
},
)

Expand Down
3 changes: 3 additions & 0 deletions android/apk_genrule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ def apk_genrule_impl(ctx: AnalysisContext) -> list[Provider]:
expect((ctx.attrs.apk == None) != (ctx.attrs.aab == None), "Exactly one of 'apk' and 'aab' must be specified")

input_android_apk_under_test_info = None
input_unstripped_shared_libraries = None
if ctx.attrs.apk != None:
# TODO(T104150125) The underlying APK should not have exopackage enabled
input_android_apk_info = ctx.attrs.apk[AndroidApkInfo]
expect(input_android_apk_info != None, "'apk' attribute must be an Android APK!")
input_apk = input_android_apk_info.apk
input_manifest = input_android_apk_info.manifest
input_materialized_artifacts = input_android_apk_info.materialized_artifacts
input_unstripped_shared_libraries = input_android_apk_info.unstripped_shared_libraries
input_android_apk_under_test_info = ctx.attrs.apk[AndroidApkUnderTestInfo]

env_vars = {
Expand Down Expand Up @@ -112,6 +114,7 @@ def apk_genrule_impl(ctx: AnalysisContext) -> list[Provider]:
apk = output_apk,
manifest = input_manifest,
materialized_artifacts = input_materialized_artifacts,
unstripped_shared_libraries = input_unstripped_shared_libraries,
),
get_install_info(
ctx,
Expand Down

0 comments on commit dcfc23e

Please sign in to comment.