Skip to content

Commit

Permalink
Do not merge stamp JavaInfo to the final JavaInfo.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 619719253
Change-Id: I7f9851e865361d93bae84f7704977759b5f4c792
  • Loading branch information
Zhaoqing Xu authored and copybara-github committed Mar 28, 2024
1 parent 8afb4fe commit f0d4c4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion rules/acls/android_binary_starlark_rollout.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ ANDROID_BINARY_STARLARK_ROLLOUT = [
"//:__subpackages__",
]

ANDROID_BINARY_STARLARK_FALLBACK = []
ANDROID_BINARY_STARLARK_FALLBACK = [
]
14 changes: 7 additions & 7 deletions rules/android_binary_internal/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,19 @@ def _process_jvm(ctx, db_ctx, packaged_resources_ctx, proto_ctx, stamp_ctx, **_u

if acls.in_android_binary_starlark_rollout(str(ctx.label)):
java_infos = [java_info, packaged_resources_ctx.r_java]
if stamp_ctx.java_info:
java_infos.append(stamp_ctx.java_info)
if proto_ctx.java_info:
java_infos.append(proto_ctx.java_info)
java_info = java_common.merge(java_infos)

providers = []
if acls.in_android_binary_starlark_javac(str(ctx.label)):
providers.append(java_info)

return ProviderInfo(
name = "jvm_ctx",
value = struct(
java_info = java_info,
providers = [java_info],
providers = providers,
),
)

Expand Down Expand Up @@ -462,10 +464,8 @@ def _process_deploy_jar(ctx, validation_ctx, stamp_ctx, packaged_resources_ctx,
binary_runtime_jars = []
java_toolchain = common.get_java_toolchain(ctx)

if acls.in_android_binary_starlark_rollout(str(ctx.label)):
java_info = jvm_ctx.java_info
else:
java_info = java_common.merge([jvm_ctx.java_info, stamp_ctx.java_info]) if stamp_ctx.java_info else jvm_ctx.java_info
java_info = java_common.merge([jvm_ctx.java_info, stamp_ctx.java_info]) if stamp_ctx.java_info else jvm_ctx.java_info
if not acls.in_android_binary_starlark_rollout(str(ctx.label)):
binary_runtime_jars.append(packaged_resources_ctx.class_jar)
if proto_ctx.class_jar:
binary_runtime_jars.append(proto_ctx.class_jar)
Expand Down

0 comments on commit f0d4c4b

Please sign in to comment.