The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2008 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | LOCAL_PATH:= $(call my-dir) |
| 18 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 19 | android_test_mock_source_files := $(call all-java-files-under, src/android/test/mock) |
| 20 | |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 21 | # Build the android.test.runner library |
| 22 | # ===================================== |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | include $(CLEAR_VARS) |
| 24 | |
Paul Duffin | 855d702 | 2017-07-10 15:16:07 +0100 | [diff] [blame] | 25 | LOCAL_SRC_FILES := \ |
| 26 | $(filter-out $(android_test_mock_source_files), $(call all-java-files-under, src)) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | |
Paul Duffin | 855d702 | 2017-07-10 15:16:07 +0100 | [diff] [blame] | 28 | LOCAL_JAVA_LIBRARIES := \ |
| 29 | core-oj \ |
| 30 | core-libart \ |
| 31 | framework \ |
| 32 | legacy-test \ |
| 33 | android.test.mock \ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | |
| 35 | LOCAL_MODULE:= android.test.runner |
| 36 | |
| 37 | include $(BUILD_JAVA_LIBRARY) |
Brett Chabot | e70f61b | 2010-02-19 10:49:27 -0800 | [diff] [blame] | 38 | |
Paul Duffin | 8eaf94b | 2017-07-05 09:51:25 +0100 | [diff] [blame] | 39 | # Build the repackaged.android.test.runner library |
| 40 | # ================================================ |
| 41 | include $(CLEAR_VARS) |
| 42 | |
| 43 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
| 44 | |
| 45 | LOCAL_JAVA_LIBRARIES := core-oj core-libart framework legacy-test |
| 46 | |
| 47 | LOCAL_JARJAR_RULES := $(LOCAL_PATH)/../legacy-test/jarjar-rules.txt |
| 48 | |
| 49 | LOCAL_MODULE:= repackaged.android.test.runner |
| 50 | |
| 51 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 52 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 53 | # Generate the stub source files for android.test.runner.stubs |
| 54 | # ============================================================ |
| 55 | include $(CLEAR_VARS) |
| 56 | |
| 57 | # Exclude android.test.mock classes as stubs for them are created in the |
| 58 | # android.test.mock.stubs target |
| 59 | LOCAL_SRC_FILES := \ |
| 60 | $(filter-out $(android_test_mock_source_files), $(call all-java-files-under, src)) |
| 61 | |
| 62 | LOCAL_JAVA_LIBRARIES := \ |
| 63 | core-oj \ |
| 64 | core-libart \ |
| 65 | framework \ |
| 66 | legacy-test \ |
| 67 | android.test.mock \ |
| 68 | |
| 69 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 70 | LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src |
| 71 | |
| 72 | ANDROID_TEST_RUNNER_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/api.txt |
| 73 | ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/removed.txt |
| 74 | |
| 75 | ANDROID_TEST_RUNNER_API_FILE := $(LOCAL_PATH)/api/android-test-runner-current.txt |
| 76 | ANDROID_TEST_RUNNER_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-runner-removed.txt |
| 77 | |
| 78 | LOCAL_DROIDDOC_OPTIONS:= \ |
| 79 | -stubpackages android.test:android.test.suitebuilder:junit.runner:junit.textui \ |
| 80 | -stubsourceonly \ |
| 81 | -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/src \ |
| 82 | -nodocs \ |
| 83 | -api $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE) \ |
| 84 | -removedApi $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE) \ |
| 85 | |
| 86 | LOCAL_UNINSTALLABLE_MODULE := true |
| 87 | LOCAL_MODULE := android-test-runner-api-stubs-gen |
| 88 | |
| 89 | include $(BUILD_DROIDDOC) |
| 90 | |
| 91 | # Remember the target that will trigger the code generation. |
| 92 | android_test_runner_api_gen_stamp := $(full_target) |
| 93 | |
| 94 | # Add some additional dependencies |
| 95 | $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE): $(full_target) |
| 96 | $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE): $(full_target) |
| 97 | |
| 98 | # Build the android.test.runner.stubs library |
| 99 | # =========================================== |
| 100 | include $(CLEAR_VARS) |
| 101 | |
| 102 | LOCAL_MODULE := android.test.runner.stubs |
| 103 | |
| 104 | LOCAL_JAVA_LIBRARIES := \ |
| 105 | legacy.test.stubs \ |
| 106 | android.test.mock.stubs \ |
| 107 | |
| 108 | LOCAL_SOURCE_FILES_ALL_GENERATED := true |
| 109 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 110 | # Make sure to run droiddoc first to generate the stub source files. |
Colin Cross | 85ab406 | 2017-09-05 22:59:27 -0700 | [diff] [blame^] | 111 | LOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_runner_api_gen_stamp) |
| 112 | |
| 113 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 114 | |
| 115 | # Archive a copy of the classes.jar in SDK build. |
| 116 | $(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.runner.stubs.jar) |
| 117 | |
| 118 | # Check that the android.test.runner.stubs library has not changed |
| 119 | # ================================================================ |
| 120 | |
| 121 | # Check that the API we're building hasn't changed from the not-yet-released |
| 122 | # SDK version. |
| 123 | $(eval $(call check-api, \ |
| 124 | check-android-test-runner-api-current, \ |
| 125 | $(ANDROID_TEST_RUNNER_API_FILE), \ |
| 126 | $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE), \ |
| 127 | $(ANDROID_TEST_RUNNER_REMOVED_API_FILE), \ |
| 128 | $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE), \ |
| 129 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 130 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 131 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 132 | -error 25 -error 26 -error 27, \ |
| 133 | cat $(LOCAL_PATH)/api/apicheck_msg_android_test_runner.txt, \ |
| 134 | check-android-test-runner-api, \ |
| 135 | $(call doc-timestamp-for,android-test-runner-api-stubs-gen) \ |
| 136 | )) |
| 137 | |
| 138 | .PHONY: check-android-test-runner-api |
| 139 | checkapi: check-android-test-runner-api |
| 140 | |
| 141 | .PHONY: update-android-test-runner-api |
| 142 | update-api: update-android-test-runner-api |
| 143 | |
| 144 | update-android-test-runner-api: $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE) | $(ACP) |
| 145 | @echo Copying current.txt |
| 146 | $(hide) $(ACP) $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE) $(ANDROID_TEST_RUNNER_API_FILE) |
| 147 | @echo Copying removed.txt |
| 148 | $(hide) $(ACP) $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE) $(ANDROID_TEST_RUNNER_REMOVED_API_FILE) |
| 149 | |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 150 | # Build the android.test.mock library |
| 151 | # =================================== |
| 152 | include $(CLEAR_VARS) |
| 153 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 154 | LOCAL_SRC_FILES := $(android_test_mock_source_files) |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 155 | |
| 156 | LOCAL_JAVA_LIBRARIES := core-oj core-libart framework |
| 157 | |
| 158 | LOCAL_MODULE:= android.test.mock |
| 159 | |
| 160 | include $(BUILD_JAVA_LIBRARY) |
| 161 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 162 | # Generate the stub source files for android.test.mock.stubs |
| 163 | # ========================================================== |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 164 | include $(CLEAR_VARS) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 165 | LOCAL_SRC_FILES := $(android_test_mock_source_files) |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 166 | |
| 167 | LOCAL_JAVA_LIBRARIES := core-oj core-libart framework |
| 168 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 169 | LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src/android/test/mock |
| 170 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 171 | ANDROID_TEST_MOCK_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/api.txt |
| 172 | ANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/removed.txt |
| 173 | |
| 174 | ANDROID_TEST_MOCK_API_FILE := $(LOCAL_PATH)/api/android-test-mock-current.txt |
| 175 | ANDROID_TEST_MOCK_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-mock-removed.txt |
| 176 | |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 177 | LOCAL_DROIDDOC_OPTIONS:= \ |
| 178 | -stubpackages android.test.mock \ |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 179 | -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/src \ |
| 180 | -nodocs \ |
| 181 | -api $(ANDROID_TEST_MOCK_OUTPUT_API_FILE) \ |
| 182 | -removedApi $(ANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE) \ |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 183 | |
| 184 | LOCAL_UNINSTALLABLE_MODULE := true |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 185 | LOCAL_MODULE := android-test-mock-api-stubs-gen |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 186 | |
| 187 | include $(BUILD_DROIDDOC) |
| 188 | |
| 189 | # Remember the target that will trigger the code generation. |
| 190 | android_test_mock_gen_stamp := $(full_target) |
| 191 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 192 | # Add some additional dependencies |
| 193 | $(ANDROID_TEST_MOCK_OUTPUT_API_FILE): $(full_target) |
| 194 | $(ANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE): $(full_target) |
| 195 | |
| 196 | # Build the android.test.mock.stubs library |
| 197 | # ========================================= |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 198 | include $(CLEAR_VARS) |
| 199 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 200 | LOCAL_MODULE := android.test.mock.stubs |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 201 | |
| 202 | LOCAL_SOURCE_FILES_ALL_GENERATED := true |
| 203 | |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 204 | # Make sure to run droiddoc first to generate the stub source files. |
Colin Cross | 85ab406 | 2017-09-05 22:59:27 -0700 | [diff] [blame^] | 205 | LOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_mock_gen_stamp) |
| 206 | |
| 207 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 208 | |
| 209 | # Archive a copy of the classes.jar in SDK build. |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 210 | $(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.mock.stubs.jar) |
| 211 | |
| 212 | # Check that the android.test.mock.stubs library has not changed |
| 213 | # ============================================================== |
| 214 | |
| 215 | # Check that the API we're building hasn't changed from the not-yet-released |
| 216 | # SDK version. |
| 217 | $(eval $(call check-api, \ |
| 218 | check-android-test-mock-api-current, \ |
| 219 | $(ANDROID_TEST_MOCK_API_FILE), \ |
| 220 | $(ANDROID_TEST_MOCK_OUTPUT_API_FILE), \ |
| 221 | $(ANDROID_TEST_MOCK_REMOVED_API_FILE), \ |
| 222 | $(ANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE), \ |
| 223 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 224 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 225 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 226 | -error 25 -error 26 -error 27, \ |
| 227 | cat $(LOCAL_PATH)/api/apicheck_msg_android_test_mock.txt, \ |
| 228 | check-android-test-mock-api, \ |
| 229 | $(call doc-timestamp-for,android-test-mock-api-stubs-gen) \ |
| 230 | )) |
| 231 | |
| 232 | .PHONY: check-android-test-mock-api |
| 233 | checkapi: check-android-test-mock-api |
| 234 | |
| 235 | .PHONY: update-android-test-mock-api |
| 236 | update-api: update-android-test-mock-api |
| 237 | |
| 238 | update-android-test-mock-api: $(ANDROID_TEST_MOCK_OUTPUT_API_FILE) | $(ACP) |
| 239 | @echo Copying current.txt |
| 240 | $(hide) $(ACP) $(ANDROID_TEST_MOCK_OUTPUT_API_FILE) $(ANDROID_TEST_MOCK_API_FILE) |
| 241 | @echo Copying removed.txt |
| 242 | $(hide) $(ACP) $(ANDROID_TEST_MOCK_OUTPUT_REMOVED_API_FILE) $(ANDROID_TEST_MOCK_REMOVED_API_FILE) |
| 243 | |
| 244 | # Build the android.test.mock.sdk library |
| 245 | # ======================================= |
| 246 | include $(CLEAR_VARS) |
| 247 | |
| 248 | LOCAL_MODULE := android.test.mock.sdk |
| 249 | |
| 250 | LOCAL_STATIC_JAVA_LIBRARIES := android.test.mock.stubs |
| 251 | |
| 252 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Paul Duffin | f747522 | 2017-05-19 09:05:54 +0100 | [diff] [blame] | 253 | |
Brett Chabot | e70f61b | 2010-02-19 10:49:27 -0800 | [diff] [blame] | 254 | # additionally, build unit tests in a separate .apk |
| 255 | include $(call all-makefiles-under,$(LOCAL_PATH)) |