Merge "Fix path escaping for aidl generated java"

This commit is contained in:
Christopher Wiley
2016-06-24 16:00:33 +00:00
committed by Gerrit Code Review
2 changed files with 21 additions and 11 deletions

View File

@@ -1084,6 +1084,19 @@ $(hide) $(AIDL_CPP) -d$(basename $@).aidl.P $(PRIVATE_AIDL_FLAGS) \
$< $(PRIVATE_HEADER_OUTPUT_DIR) $@ $< $(PRIVATE_HEADER_OUTPUT_DIR) $@
endef endef
## Given a .aidl file path, generate the rule to compile it a .java file
# $(1): a .aidl source file
# $(2): a directory to place the generated .java files in
# $(3): name of a variable to add the path to the generated source file to
#
# You must call this with $(eval).
define define-aidl-java-rule
define-aidl-java-rule-src := $(patsubst %.aidl,%.java,$(subst ../,dotdot/,$(addprefix $(2)/,$(1))))
$$(define-aidl-java-rule-src) : $(LOCAL_PATH)/$(1) $(AIDL)
$$(transform-aidl-to-java)
$(3) += $$(define-aidl-java-rule-src)
endef
## Given a .aidl file path generate the rule to compile it a .cpp file. ## Given a .aidl file path generate the rule to compile it a .cpp file.
# $(1): a .aidl source file # $(1): a .aidl source file
# $(2): a directory to place the generated .cpp files in # $(2): a directory to place the generated .cpp files in

View File

@@ -277,10 +277,9 @@ endif
## AIDL: Compile .aidl files to .java ## AIDL: Compile .aidl files to .java
########################################################### ###########################################################
aidl_sources := $(filter %.aidl,$(LOCAL_SRC_FILES)) aidl_sources := $(filter %.aidl,$(LOCAL_SRC_FILES))
aidl_java_sources :=
ifneq ($(strip $(aidl_sources)),) ifneq ($(strip $(aidl_sources)),)
aidl_java_sources := $(patsubst %.aidl,%.java,$(addprefix $(intermediates.COMMON)/src/, $(aidl_sources)))
aidl_sources := $(addprefix $(LOCAL_PATH)/, $(aidl_sources))
aidl_preprocess_import := aidl_preprocess_import :=
ifdef LOCAL_SDK_VERSION ifdef LOCAL_SDK_VERSION
@@ -294,19 +293,17 @@ else
# build against the platform. # build against the platform.
LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS) LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
endif # LOCAL_SDK_VERSION endif # LOCAL_SDK_VERSION
$(aidl_java_sources): PRIVATE_AIDL_FLAGS := -b $(addprefix -p,$(aidl_preprocess_import)) -I$(LOCAL_PATH) -I$(LOCAL_PATH)/src $(addprefix -I,$(LOCAL_AIDL_INCLUDES))
$(aidl_java_sources): $(intermediates.COMMON)/src/%.java: \ $(foreach s,$(aidl_sources),\
$(LOCAL_PATH)/%.aidl \ $(eval $(call define-aidl-java-rule,$(s),$(intermediates.COMMON),aidl_java_sources)))
$(LOCAL_ADDITIONAL_DEPENDENCIES) \
$(AIDL) \
$(aidl_preprocess_import)
$(transform-aidl-to-java)
$(foreach java,$(aidl_java_sources), \ $(foreach java,$(aidl_java_sources), \
$(call include-depfile,$(java:%.java=%.P),$(java))) $(call include-depfile,$(java:%.java=%.P),$(java)))
else $(aidl_java_sources) : $(LOCAL_ADDITIONAL_DEPENDENCIES) $(aidl_preprocess_import)
aidl_java_sources :=
$(aidl_java_sources): PRIVATE_AIDL_FLAGS := -b $(addprefix -p,$(aidl_preprocess_import)) -I$(LOCAL_PATH) -I$(LOCAL_PATH)/src $(addprefix -I,$(LOCAL_AIDL_INCLUDES))
$(aidl_java_sources : PRIVATE_MODULE := $(LOCAL_MODULE)
endif endif
########################################## ##########################################