Allow Soong to export multiple proguard flags files

Soong uses lists of proguard flags files from dependencies instead
of a single concatenated file.  Allow Soong to pass the list to
make, which will concatenate it.

Move the check inside ifdef LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
in case Soong exports an Android library with an empty
LOCAL_SOONG_EXPORT_PROGUARD_FLAGS.

Bug: 73724997
Test: m checkbuild
Change-Id: Ia8f229ec5f9fc99a23bd471dfa70c9de7316de94
This commit is contained in:
Colin Cross 2018-04-30 15:59:16 -07:00
parent 5f7e4f6bbf
commit 42669e6dc7
1 changed files with 15 additions and 10 deletions

View File

@ -40,21 +40,26 @@ ifdef LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
$(intermediates.COMMON)/jacoco-report-classes.jar) $(intermediates.COMMON)/jacoco-report-classes.jar)
endif endif
ifdef LOCAL_SOONG_EXPORT_PROGUARD_FLAGS
$(eval $(call copy-one-file,$(LOCAL_SOONG_EXPORT_PROGUARD_FLAGS),\
$(intermediates.COMMON)/export_proguard_flags))
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
$(intermediates.COMMON)/export_proguard_flags)
endif
ifdef LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE ifdef LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
my_res_package := $(intermediates.COMMON)/package-res.apk my_res_package := $(intermediates.COMMON)/package-res.apk
$(my_res_package): $(LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE) $(my_res_package): $(LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE)
@echo "Copy: $@" @echo "Copy: $@"
$(copy-file-to-target) $(copy-file-to-target)
$(call add-dependency,$(LOCAL_BUILT_MODULE),$(my_res_package)) $(call add-dependency,$(LOCAL_BUILT_MODULE),$(my_res_package))
my_proguard_flags := $(intermediates.COMMON)/export_proguard_flags
$(my_proguard_flags): $(LOCAL_SOONG_EXPORT_PROGUARD_FLAGS)
@echo "Export proguard flags: $@"
rm -f $@
touch $@
for f in $+; do \
echo -e "\n# including $$f" >>$@; \
cat $$f >>$@; \
done
$(call add-dependency,$(LOCAL_BUILT_MODULE),$(my_proguard_flags))
endif # LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE endif # LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE