From 4d99527dcd0dc1fa13f13127a77ae6116d1b97f3 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Fri, 29 Sep 2017 17:37:31 -0700 Subject: [PATCH] Move generated aidl/logtags java classes to a subfolder So that they can't be generated into src/, which would be added to the source list automatically. Bug: 36698184 Test: m telephony-common without this change, pass Test: m telephony-common without the cleanspec, fail with dup class Test: m telephony-common with the cleanspec, pass Change-Id: I7b2fc1847d52ff4a9ba8c69e76123fe152629ef8 --- CleanSpec.mk | 6 ++++++ core/java.mk | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CleanSpec.mk b/CleanSpec.mk index 76711f2bbf..23eba4f25b 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -436,6 +436,12 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/symbols/sbin/adbd) $(call add-clean-step, find $(SOONG_OUT_DIR)/.intermediates -name 'linux_x86*' | xargs rm -rf) $(call add-clean-step, find $(SOONG_OUT_DIR)/.intermediates -name 'linux_common*' | xargs rm -rf) +# Remove old aidl/logtags files that may be in the generated source directory +$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/*/*_intermediates/src) +$(call add-clean-step, rm -f $(OUT_DIR)/target/common/obj/*/*_intermediates/java-source-list) +$(call add-clean-step, rm -rf $(OUT_DIR)/host/common/obj/*/*_intermediates/src) +$(call add-clean-step, rm -f $(OUT_DIR)/host/common/obj/*/*_intermediates/java-source-list) + # ************************************************ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ diff --git a/core/java.mk b/core/java.mk index 90a8263780..efbc4bb13d 100644 --- a/core/java.mk +++ b/core/java.mk @@ -363,7 +363,7 @@ LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS) endif # LOCAL_SDK_VERSION $(foreach s,$(aidl_sources),\ - $(eval $(call define-aidl-java-rule,$(s),$(intermediates.COMMON),aidl_java_sources))) + $(eval $(call define-aidl-java-rule,$(s),$(intermediates.COMMON)/aidl,aidl_java_sources))) $(foreach java,$(aidl_java_sources), \ $(call include-depfile,$(java:%.java=%.P),$(java))) @@ -403,11 +403,11 @@ include $(BUILD_SYSTEM)/base_rules.mk ########################################################### ifneq ($(strip $(logtags_sources)),) -logtags_java_sources := $(patsubst %.logtags,%.java,$(addprefix $(intermediates.COMMON)/src/, $(logtags_sources))) +logtags_java_sources := $(patsubst %.logtags,%.java,$(addprefix $(intermediates.COMMON)/logtags/, $(logtags_sources))) logtags_sources := $(addprefix $(LOCAL_PATH)/, $(logtags_sources)) $(logtags_java_sources): PRIVATE_MERGED_TAG := $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt -$(logtags_java_sources): $(intermediates.COMMON)/src/%.java: $(LOCAL_PATH)/%.logtags $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt $(JAVATAGS) build/tools/event_log_tags.py +$(logtags_java_sources): $(intermediates.COMMON)/logtags/%.java: $(LOCAL_PATH)/%.logtags $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt $(JAVATAGS) build/tools/event_log_tags.py $(transform-logtags-to-java) else