blob: 4e3493aff63d44d3692b2f1153f5e34777ec99ae [file] [log] [blame]
Colin Crossb6013af2018-03-06 18:18:06 -08001## AAPT Flags
2# aapt doesn't accept multiple --extra-packages flags.
3# We have to collapse them into a single --extra-packages flag here.
4LOCAL_AAPT_FLAGS := $(strip $(LOCAL_AAPT_FLAGS))
5ifdef LOCAL_AAPT_FLAGS
6 ifeq ($(filter 0 1,$(words $(filter --extra-packages,$(LOCAL_AAPT_FLAGS)))),)
7 aapt_flags := $(subst --extra-packages$(space),--extra-packages@,$(LOCAL_AAPT_FLAGS))
8 aapt_flags_extra_packages := $(patsubst --extra-packages@%,%,$(filter --extra-packages@%,$(aapt_flags)))
9 aapt_flags_extra_packages := $(sort $(subst :,$(space),$(aapt_flags_extra_packages)))
10 LOCAL_AAPT_FLAGS := $(filter-out --extra-packages@%,$(aapt_flags)) \
11 --extra-packages $(subst $(space),:,$(aapt_flags_extra_packages))
12 aapt_flags_extra_packages :=
13 aapt_flags :=
14 endif
15endif
16
17$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS)
18$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_AAPT_CHARACTERISTICS := $(TARGET_AAPT_CHARACTERISTICS)
19$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MANIFEST_PACKAGE_NAME := $(LOCAL_MANIFEST_PACKAGE_NAME)
20$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MANIFEST_INSTRUMENTATION_FOR := $(LOCAL_MANIFEST_INSTRUMENTATION_FOR)