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 | |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 34 | .PHONY: check-public-api |
| 35 | checkapi : check-public-api |
| 36 | |
| 37 | .PHONY: update-api |
| 38 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 39 | # INTERNAL_PLATFORM_API_FILE is the one build by droiddoc. |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 40 | # Note that since INTERNAL_PLATFORM_API_FILE is the byproduct of api-stubs module, |
| 41 | # (See frameworks/base/Android.mk) |
| 42 | # 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] | 43 | |
| 44 | # Check that the API we're building hasn't broken the last-released |
| 45 | # SDK version. |
| 46 | $(eval $(call check-api, \ |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 47 | checkpublicapi-last, \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 48 | $(SRC_API_DIR)/$(last_released_sdk_version).txt, \ |
| 49 | $(INTERNAL_PLATFORM_API_FILE), \ |
Hui Shu | f6a9b87 | 2014-03-13 15:38:29 -0700 | [diff] [blame] | 50 | frameworks/base/api/removed.txt, \ |
Hui Shu | e8af17e | 2014-02-21 14:18:19 -0800 | [diff] [blame] | 51 | $(INTERNAL_PLATFORM_REMOVED_API_FILE), \ |
Jeff Brown | dd24337 | 2013-04-01 13:40:55 -0700 | [diff] [blame] | 52 | -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] | 53 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 54 | -error 16 -error 17 -error 18 , \ |
| 55 | cat $(BUILD_SYSTEM)/apicheck_msg_last.txt, \ |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 56 | check-public-api, \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 57 | $(call doc-timestamp-for,api-stubs) \ |
| 58 | )) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 59 | |
| 60 | # Check that the API we're building hasn't changed from the not-yet-released |
| 61 | # SDK version. |
| 62 | $(eval $(call check-api, \ |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 63 | checkpublicapi-current, \ |
Ying Wang | 19cc22b | 2012-12-04 15:07:34 -0800 | [diff] [blame] | 64 | frameworks/base/api/current.txt, \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 65 | $(INTERNAL_PLATFORM_API_FILE), \ |
Hui Shu | e8af17e | 2014-02-21 14:18:19 -0800 | [diff] [blame] | 66 | frameworks/base/api/removed.txt, \ |
| 67 | $(INTERNAL_PLATFORM_REMOVED_API_FILE), \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 68 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 69 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 70 | -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] | 71 | -error 25 -error 26 -error 27, \ |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 72 | cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \ |
| 73 | check-public-api, \ |
Ying Wang | c065da2 | 2012-11-14 15:57:07 -0800 | [diff] [blame] | 74 | $(call doc-timestamp-for,api-stubs) \ |
| 75 | )) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 76 | |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 77 | .PHONY: update-public-api |
| 78 | update-public-api: $(INTERNAL_PLATFORM_API_FILE) | $(ACP) |
Joe Onorato | 15ee93b | 2011-04-08 15:03:48 -0700 | [diff] [blame] | 79 | @echo Copying current.txt |
Ying Wang | 19cc22b | 2012-12-04 15:07:34 -0800 | [diff] [blame] | 80 | $(hide) $(ACP) $(INTERNAL_PLATFORM_API_FILE) frameworks/base/api/current.txt |
Hui Shu | e8af17e | 2014-02-21 14:18:19 -0800 | [diff] [blame] | 81 | @echo Copying removed.txt |
| 82 | $(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] | 83 | |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 84 | update-api : update-public-api |
Ying Wang | 829f68b | 2014-06-26 17:54:28 -0700 | [diff] [blame] | 85 | |
| 86 | #####################Check System API##################### |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 87 | .PHONY: check-system-api |
| 88 | checkapi : check-system-api |
Ying Wang | 829f68b | 2014-06-26 17:54:28 -0700 | [diff] [blame] | 89 | |
| 90 | # Check that the System API we're building hasn't broken the last-released |
| 91 | # SDK version. |
| 92 | $(eval $(call check-api, \ |
| 93 | checksystemapi-last, \ |
| 94 | $(SRC_SYSTEM_API_DIR)/$(last_released_sdk_version).txt, \ |
| 95 | $(INTERNAL_PLATFORM_SYSTEM_API_FILE), \ |
| 96 | frameworks/base/api/system-removed.txt, \ |
| 97 | $(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE), \ |
| 98 | -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 \ |
| 99 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 100 | -error 16 -error 17 -error 18 , \ |
| 101 | cat $(BUILD_SYSTEM)/apicheck_msg_last.txt, \ |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 102 | check-system-api, \ |
Ying Wang | 829f68b | 2014-06-26 17:54:28 -0700 | [diff] [blame] | 103 | $(call doc-timestamp-for,system-api-stubs) \ |
| 104 | )) |
| 105 | |
| 106 | # Check that the System API we're building hasn't changed from the not-yet-released |
| 107 | # SDK version. |
| 108 | $(eval $(call check-api, \ |
| 109 | checksystemapi-current, \ |
| 110 | frameworks/base/api/system-current.txt, \ |
| 111 | $(INTERNAL_PLATFORM_SYSTEM_API_FILE), \ |
| 112 | frameworks/base/api/system-removed.txt, \ |
| 113 | $(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE), \ |
| 114 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 115 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 116 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 117 | -error 25 -error 26 -error 27, \ |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 118 | cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \ |
| 119 | check-system-api, \ |
Ying Wang | 829f68b | 2014-06-26 17:54:28 -0700 | [diff] [blame] | 120 | $(call doc-timestamp-for,system-api-stubs) \ |
| 121 | )) |
| 122 | |
| 123 | .PHONY: update-system-api |
Ying Wang | 668ae25 | 2015-01-09 14:05:38 -0800 | [diff] [blame] | 124 | update-api : update-system-api |
| 125 | |
Ying Wang | 829f68b | 2014-06-26 17:54:28 -0700 | [diff] [blame] | 126 | update-system-api: $(INTERNAL_PLATFORM_SYSTEM_API_FILE) | $(ACP) |
| 127 | @echo Copying system-current.txt |
| 128 | $(hide) $(ACP) $(INTERNAL_PLATFORM_SYSTEM_API_FILE) frameworks/base/api/system-current.txt |
| 129 | @echo Copying system-removed.txt |
| 130 | $(hide) $(ACP) $(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE) frameworks/base/api/system-removed.txt |
| 131 | |
Michael Wright | 0fb087f | 2015-11-06 15:20:51 +0000 | [diff] [blame] | 132 | #####################Check Test API##################### |
| 133 | .PHONY: check-test-api |
| 134 | checkapi : check-test-api |
| 135 | |
| 136 | # Check that the Test API we're building hasn't changed from the not-yet-released |
| 137 | # SDK version. Note that we don't check that we haven't broken the previous |
| 138 | # SDK's API because the test API is meant only for CTS which is always |
| 139 | # associated with the current release. |
| 140 | $(eval $(call check-api, \ |
| 141 | checktestapi-current, \ |
| 142 | frameworks/base/api/test-current.txt, \ |
| 143 | $(INTERNAL_PLATFORM_TEST_API_FILE), \ |
| 144 | frameworks/base/api/test-removed.txt, \ |
| 145 | $(INTERNAL_PLATFORM_TEST_REMOVED_API_FILE), \ |
| 146 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 147 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 148 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 149 | -error 25 -error 26 -error 27, \ |
| 150 | cat $(BUILD_SYSTEM)/apicheck_msg_current.txt, \ |
| 151 | check-test-api, \ |
| 152 | $(call doc-timestamp-for,test-api-stubs) \ |
| 153 | )) |
| 154 | |
| 155 | .PHONY: update-test-api |
| 156 | update-api : update-test-api |
| 157 | |
| 158 | update-test-api: $(INTERNAL_PLATFORM_TEST_API_FILE) | $(ACP) |
| 159 | @echo Copying test-current.txt |
| 160 | $(hide) $(ACP) $(INTERNAL_PLATFORM_TEST_API_FILE) frameworks/base/api/test-current.txt |
| 161 | @echo Copying test-removed.txt |
| 162 | $(hide) $(ACP) $(INTERNAL_PLATFORM_TEST_REMOVED_API_FILE) frameworks/base/api/test-removed.txt |
| 163 | |
| 164 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 165 | endif |