From 5adfc3eb8b1623360d8944218590dc28d34786e4 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Thu, 16 Jul 2015 14:21:37 -0700 Subject: [PATCH] Add droiddoc flag LOCAL_DROIDDOC_STUB_OUT_DIR When calling droiddoc to generate stubs, if you use LOCAL_DROIDDOC_STUB_OUT_DIR (instead of "-stubs" to LOCAL_DROIDDOC_LOCAL_DROIDDOC_OPTIONS), the build system gets the chance to clean up the stub out directory before calling doclava. Bug: 22534021 Change-Id: Icb0a73eb51bfb1c1ecd88217ebcd39c27df1de29 --- core/clear_vars.mk | 1 + core/droiddoc.mk | 3 +++ 2 files changed, 4 insertions(+) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 2786991a57..10be6d2bb9 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -82,6 +82,7 @@ LOCAL_DROIDDOC_ASSET_DIR:= LOCAL_DROIDDOC_CUSTOM_ASSET_DIR:= LOCAL_DROIDDOC_OPTIONS:= LOCAL_DROIDDOC_HTML_DIR:= +LOCAL_DROIDDOC_STUB_OUT_DIR:= LOCAL_ADDITIONAL_HTML_DIR:= LOCAL_ASSET_DIR:= LOCAL_RESOURCE_DIR:= diff --git a/core/droiddoc.mk b/core/droiddoc.mk index 41f135c652..eeff0c5110 100644 --- a/core/droiddoc.mk +++ b/core/droiddoc.mk @@ -98,6 +98,7 @@ endif $(full_target): PRIVATE_OUT_DIR := $(out_dir) $(full_target): PRIVATE_DROIDDOC_OPTIONS := $(LOCAL_DROIDDOC_OPTIONS) +$(full_target): PRIVATE_STUB_OUT_DIR := $(LOCAL_DROIDDOC_STUB_OUT_DIR) # Lists the input files for the doc build into a text file # suitable for the @ syntax of javadoc. @@ -164,6 +165,7 @@ $(full_target): \ $(LOCAL_ADDITIONAL_DEPENDENCIES) @echo Docs droiddoc: $(PRIVATE_OUT_DIR) $(hide) mkdir -p $(dir $@) + $(addprefix $(hide) rm -rf ,$(PRIVATE_STUB_OUT_DIR)) $(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \ $(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR)) $(hide) ( \ @@ -185,6 +187,7 @@ $(full_target): \ -d $(PRIVATE_OUT_DIR) \ $(PRIVATE_CURRENT_BUILD) $(PRIVATE_CURRENT_TIME) \ $(PRIVATE_DROIDDOC_OPTIONS) \ + $(addprefix -stubs ,$(PRIVATE_STUB_OUT_DIR)) \ && touch -f $@ \ ) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45)