The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | # Copyright (C) 2008 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # |
| 16 | # Rules for running apicheck to confirm that you haven't broken |
| 17 | # api compatibility or added apis illegally. |
| 18 | # |
| 19 | |
Mike Lockwood | daf5e22 | 2012-10-18 10:17:47 -0700 | [diff] [blame] | 20 | # skip api check for PDK buid |
| 21 | ifeq (,$(filter true, $(WITHOUT_CHECK_API) $(TARGET_BUILD_PDK))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 22 | |
| 23 | .PHONY: checkapi |
| 24 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 25 | # Run the checkapi rules by default. |
| 26 | droidcore: checkapi |
| 27 | |
Joe Onorato | 15ee93b | 2011-04-08 15:03:48 -0700 | [diff] [blame] | 28 | last_released_sdk_version := $(lastword $(call numerically_sort, \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 29 | $(filter-out current, \ |
Joe Onorato | 15ee93b | 2011-04-08 15:03:48 -0700 | [diff] [blame] | 30 | $(patsubst $(SRC_API_DIR)/%.txt,%, $(wildcard $(SRC_API_DIR)/*.txt)) \ |
| 31 | )\ |
| 32 | )) |
Ying Wang | 0f6f4ca | 2010-06-09 10:26:26 -0700 | [diff] [blame] | 33 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 34 | # INTERNAL_PLATFORM_API_FILE is the one build by droiddoc. |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 35 | # Note that since INTERNAL_PLATFORM_API_FILE is the byproduct of api-stubs module, |
| 36 | # (See frameworks/base/Android.mk) |
| 37 | # we need to add api-stubs as additional dependency of the api check. |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 38 | |
| 39 | # Check that the API we're building hasn't broken the last-released |
| 40 | # SDK version. |
| 41 | $(eval $(call check-api, \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 42 | checkapi-last, \ |
| 43 | $(SRC_API_DIR)/$(last_released_sdk_version).txt, \ |
| 44 | $(INTERNAL_PLATFORM_API_FILE), \ |
Hui Shu | e8af17e | 2014-02-21 14:18:19 -0800 | [diff] [blame] | 45 | $(SRC_API_DIR)/removed.txt, \ |
| 46 | $(INTERNAL_PLATFORM_REMOVED_API_FILE), \ |
Jeff Brown | dd24337 | 2013-04-01 13:40:55 -0700 | [diff] [blame] | 47 | -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 48 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 49 | -error 16 -error 17 -error 18 , \ |
| 50 | cat $(BUILD_SYSTEM)/apicheck_msg_last.txt, \ |
| 51 | checkapi, \ |
| 52 | $(call doc-timestamp-for,api-stubs) \ |
| 53 | )) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 54 | |
| 55 | # Check that the API we're building hasn't changed from the not-yet-released |
| 56 | # SDK version. |
| 57 | $(eval $(call check-api, \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 58 | checkapi-current, \ |
Ying Wang | 19cc22b | 2012-12-04 15:07:34 -0800 | [diff] [blame] | 59 | frameworks/base/api/current.txt, \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 60 | $(INTERNAL_PLATFORM_API_FILE), \ |
Hui Shu | e8af17e | 2014-02-21 14:18:19 -0800 | [diff] [blame] | 61 | frameworks/base/api/removed.txt, \ |
| 62 | $(INTERNAL_PLATFORM_REMOVED_API_FILE), \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 63 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 64 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 65 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
Jeff Brown | dd24337 | 2013-04-01 13:40:55 -0700 | [diff] [blame] | 66 | -error 25 -error 26 -error 27, \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 67 | cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \ |
| 68 | checkapi, \ |
| 69 | $(call doc-timestamp-for,api-stubs) \ |
| 70 | )) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 71 | |
| 72 | .PHONY: update-api |
| 73 | update-api: $(INTERNAL_PLATFORM_API_FILE) | $(ACP) |
Joe Onorato | 15ee93b | 2011-04-08 15:03:48 -0700 | [diff] [blame] | 74 | @echo Copying current.txt |
Ying Wang | 19cc22b | 2012-12-04 15:07:34 -0800 | [diff] [blame] | 75 | $(hide) $(ACP) $(INTERNAL_PLATFORM_API_FILE) frameworks/base/api/current.txt |
Hui Shu | e8af17e | 2014-02-21 14:18:19 -0800 | [diff] [blame] | 76 | @echo Copying removed.txt |
| 77 | $(hide) $(ACP) $(INTERNAL_PLATFORM_REMOVED_API_FILE) frameworks/base/api/removed.txt |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 78 | |
| 79 | endif |