diff --git a/core/soong_java_prebuilt.mk b/core/soong_java_prebuilt.mk index 96ff37626..3773c0731 100644 --- a/core/soong_java_prebuilt.mk +++ b/core/soong_java_prebuilt.mk @@ -40,21 +40,26 @@ ifdef LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR $(intermediates.COMMON)/jacoco-report-classes.jar) 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 -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: $@" $(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