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 | # Generate the stub source files for android.test.runner.stubs |
| 20 | # ============================================================ |
| 21 | include $(CLEAR_VARS) |
| 22 | |
Paul Duffin | 69516f4 | 2017-11-15 11:39:14 +0000 | [diff] [blame] | 23 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 24 | |
| 25 | LOCAL_JAVA_LIBRARIES := \ |
| 26 | core-oj \ |
| 27 | core-libart \ |
| 28 | framework \ |
| 29 | legacy-test \ |
| 30 | android.test.mock \ |
| 31 | |
| 32 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 33 | LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src |
| 34 | |
| 35 | ANDROID_TEST_RUNNER_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/api.txt |
| 36 | ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/removed.txt |
| 37 | |
| 38 | ANDROID_TEST_RUNNER_API_FILE := $(LOCAL_PATH)/api/android-test-runner-current.txt |
| 39 | ANDROID_TEST_RUNNER_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-runner-removed.txt |
| 40 | |
| 41 | LOCAL_DROIDDOC_OPTIONS:= \ |
| 42 | -stubpackages android.test:android.test.suitebuilder:junit.runner:junit.textui \ |
| 43 | -stubsourceonly \ |
| 44 | -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/src \ |
| 45 | -nodocs \ |
| 46 | -api $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE) \ |
| 47 | -removedApi $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE) \ |
| 48 | |
| 49 | LOCAL_UNINSTALLABLE_MODULE := true |
| 50 | LOCAL_MODULE := android-test-runner-api-stubs-gen |
| 51 | |
| 52 | include $(BUILD_DROIDDOC) |
| 53 | |
| 54 | # Remember the target that will trigger the code generation. |
| 55 | android_test_runner_api_gen_stamp := $(full_target) |
| 56 | |
| 57 | # Add some additional dependencies |
| 58 | $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE): $(full_target) |
| 59 | $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE): $(full_target) |
| 60 | |
| 61 | # Build the android.test.runner.stubs library |
| 62 | # =========================================== |
| 63 | include $(CLEAR_VARS) |
| 64 | |
| 65 | LOCAL_MODULE := android.test.runner.stubs |
| 66 | |
| 67 | LOCAL_JAVA_LIBRARIES := \ |
| 68 | legacy.test.stubs \ |
| 69 | android.test.mock.stubs \ |
| 70 | |
| 71 | LOCAL_SOURCE_FILES_ALL_GENERATED := true |
| 72 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 73 | # Make sure to run droiddoc first to generate the stub source files. |
Colin Cross | b882daa | 2017-09-05 22:59:27 -0700 | [diff] [blame] | 74 | LOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_runner_api_gen_stamp) |
| 75 | |
| 76 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 77 | |
| 78 | # Archive a copy of the classes.jar in SDK build. |
| 79 | $(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.runner.stubs.jar) |
| 80 | |
| 81 | # Check that the android.test.runner.stubs library has not changed |
| 82 | # ================================================================ |
| 83 | |
| 84 | # Check that the API we're building hasn't changed from the not-yet-released |
| 85 | # SDK version. |
| 86 | $(eval $(call check-api, \ |
| 87 | check-android-test-runner-api-current, \ |
| 88 | $(ANDROID_TEST_RUNNER_API_FILE), \ |
| 89 | $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE), \ |
| 90 | $(ANDROID_TEST_RUNNER_REMOVED_API_FILE), \ |
| 91 | $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE), \ |
| 92 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 93 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 94 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 95 | -error 25 -error 26 -error 27, \ |
| 96 | cat $(LOCAL_PATH)/api/apicheck_msg_android_test_runner.txt, \ |
| 97 | check-android-test-runner-api, \ |
| 98 | $(call doc-timestamp-for,android-test-runner-api-stubs-gen) \ |
| 99 | )) |
| 100 | |
| 101 | .PHONY: check-android-test-runner-api |
| 102 | checkapi: check-android-test-runner-api |
| 103 | |
| 104 | .PHONY: update-android-test-runner-api |
| 105 | update-api: update-android-test-runner-api |
| 106 | |
| 107 | update-android-test-runner-api: $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE) | $(ACP) |
| 108 | @echo Copying current.txt |
| 109 | $(hide) $(ACP) $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE) $(ANDROID_TEST_RUNNER_API_FILE) |
| 110 | @echo Copying removed.txt |
| 111 | $(hide) $(ACP) $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE) $(ANDROID_TEST_RUNNER_REMOVED_API_FILE) |