diff --git a/core/base_rules.mk b/core/base_rules.mk index 0c494785cc..88323115df 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -189,13 +189,15 @@ aidl_sources := $(addprefix $(TOP_DIR)$(LOCAL_PATH)/, $(aidl_sources)) aidl_preprocess_import := LOCAL_SDK_VERSION:=$(strip $(LOCAL_SDK_VERSION)) ifdef LOCAL_SDK_VERSION -ifneq ($(LOCAL_SDK_VERSION),current) -aidl_preprocess_import := -p$(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_VERSION)/framework.aidl +ifeq ($(LOCAL_SDK_VERSION),current) + aidl_preprocess_import := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl +else + aidl_preprocess_import := $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_VERSION)/framework.aidl endif # !current endif # LOCAL_SDK_VERSION -$(aidl_java_sources): PRIVATE_AIDL_FLAGS := -b $(aidl_preprocess_import) -I$(LOCAL_PATH) -I$(LOCAL_PATH)/src $(addprefix -I,$(LOCAL_AIDL_INCLUDES)) +$(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: $(TOPDIR)$(LOCAL_PATH)/%.aidl $(PRIVATE_ADDITIONAL_DEPENDENCIES) $(AIDL) +$(aidl_java_sources): $(intermediates.COMMON)/src/%.java: $(TOPDIR)$(LOCAL_PATH)/%.aidl $(PRIVATE_ADDITIONAL_DEPENDENCIES) $(AIDL) $(aidl_preprocess_import) $(transform-aidl-to-java) -include $(aidl_java_sources:%.java=%.P) @@ -320,8 +322,14 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JAVA_OBJECTS := $(patsubst %.java,%.class ifeq ($(my_prefix),TARGET_) ifeq ($(LOCAL_SDK_VERSION),) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,core) -endif -endif +else +ifeq ($(LOCAL_SDK_VERSION),current) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,android_stubs_current) +else +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,sdk_v$(LOCAL_SDK_VERSION)) +endif # current +endif # LOCAL_SDK_VERSION +endif # TARGET_ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RESOURCE_DIR := $(LOCAL_RESOURCE_DIR) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EXTRA_JAR_ARGS := $(extra_jar_args) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASSET_DIR := $(LOCAL_ASSET_DIR)