Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 1 | # Copyright (C) 2015 The CyanogenMod 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 | |
| 20 | # skip api check for PDK buid |
| 21 | ifeq (,$(filter true, $(WITHOUT_CHECK_API) $(TARGET_BUILD_PDK))) |
| 22 | |
| 23 | .PHONY: checkapi-cm |
| 24 | |
| 25 | # Run the checkapi rules by default. |
| 26 | droidcore: checkapi-cm |
| 27 | |
| 28 | cm_last_released_sdk_version := $(lastword $(call numerically_sort, \ |
| 29 | $(filter-out current, \ |
| 30 | $(patsubst $(CM_SRC_API_DIR)/%.txt,%, $(wildcard $(CM_SRC_API_DIR)/*.txt)) \ |
| 31 | )\ |
| 32 | )) |
| 33 | |
| 34 | .PHONY: check-cm-public-api |
| 35 | checkapi-cm : check-cm-public-api |
| 36 | |
| 37 | .PHONY: update-cm-api |
| 38 | |
| 39 | # INTERNAL_CM_PLATFORM_API_FILE is the one build by droiddoc. |
| 40 | # Note that since INTERNAL_CM_PLATFORM_API_FILE is the byproduct of api-stubs module, |
| 41 | # (See vendor/cmsdk/Android.mk) |
| 42 | # we need to add api-stubs as additional dependency of the api check. |
| 43 | |
Adnan Begovic | 97ac30e | 2016-02-10 14:43:35 -0800 | [diff] [blame^] | 44 | $(INTERNAL_CM_PLATFORM_API_FILE): cm-api-stubs-docs |
| 45 | |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 46 | # Check that the API we're building hasn't broken the last-released |
| 47 | # SDK version. |
| 48 | $(eval $(call check-api, \ |
| 49 | checkpublicapi-cm-last, \ |
| 50 | $(CM_SRC_API_DIR)/$(cm_last_released_sdk_version).txt, \ |
| 51 | $(INTERNAL_CM_PLATFORM_API_FILE), \ |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 52 | $(FRAMEWORK_CM_PLATFORM_REMOVED_API_FILE), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 53 | $(INTERNAL_CM_PLATFORM_REMOVED_API_FILE), \ |
Adnan Begovic | e738087 | 2016-02-09 11:04:37 -0800 | [diff] [blame] | 54 | -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 \ |
| 55 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 56 | -error 16 -error 17 -error 18 , \ |
| 57 | cat $(FRAMEWORK_CM_API_NEEDS_UPDATE_TEXT), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 58 | check-cm-public-api, \ |
Adnan Begovic | e738087 | 2016-02-09 11:04:37 -0800 | [diff] [blame] | 59 | $(call doc-timestamp-for,cm-api-stubs) \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 60 | )) |
| 61 | |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 62 | # Check that the API we're building hasn't changed from the not-yet-released |
| 63 | # SDK version. |
| 64 | $(eval $(call check-api, \ |
| 65 | checkpublicapi-cm-current, \ |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 66 | $(FRAMEWORK_CM_PLATFORM_API_FILE), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 67 | $(INTERNAL_CM_PLATFORM_API_FILE), \ |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 68 | $(FRAMEWORK_CM_PLATFORM_REMOVED_API_FILE), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 69 | $(INTERNAL_CM_PLATFORM_REMOVED_API_FILE), \ |
Adnan Begovic | e738087 | 2016-02-09 11:04:37 -0800 | [diff] [blame] | 70 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 71 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 72 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 73 | -error 25 -error 26 -error 27, \ |
| 74 | cat $(FRAMEWORK_CM_API_NEEDS_UPDATE_TEXT), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 75 | check-cm-public-api, \ |
Adnan Begovic | e738087 | 2016-02-09 11:04:37 -0800 | [diff] [blame] | 76 | $(call doc-timestamp-for,cm-api-stubs) \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 77 | )) |
| 78 | |
| 79 | .PHONY: update-cm-public-api |
| 80 | update-cm-public-api: $(INTERNAL_CM_PLATFORM_API_FILE) | $(ACP) |
| 81 | @echo -e ${CL_GRN}"Copying cm_current.txt"${CL_RST} |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 82 | $(hide) $(ACP) $(INTERNAL_CM_PLATFORM_API_FILE) $(FRAMEWORK_CM_PLATFORM_API_FILE) |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 83 | @echo -e ${CL_GRN}"Copying cm_removed.txt"${CL_RST} |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 84 | $(hide) $(ACP) $(INTERNAL_CM_PLATFORM_REMOVED_API_FILE) $(FRAMEWORK_CM_PLATFORM_REMOVED_API_FILE) |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 85 | |
| 86 | update-cm-api : update-cm-public-api |
| 87 | |
| 88 | #####################Check System API##################### |
| 89 | .PHONY: check-cm-system-api |
| 90 | checkapi-cm : check-cm-system-api |
| 91 | |
Adnan Begovic | 97ac30e | 2016-02-10 14:43:35 -0800 | [diff] [blame^] | 92 | $(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE): cm-system-api-stubs-docs |
| 93 | |
Adnan Begovic | e738087 | 2016-02-09 11:04:37 -0800 | [diff] [blame] | 94 | # Check that the System API we're building hasn't broken the last-released |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 95 | # SDK version. |
Adnan Begovic | ecc8b17 | 2015-06-04 14:03:43 -0700 | [diff] [blame] | 96 | $(eval $(call check-api, \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 97 | checksystemapi-cm-last, \ |
| 98 | $(CM_SRC_SYSTEM_API_DIR)/$(cm_last_released_sdk_version).txt, \ |
| 99 | $(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE), \ |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 100 | $(FRAMEWORK_CM_PLATFORM_SYSTEM_REMOVED_API_FILE), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 101 | $(INTERNAL_CM_PLATFORM_SYSTEM_REMOVED_API_FILE), \ |
Adnan Begovic | e738087 | 2016-02-09 11:04:37 -0800 | [diff] [blame] | 102 | -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 \ |
| 103 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 104 | -error 16 -error 17 -error 18 , \ |
| 105 | cat $(FRAMEWORK_CM_API_NEEDS_UPDATE_TEXT), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 106 | check-cm-system-api, \ |
Adnan Begovic | e738087 | 2016-02-09 11:04:37 -0800 | [diff] [blame] | 107 | $(call doc-timestamp-for,cm-system-api-stubs) \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 108 | )) |
| 109 | |
| 110 | # Check that the System API we're building hasn't changed from the not-yet-released |
| 111 | # SDK version. |
Adnan Begovic | ecc8b17 | 2015-06-04 14:03:43 -0700 | [diff] [blame] | 112 | $(eval $(call check-api, \ |
Adnan Begovic | f84ce1b | 2016-02-09 11:38:40 -0800 | [diff] [blame] | 113 | checksystemapi-cm-current, \ |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 114 | $(FRAMEWORK_CM_PLATFORM_SYSTEM_API_FILE), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 115 | $(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE), \ |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 116 | $(FRAMEWORK_CM_PLATFORM_SYSTEM_REMOVED_API_FILE), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 117 | $(INTERNAL_CM_PLATFORM_SYSTEM_REMOVED_API_FILE), \ |
Adnan Begovic | e738087 | 2016-02-09 11:04:37 -0800 | [diff] [blame] | 118 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 119 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 120 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 121 | -error 25 -error 26 -error 27, \ |
| 122 | cat $(FRAMEWORK_CM_API_NEEDS_UPDATE_TEXT), \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 123 | check-cm-system-api, \ |
Adnan Begovic | e738087 | 2016-02-09 11:04:37 -0800 | [diff] [blame] | 124 | $(call doc-timestamp-for,cm-system-api-stubs) \ |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 125 | )) |
| 126 | |
| 127 | .PHONY: update-cm-system-api |
| 128 | update-cm-api : update-cm-system-api |
| 129 | |
| 130 | update-cm-system-api: $(INTERNAL_PLATFORM_CM_SYSTEM_API_FILE) | $(ACP) |
| 131 | @echo Copying cm_system-current.txt |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 132 | $(hide) $(ACP) $(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE) $(FRAMEWORK_CM_PLATFORM_SYSTEM_API_FILE) |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 133 | @echo Copying cm_system-removed.txt |
Adnan Begovic | 5dd3371 | 2015-07-16 17:10:17 -0700 | [diff] [blame] | 134 | $(hide) $(ACP) $(INTERNAL_CM_PLATFORM_SYSTEM_REMOVED_API_FILE) $(FRAMEWORK_CM_PLATFORM_SYSTEM_REMOVED_API_FILE) |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 135 | |
Adnan Begovic | 4397d1d | 2015-07-16 17:11:06 -0700 | [diff] [blame] | 136 | .PHONY: update-cm-prebuilts-latest-public-api |
| 137 | current_sdk_release_text_file := $(CM_SRC_API_DIR)/$(cm_last_released_sdk_version).txt |
Adnan Begovic | 39ba595 | 2015-12-23 12:38:15 -0800 | [diff] [blame] | 138 | current_system_api_release_text_file := $(CM_SRC_SYSTEM_API_DIR)/$(cm_last_released_sdk_version).txt |
Adnan Begovic | 4397d1d | 2015-07-16 17:11:06 -0700 | [diff] [blame] | 139 | |
| 140 | update-cm-prebuilts-latest-public-api: $(FRAMEWORK_CM_PLATFORM_API_FILE) | $(ACP) |
| 141 | @echo -e ${CL_GRN}"Publishing cm_current.txt as latest API release"${CL_RST} |
| 142 | $(hide) $(ACP) $(FRAMEWORK_CM_PLATFORM_API_FILE) $(current_sdk_release_text_file) |
Adnan Begovic | 39ba595 | 2015-12-23 12:38:15 -0800 | [diff] [blame] | 143 | @echo -e ${CL_GRN}"Publishing cm_current.txt as latest system API release"${CL_RST} |
| 144 | $(hide) $(ACP) $(FRAMEWORK_CM_PLATFORM_SYSTEM_API_FILE) $(current_system_api_release_text_file) |
Adnan Begovic | 4397d1d | 2015-07-16 17:11:06 -0700 | [diff] [blame] | 145 | |
Adnan Begovic | 744a257 | 2015-05-26 18:19:59 -0700 | [diff] [blame] | 146 | endif |