From 9644ec811f270b6628fba08861a853d9e888ec49 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 12 Jan 2021 15:08:08 -0800 Subject: [PATCH] Add dependencies on java resources when packaging APK without classes When an APK is packaged without any classes.dex files the resources are packaged directly, and so the packaging rule must depend on the resources. Fixes: 177295654 Test: prebuilts/build-tools/linux-x86/bin/ninja -f out/combined-aosp_cf_x86_64_phone.ninja -t query out/target/product/vsoc_x86_64/obj/APPS/CtsSplitApp_x86_64_intermediates/package.apk Change-Id: I786e71439f11e7bd5e20e010b66fbf529eb57a5a --- core/package_internal.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/package_internal.mk b/core/package_internal.mk index a97e401b5..1b4062429 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -552,6 +552,10 @@ endif ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) $(LOCAL_BUILT_MODULE) : $(ZIP2ZIP) endif +ifeq ($(full_classes_jar),) + # We don't build jar, need to add the Java resources here. + $(LOCAL_BUILT_MODULE): $(java_resource_sources) +endif $(LOCAL_BUILT_MODULE): PRIVATE_USE_EMBEDDED_NATIVE_LIBS := $(LOCAL_USE_EMBEDDED_NATIVE_LIBS) $(LOCAL_BUILT_MODULE): @echo "target Package: $(PRIVATE_MODULE) ($@)" @@ -603,6 +607,8 @@ ifneq ($(full_classes_jar),) else $(my_bundle_module): PRIVATE_DEX_FILE := $(my_bundle_module): PRIVATE_SOURCE_ARCHIVE := + # We don't build jar, need to add the Java resources here. + $(my_bundle_module): $(java_resource_sources) endif # full_classes_jar $(my_bundle_module): $(MERGE_ZIPS) $(SOONG_ZIP) $(ZIP2ZIP)