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