From eb1012b1d4d0be7dafdd34c93dc1d4e687f98c23 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 4 Dec 2017 13:48:18 -0800 Subject: [PATCH] Add support for LOCAL_GENERATED_SOURCES to droiddoc BUILD_DROIDDOC allows LOCAL_SRC_FILES to refer to sources in $(LOCAL_PATH) and LOCAL_INTERMEDIATE_SOURCES to refer to sources in $(TARGET_OUT_COMMON_INTERMEDIATES). The droiddoc rules that use files generated in Soong were trying to abuse LOCAL_SRC_FILES to point to files in $(OUT_DIR)/soong using ../.. to counter $(LOCAL_PATH), but failed if $(OUT_DIR) was absolute. Add LOCAL_GENERATED_SOURCES that can take a path relative to the top of the source tree or an absolute path. Bug: 70166718 Test: m OUT_DIR=/tmp/out docs Change-Id: Iaf0d622a3405da0bf520f7312e11e75e9328062e Merged-In: Iaf0d622a3405da0bf520f7312e11e75e9328062e (cherry-picked from commit 4c44a94dab27df3df66cd53a9bcf44d6028132c2) --- core/droiddoc.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/droiddoc.mk b/core/droiddoc.mk index c8d0dc81e..176a01d36 100644 --- a/core/droiddoc.mk +++ b/core/droiddoc.mk @@ -101,6 +101,7 @@ intermediates.COMMON := $(call local-intermediates-dir,COMMON) $(full_target): PRIVATE_SOURCE_PATH := $(call normalize-path-list,$(LOCAL_DROIDDOC_SOURCE_PATH)) $(full_target): PRIVATE_JAVA_FILES := $(filter %.java,$(full_src_files)) $(full_target): PRIVATE_JAVA_FILES += $(addprefix $($(my_prefix)OUT_COMMON_INTERMEDIATES)/, $(filter %.java,$(LOCAL_INTERMEDIATE_SOURCES))) +$(full_target): PRIVATE_JAVA_FILES += $(filter %.java,$(LOCAL_GENERATED_SOURCES)) $(full_target): PRIVATE_SRCJARS := $(LOCAL_SRCJARS) $(full_target): PRIVATE_SOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/src $(full_target): PRIVATE_SRCJAR_INTERMEDIATES_DIR := $(intermediates.COMMON)/srcjars @@ -182,6 +183,7 @@ $(full_target): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) # keep -bootclasspath here since it works in combination with -source 1.8. $(full_target): \ $(full_src_files) \ + $(LOCAL_GENERATED_SOURCES) \ $(droiddoc_templates) \ $(droiddoc) \ $(html_dir_files) \ @@ -240,7 +242,7 @@ else # For OpenJDK 8 we can use -bootclasspath to define the core libraries code. $(full_target): PRIVATE_BOOTCLASSPATH_ARG := $(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH)) endif -$(full_target): $(full_src_files) $(full_java_libs) $(EXTRACT_SRCJARS) $(LOCAL_SRCJARS) $(LOCAL_ADDITIONAL_DEPENDENCIES) +$(full_target): $(full_src_files) $(LOCAL_GENERATED_SOURCES) $(full_java_libs) $(EXTRACT_SRCJARS) $(LOCAL_SRCJARS) $(LOCAL_ADDITIONAL_DEPENDENCIES) @echo Docs javadoc: $(PRIVATE_OUT_DIR) @mkdir -p $(dir $@) rm -rf $(PRIVATE_SRCJAR_INTERMEDIATES_DIR)