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