Skip to content

Commit 0679bfb

Browse files
zhaoqxucopybara-github
authored andcommitted
Pass all resource files to legacy AAR creation.
PiperOrigin-RevId: 808327312 Change-Id: Ib42a840b077bcf9ebb8641a8052e29964eec6378
1 parent fcf7fa9 commit 0679bfb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

rules/android_library/impl.bzl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,22 @@ def _process_aar(ctx, java_package, resources_ctx, proguard_ctx, **unused_ctx):
334334
_VALIDATION_OUTPUTS: [],
335335
}
336336

337+
# This is a workaround to fix b/445511343 that translation resources are missing in the final
338+
# aar for the internal version of android_library. The workaround doesn't work with data binding
339+
# enabled. Given we've deprecated data binding internally, this is an acceptable compromise.
340+
if ctx.attr.neverlink:
341+
resource_files = []
342+
elif resources_ctx.data_binding_layout_info:
343+
resource_files = resources_ctx.starlark_processed_resources
344+
else:
345+
resource_files = ctx.files.resource_files
346+
337347
starlark_aar = _resources.make_aar(
338348
ctx,
339349
manifest = resources_ctx.starlark_processed_manifest,
340350
assets = ctx.files.assets,
341351
assets_dir = ctx.attr.assets_dir,
342-
resource_files = resources_ctx.starlark_processed_resources if not ctx.attr.neverlink else [],
352+
resource_files = resource_files,
343353
class_jar = ctx.outputs.lib_jar,
344354
r_txt = resources_ctx.starlark_r_txt,
345355
aar_metadata = ctx.file.aar_metadata,

0 commit comments

Comments
 (0)