summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hansson <hansson@google.com>2018-05-02 16:25:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-05-02 16:25:42 +0000
commite16051a0775b5b090566e8f602346adef7bc50e2 (patch)
tree32c2e6a411978e813a015dda50812d42a2399bfb
parent4cfc86c77ddaa789813bd433d64c61e3200de7b4 (diff)
parentcfa700dd8543403b8bafd77d38570daf54b2b99b (diff)
Merge "Update apidiff source files to use new api location." into pi-dev-plus-aosp
-rw-r--r--Android.mk30
1 files changed, 16 insertions, 14 deletions
diff --git a/Android.mk b/Android.mk
index 6829d7e0b68f..6f158180b487 100644
--- a/Android.mk
+++ b/Android.mk
@@ -245,6 +245,18 @@ framework_docs_LOCAL_DROIDDOC_OPTIONS += \
-federate AndroidX https://developer.android.com \
-federationapi AndroidX prebuilts/sdk/current/androidx-api.txt
+# Get the highest numbered api txt for the given api level.
+# $(1): the api level (e.g. public, system)
+define highest_sdk_txt
+$(HISTORICAL_SDK_VERSIONS_ROOT)/$(lastword $(call numerically_sort, \
+ $(patsubst \
+ $(HISTORICAL_SDK_VERSIONS_ROOT)/%,\
+ %,\
+ $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/$(1)/api/android.txt)\
+ ) \
+))
+endef
+
# ==== Public API diff ===========================
include $(CLEAR_VARS)
@@ -260,13 +272,8 @@ LOCAL_ADDITIONAL_DEPENDENCIES := \
LOCAL_MODULE := offline-sdk-referenceonly
-last_released_sdk_version := $(lastword $(call numerically_sort, \
- $(filter-out current, \
- $(patsubst $(SRC_API_DIR)/%.txt,%, $(wildcard $(SRC_API_DIR)/*.txt)) \
- )\
- ))
-
-LOCAL_APIDIFF_OLDAPI := $(LOCAL_PATH)/../../$(SRC_API_DIR)/$(last_released_sdk_version)
+# Basename, because apidiff adds .txt internally.
+LOCAL_APIDIFF_OLDAPI := $(basename $(call highest_sdk_txt,public))
LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_API_FILE))
include $(BUILD_APIDIFF)
@@ -290,13 +297,8 @@ LOCAL_ADDITIONAL_DEPENDENCIES := \
LOCAL_MODULE := offline-system-sdk-referenceonly
-last_released_sdk_version := $(lastword $(call numerically_sort, \
- $(filter-out current, \
- $(patsubst $(SRC_SYSTEM_API_DIR)/%.txt,%, $(wildcard $(SRC_SYSTEM_API_DIR)/*.txt)) \
- )\
- ))
-
-LOCAL_APIDIFF_OLDAPI := $(LOCAL_PATH)/../../$(SRC_SYSTEM_API_DIR)/$(last_released_sdk_version)
+# Basename, because apidiff adds .txt internally.
+LOCAL_APIDIFF_OLDAPI := $(basename $(call highest_sdk_txt,system))
LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_SYSTEM_API_FILE))
include $(BUILD_APIDIFF)