From f6be99340769cae717a604c7362f85830e4601c6 Mon Sep 17 00:00:00 2001 From: George Mount Date: Thu, 3 Dec 2015 07:39:55 -0800 Subject: [PATCH] Adds a way to exclude test directories from javadoc. By adding a file named NO_DOCS to a directory, all java files under that directory will be ignored for javadoc builds. This is especially useful for marking test projects as not participating in the javadoc build. Change-Id: I3b0259f4bb3c8460c3560fdcf97c6cac11d8001d --- Android.mk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index 99e0c464bc95..877f1153e8ff 100644 --- a/Android.mk +++ b/Android.mk @@ -669,6 +669,16 @@ dirs_to_check_apis := \ $(fwbase_dirs_to_document) \ $(non_base_dirs) +########################################################### +## Return all directories that have a 'NO_DOCS' file in +## them, appending a '%' to them to form a pattern to +## filter out files under those directories. +## $(1): A list of base directories to look at. +########################################################### +define find-no-docs-pattern +$(addsuffix %, $(dir $(foreach dir, $(1), $(shell cd $(LOCAL_PATH); find $(dir) -name NO_DOCS)))) +endef + # These are relative to frameworks/base # FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk dirs_to_document := \ @@ -676,6 +686,9 @@ dirs_to_document := \ $(addprefix ../../, $(FRAMEWORKS_DATA_BINDING_JAVA_SRC_DIRS)) \ $(addprefix ../../, $(FRAMEWORKS_SUPPORT_JAVA_SRC_DIRS)) \ +patterns_to_not_document := \ + $(call find-no-docs-pattern, $(dirs_to_document)) + # These are relative to frameworks/base html_dirs := \ $(FRAMEWORKS_BASE_SUBDIRS) \ @@ -689,9 +702,11 @@ common_src_files := \ # These are relative to frameworks/base framework_docs_LOCAL_SRC_FILES := \ - $(call find-other-java-files, $(dirs_to_document)) \ + $(filter-out $(patterns_to_not_document), $(call find-other-java-files, $(dirs_to_document))) \ $(common_src_files) +# $(call find-other-java-files, $(dirs_to_document)) \ + # These are relative to frameworks/base framework_docs_LOCAL_API_CHECK_SRC_FILES := \ $(call find-other-java-files, $(dirs_to_check_apis)) \ -- 2.11.0