2015-05-27 01:19:59 +00:00
|
|
|
# Copyright (C) 2015 The CyanogenMod Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
#
|
|
|
|
# Rules for running apicheck to confirm that you haven't broken
|
|
|
|
# api compatibility or added apis illegally.
|
|
|
|
#
|
|
|
|
|
|
|
|
# skip api check for PDK buid
|
|
|
|
ifeq (,$(filter true, $(WITHOUT_CHECK_API) $(TARGET_BUILD_PDK)))
|
|
|
|
|
|
|
|
.PHONY: checkapi-cm
|
|
|
|
|
|
|
|
# Run the checkapi rules by default.
|
|
|
|
droidcore: checkapi-cm
|
|
|
|
|
2016-03-10 20:01:04 +00:00
|
|
|
# Validate against current platform sdk version api text within prebuilts
|
|
|
|
cm_last_released_sdk_version := $(CM_PLATFORM_SDK_VERSION)
|
2015-05-27 01:19:59 +00:00
|
|
|
|
|
|
|
.PHONY: check-cm-public-api
|
|
|
|
checkapi-cm : check-cm-public-api
|
|
|
|
|
|
|
|
.PHONY: update-cm-api
|
|
|
|
|
|
|
|
# INTERNAL_CM_PLATFORM_API_FILE is the one build by droiddoc.
|
|
|
|
# Note that since INTERNAL_CM_PLATFORM_API_FILE is the byproduct of api-stubs module,
|
|
|
|
# (See vendor/cmsdk/Android.mk)
|
|
|
|
# we need to add api-stubs as additional dependency of the api check.
|
|
|
|
|
2016-02-10 22:43:35 +00:00
|
|
|
$(INTERNAL_CM_PLATFORM_API_FILE): cm-api-stubs-docs
|
|
|
|
|
2015-05-27 01:19:59 +00:00
|
|
|
# Check that the API we're building hasn't broken the last-released
|
|
|
|
# SDK version.
|
|
|
|
$(eval $(call check-api, \
|
|
|
|
checkpublicapi-cm-last, \
|
|
|
|
$(CM_SRC_API_DIR)/$(cm_last_released_sdk_version).txt, \
|
|
|
|
$(INTERNAL_CM_PLATFORM_API_FILE), \
|
2015-07-17 00:10:17 +00:00
|
|
|
$(FRAMEWORK_CM_PLATFORM_REMOVED_API_FILE), \
|
2015-05-27 01:19:59 +00:00
|
|
|
$(INTERNAL_CM_PLATFORM_REMOVED_API_FILE), \
|
2016-02-09 19:04:37 +00:00
|
|
|
-hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 \
|
|
|
|
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
|
|
|
|
-error 16 -error 17 -error 18 , \
|
|
|
|
cat $(FRAMEWORK_CM_API_NEEDS_UPDATE_TEXT), \
|
2015-05-27 01:19:59 +00:00
|
|
|
check-cm-public-api, \
|
2016-02-09 19:04:37 +00:00
|
|
|
$(call doc-timestamp-for,cm-api-stubs) \
|
2015-05-27 01:19:59 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
# Check that the API we're building hasn't changed from the not-yet-released
|
|
|
|
# SDK version.
|
|
|
|
$(eval $(call check-api, \
|
|
|
|
checkpublicapi-cm-current, \
|
2015-07-17 00:10:17 +00:00
|
|
|
$(FRAMEWORK_CM_PLATFORM_API_FILE), \
|
2015-05-27 01:19:59 +00:00
|
|
|
$(INTERNAL_CM_PLATFORM_API_FILE), \
|
2015-07-17 00:10:17 +00:00
|
|
|
$(FRAMEWORK_CM_PLATFORM_REMOVED_API_FILE), \
|
2015-05-27 01:19:59 +00:00
|
|
|
$(INTERNAL_CM_PLATFORM_REMOVED_API_FILE), \
|
2016-02-09 19:04:37 +00:00
|
|
|
-error 2 -error 3 -error 4 -error 5 -error 6 \
|
|
|
|
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
|
|
|
|
-error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
|
|
|
|
-error 25 -error 26 -error 27, \
|
|
|
|
cat $(FRAMEWORK_CM_API_NEEDS_UPDATE_TEXT), \
|
2015-05-27 01:19:59 +00:00
|
|
|
check-cm-public-api, \
|
2016-02-09 19:04:37 +00:00
|
|
|
$(call doc-timestamp-for,cm-api-stubs) \
|
2015-05-27 01:19:59 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
.PHONY: update-cm-public-api
|
|
|
|
update-cm-public-api: $(INTERNAL_CM_PLATFORM_API_FILE) | $(ACP)
|
|
|
|
@echo -e ${CL_GRN}"Copying cm_current.txt"${CL_RST}
|
2015-07-17 00:10:17 +00:00
|
|
|
$(hide) $(ACP) $(INTERNAL_CM_PLATFORM_API_FILE) $(FRAMEWORK_CM_PLATFORM_API_FILE)
|
2015-05-27 01:19:59 +00:00
|
|
|
@echo -e ${CL_GRN}"Copying cm_removed.txt"${CL_RST}
|
2015-07-17 00:10:17 +00:00
|
|
|
$(hide) $(ACP) $(INTERNAL_CM_PLATFORM_REMOVED_API_FILE) $(FRAMEWORK_CM_PLATFORM_REMOVED_API_FILE)
|
2015-05-27 01:19:59 +00:00
|
|
|
|
|
|
|
update-cm-api : update-cm-public-api
|
|
|
|
|
|
|
|
#####################Check System API#####################
|
|
|
|
.PHONY: check-cm-system-api
|
|
|
|
checkapi-cm : check-cm-system-api
|
|
|
|
|
2016-02-10 22:43:35 +00:00
|
|
|
$(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE): cm-system-api-stubs-docs
|
|
|
|
|
2016-02-09 19:04:37 +00:00
|
|
|
# Check that the System API we're building hasn't broken the last-released
|
2015-05-27 01:19:59 +00:00
|
|
|
# SDK version.
|
2015-06-04 21:03:43 +00:00
|
|
|
$(eval $(call check-api, \
|
2015-05-27 01:19:59 +00:00
|
|
|
checksystemapi-cm-last, \
|
|
|
|
$(CM_SRC_SYSTEM_API_DIR)/$(cm_last_released_sdk_version).txt, \
|
|
|
|
$(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE), \
|
2015-07-17 00:10:17 +00:00
|
|
|
$(FRAMEWORK_CM_PLATFORM_SYSTEM_REMOVED_API_FILE), \
|
2015-05-27 01:19:59 +00:00
|
|
|
$(INTERNAL_CM_PLATFORM_SYSTEM_REMOVED_API_FILE), \
|
2016-02-09 19:04:37 +00:00
|
|
|
-hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 \
|
|
|
|
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
|
|
|
|
-error 16 -error 17 -error 18 , \
|
|
|
|
cat $(FRAMEWORK_CM_API_NEEDS_UPDATE_TEXT), \
|
2015-05-27 01:19:59 +00:00
|
|
|
check-cm-system-api, \
|
2016-02-09 19:04:37 +00:00
|
|
|
$(call doc-timestamp-for,cm-system-api-stubs) \
|
2015-05-27 01:19:59 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
# Check that the System API we're building hasn't changed from the not-yet-released
|
|
|
|
# SDK version.
|
2015-06-04 21:03:43 +00:00
|
|
|
$(eval $(call check-api, \
|
2016-02-09 19:38:40 +00:00
|
|
|
checksystemapi-cm-current, \
|
2015-07-17 00:10:17 +00:00
|
|
|
$(FRAMEWORK_CM_PLATFORM_SYSTEM_API_FILE), \
|
2015-05-27 01:19:59 +00:00
|
|
|
$(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE), \
|
2015-07-17 00:10:17 +00:00
|
|
|
$(FRAMEWORK_CM_PLATFORM_SYSTEM_REMOVED_API_FILE), \
|
2015-05-27 01:19:59 +00:00
|
|
|
$(INTERNAL_CM_PLATFORM_SYSTEM_REMOVED_API_FILE), \
|
2016-02-09 19:04:37 +00:00
|
|
|
-error 2 -error 3 -error 4 -error 5 -error 6 \
|
|
|
|
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
|
|
|
|
-error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
|
|
|
|
-error 25 -error 26 -error 27, \
|
|
|
|
cat $(FRAMEWORK_CM_API_NEEDS_UPDATE_TEXT), \
|
2015-05-27 01:19:59 +00:00
|
|
|
check-cm-system-api, \
|
2016-02-09 19:04:37 +00:00
|
|
|
$(call doc-timestamp-for,cm-system-api-stubs) \
|
2015-05-27 01:19:59 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
.PHONY: update-cm-system-api
|
|
|
|
update-cm-api : update-cm-system-api
|
|
|
|
|
|
|
|
update-cm-system-api: $(INTERNAL_PLATFORM_CM_SYSTEM_API_FILE) | $(ACP)
|
|
|
|
@echo Copying cm_system-current.txt
|
2015-07-17 00:10:17 +00:00
|
|
|
$(hide) $(ACP) $(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE) $(FRAMEWORK_CM_PLATFORM_SYSTEM_API_FILE)
|
2015-05-27 01:19:59 +00:00
|
|
|
@echo Copying cm_system-removed.txt
|
2015-07-17 00:10:17 +00:00
|
|
|
$(hide) $(ACP) $(INTERNAL_CM_PLATFORM_SYSTEM_REMOVED_API_FILE) $(FRAMEWORK_CM_PLATFORM_SYSTEM_REMOVED_API_FILE)
|
2015-05-27 01:19:59 +00:00
|
|
|
|
2015-07-17 00:11:06 +00:00
|
|
|
.PHONY: update-cm-prebuilts-latest-public-api
|
|
|
|
current_sdk_release_text_file := $(CM_SRC_API_DIR)/$(cm_last_released_sdk_version).txt
|
2015-12-23 20:38:15 +00:00
|
|
|
current_system_api_release_text_file := $(CM_SRC_SYSTEM_API_DIR)/$(cm_last_released_sdk_version).txt
|
2015-07-17 00:11:06 +00:00
|
|
|
|
|
|
|
update-cm-prebuilts-latest-public-api: $(FRAMEWORK_CM_PLATFORM_API_FILE) | $(ACP)
|
|
|
|
@echo -e ${CL_GRN}"Publishing cm_current.txt as latest API release"${CL_RST}
|
|
|
|
$(hide) $(ACP) $(FRAMEWORK_CM_PLATFORM_API_FILE) $(current_sdk_release_text_file)
|
2015-12-23 20:38:15 +00:00
|
|
|
@echo -e ${CL_GRN}"Publishing cm_current.txt as latest system API release"${CL_RST}
|
|
|
|
$(hide) $(ACP) $(FRAMEWORK_CM_PLATFORM_SYSTEM_API_FILE) $(current_system_api_release_text_file)
|
2015-07-17 00:11:06 +00:00
|
|
|
|
2015-05-27 01:19:59 +00:00
|
|
|
endif
|