From 6402873d498bc9ab334a9ec860dbba1375486241 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 12 Jun 2017 17:52:07 -0700 Subject: [PATCH] Apply ALLOW_MISSING_DEPENDENCIES to droiddoc template dir Some of our minimal branches don't have the necessary droiddoc templates, so don't cause a FindEmulator warning when the template dir is missing and ALLOW_MISSING_DEPENDENCIES is set. The warnings will soon be errors. When the template directory is missing, ensure that the command doesn't succeed by adding the directory into the dependency list. Passing a missing directory doesn't cause an error otherwise, it just wouldn't use the template. Test: build-aosp_arm64.ninja is identical before and after this change Test: Move away build/tools/droiddoc/templates-sdk; m -j libcore-docs Change-Id: I122f3916b6ab348a5a98dcf2520992eda3655e26 --- core/droiddoc.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/droiddoc.mk b/core/droiddoc.mk index 7e17a13c4..eb126305c 100644 --- a/core/droiddoc.mk +++ b/core/droiddoc.mk @@ -130,7 +130,13 @@ ifneq ($(strip $(LOCAL_DROIDDOC_USE_STANDARD_DOCLET)),true) ## droiddoc_templates := \ - $(sort $(shell find $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) -type f)) + $(sort $(shell find $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) -type f $(if $(ALLOW_MISSING_DEPENDENCIES),2>/dev/null))) + +ifdef ALLOW_MISSING_DEPENDENCIES + ifndef droiddoc_templates + droiddoc_templates := $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) + endif +endif droiddoc := \ $(HOST_JDK_TOOLS_JAR) \