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