From c08090f6d25675fd5f469bf14a9fed6e2231c2ea Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 29 Jun 2017 14:58:43 +0100 Subject: [PATCH] Refactor in preparation for removing android.test.mock The goal of this change is two fold: 1) Allow the test-runner/src classes to continue to be included in the JavaDoc even when they are removed from the Android API. 2) Make it easy to remove android.test.mock classes from the API. This was done in two stages: 1) Push the reference to test-runner/src from fwbase_dirs_to_document down to dirs_to_document and framework_docs_LOCAL_API_CHECK_SRC_FILES. 2) Expand the reference in framework_docs_LOCAL_API_CHECK_SRC_FILES into two new variables that reference the classes from test-runner/src. One references those that are required for android.test.mock and the other references the remaining ones. Bug: 30188076 Test: make checkbuild Change-Id: I558164e6c9ea2a24bd58e5f4f54dd4c3b2a11924 --- Android.mk | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Android.mk b/Android.mk index 6fb5aec2eccc6..1a66896b2545d 100644 --- a/Android.mk +++ b/Android.mk @@ -873,7 +873,6 @@ packages_to_document := \ # The result will be relative to frameworks/base. fwbase_dirs_to_document := \ legacy-test/src \ - test-runner/src \ $(patsubst $(LOCAL_PATH)/%,%, \ $(wildcard \ $(foreach dir, $(FRAMEWORKS_BASE_JAVA_SRC_DIRS), \ @@ -891,6 +890,12 @@ non_base_dirs := \ ../opt/net/voip/src/java/android/net/rtp \ ../opt/net/voip/src/java/android/net/sip +framework_base_android_test_mock_src_files := \ + $(call all-java-files-under, test-runner/src/android/test/mock) + +framework_base_android_test_runner_excluding_mock_src_files := \ + $(filter-out $(framework_base_android_test_mock_src_files), $(call all-java-files-under, test-runner/src)) + # These are relative to frameworks/base dirs_to_check_apis := \ $(fwbase_dirs_to_document) \ @@ -910,6 +915,7 @@ endef # FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk dirs_to_document := \ $(dirs_to_check_apis) \ + test-runner/src \ $(addprefix ../../, $(FRAMEWORKS_DATA_BINDING_JAVA_SRC_DIRS)) patterns_to_not_document := \ @@ -932,7 +938,9 @@ framework_docs_LOCAL_SRC_FILES := \ # These are relative to frameworks/base framework_docs_LOCAL_API_CHECK_SRC_FILES := \ - $(call find-other-java-files, $(dirs_to_check_apis)) \ + $(framework_base_android_test_mock_src_files) \ + $(framework_base_android_test_runner_excluding_mock_src_files) \ + $(call all-java-files-under, $(dirs_to_check_apis)) \ $(common_src_files) # This is used by ide.mk as the list of source files that are @@ -956,7 +964,8 @@ framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES := \ ext \ icu4j \ framework \ - voip-common + voip-common \ + android.test.mock \ # Platform docs can refer to Support Library APIs, but we don't actually build # them as part of the docs target, so we need to include them on the classpath.