2009-03-04 11:28:42 +08:00
|
|
|
# Copyright (C) 2008 The Android Open Source 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.
|
|
|
|
#
|
|
|
|
|
2012-10-19 01:17:47 +08:00
|
|
|
# skip api check for PDK buid
|
|
|
|
ifeq (,$(filter true, $(WITHOUT_CHECK_API) $(TARGET_BUILD_PDK)))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
.PHONY: checkapi
|
|
|
|
|
|
|
|
# Run the checkapi rules by default.
|
|
|
|
droidcore: checkapi
|
|
|
|
|
2011-04-09 06:03:48 +08:00
|
|
|
last_released_sdk_version := $(lastword $(call numerically_sort, \
|
2012-11-15 07:57:07 +08:00
|
|
|
$(filter-out current, \
|
2011-04-09 06:03:48 +08:00
|
|
|
$(patsubst $(SRC_API_DIR)/%.txt,%, $(wildcard $(SRC_API_DIR)/*.txt)) \
|
|
|
|
)\
|
|
|
|
))
|
2010-06-10 01:26:26 +08:00
|
|
|
|
2015-01-10 06:05:38 +08:00
|
|
|
.PHONY: check-public-api
|
|
|
|
checkapi : check-public-api
|
|
|
|
|
|
|
|
.PHONY: update-api
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# INTERNAL_PLATFORM_API_FILE is the one build by droiddoc.
|
2012-11-15 07:57:07 +08:00
|
|
|
# Note that since INTERNAL_PLATFORM_API_FILE is the byproduct of api-stubs module,
|
|
|
|
# (See frameworks/base/Android.mk)
|
|
|
|
# we need to add api-stubs as additional dependency of the api check.
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# Check that the API we're building hasn't broken the last-released
|
|
|
|
# SDK version.
|
|
|
|
$(eval $(call check-api, \
|
2015-01-10 06:05:38 +08:00
|
|
|
checkpublicapi-last, \
|
2012-11-15 07:57:07 +08:00
|
|
|
$(SRC_API_DIR)/$(last_released_sdk_version).txt, \
|
|
|
|
$(INTERNAL_PLATFORM_API_FILE), \
|
2014-03-14 06:38:29 +08:00
|
|
|
frameworks/base/api/removed.txt, \
|
2014-02-22 06:18:19 +08:00
|
|
|
$(INTERNAL_PLATFORM_REMOVED_API_FILE), \
|
2013-04-02 04:40:55 +08:00
|
|
|
-hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 \
|
2012-11-15 07:57:07 +08:00
|
|
|
-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 $(BUILD_SYSTEM)/apicheck_msg_last.txt, \
|
2015-01-10 06:05:38 +08:00
|
|
|
check-public-api, \
|
2012-11-15 07:57:07 +08:00
|
|
|
$(call doc-timestamp-for,api-stubs) \
|
|
|
|
))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# Check that the API we're building hasn't changed from the not-yet-released
|
|
|
|
# SDK version.
|
|
|
|
$(eval $(call check-api, \
|
2015-01-10 06:05:38 +08:00
|
|
|
checkpublicapi-current, \
|
2012-12-05 07:07:34 +08:00
|
|
|
frameworks/base/api/current.txt, \
|
2012-11-15 07:57:07 +08:00
|
|
|
$(INTERNAL_PLATFORM_API_FILE), \
|
2014-02-22 06:18:19 +08:00
|
|
|
frameworks/base/api/removed.txt, \
|
|
|
|
$(INTERNAL_PLATFORM_REMOVED_API_FILE), \
|
2012-11-15 07:57:07 +08: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 \
|
2013-04-02 04:40:55 +08:00
|
|
|
-error 25 -error 26 -error 27, \
|
2015-01-10 06:05:38 +08:00
|
|
|
cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \
|
|
|
|
check-public-api, \
|
2012-11-15 07:57:07 +08:00
|
|
|
$(call doc-timestamp-for,api-stubs) \
|
|
|
|
))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2015-01-10 06:05:38 +08:00
|
|
|
.PHONY: update-public-api
|
|
|
|
update-public-api: $(INTERNAL_PLATFORM_API_FILE) | $(ACP)
|
2011-04-09 06:03:48 +08:00
|
|
|
@echo Copying current.txt
|
2012-12-05 07:07:34 +08:00
|
|
|
$(hide) $(ACP) $(INTERNAL_PLATFORM_API_FILE) frameworks/base/api/current.txt
|
2014-02-22 06:18:19 +08:00
|
|
|
@echo Copying removed.txt
|
|
|
|
$(hide) $(ACP) $(INTERNAL_PLATFORM_REMOVED_API_FILE) frameworks/base/api/removed.txt
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2015-01-10 06:05:38 +08:00
|
|
|
update-api : update-public-api
|
2014-06-27 08:54:28 +08:00
|
|
|
|
|
|
|
#####################Check System API#####################
|
2015-01-10 06:05:38 +08:00
|
|
|
.PHONY: check-system-api
|
|
|
|
checkapi : check-system-api
|
2014-06-27 08:54:28 +08:00
|
|
|
|
|
|
|
# Check that the System API we're building hasn't broken the last-released
|
|
|
|
# SDK version.
|
|
|
|
$(eval $(call check-api, \
|
|
|
|
checksystemapi-last, \
|
|
|
|
$(SRC_SYSTEM_API_DIR)/$(last_released_sdk_version).txt, \
|
|
|
|
$(INTERNAL_PLATFORM_SYSTEM_API_FILE), \
|
|
|
|
frameworks/base/api/system-removed.txt, \
|
|
|
|
$(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE), \
|
|
|
|
-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 $(BUILD_SYSTEM)/apicheck_msg_last.txt, \
|
2015-01-10 06:05:38 +08:00
|
|
|
check-system-api, \
|
2014-06-27 08:54:28 +08:00
|
|
|
$(call doc-timestamp-for,system-api-stubs) \
|
|
|
|
))
|
|
|
|
|
|
|
|
# Check that the System API we're building hasn't changed from the not-yet-released
|
|
|
|
# SDK version.
|
|
|
|
$(eval $(call check-api, \
|
|
|
|
checksystemapi-current, \
|
|
|
|
frameworks/base/api/system-current.txt, \
|
|
|
|
$(INTERNAL_PLATFORM_SYSTEM_API_FILE), \
|
|
|
|
frameworks/base/api/system-removed.txt, \
|
|
|
|
$(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE), \
|
|
|
|
-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, \
|
2015-01-10 06:05:38 +08:00
|
|
|
cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \
|
|
|
|
check-system-api, \
|
2014-06-27 08:54:28 +08:00
|
|
|
$(call doc-timestamp-for,system-api-stubs) \
|
|
|
|
))
|
|
|
|
|
|
|
|
.PHONY: update-system-api
|
2015-01-10 06:05:38 +08:00
|
|
|
update-api : update-system-api
|
|
|
|
|
2014-06-27 08:54:28 +08:00
|
|
|
update-system-api: $(INTERNAL_PLATFORM_SYSTEM_API_FILE) | $(ACP)
|
|
|
|
@echo Copying system-current.txt
|
|
|
|
$(hide) $(ACP) $(INTERNAL_PLATFORM_SYSTEM_API_FILE) frameworks/base/api/system-current.txt
|
|
|
|
@echo Copying system-removed.txt
|
|
|
|
$(hide) $(ACP) $(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE) frameworks/base/api/system-removed.txt
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|