Paul Duffin | e20f193 | 2016-11-28 15:51:09 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2016 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 | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 19 | # Build the android.test.base library |
| 20 | # =================================== |
| 21 | # This contains the junit.framework and android.test classes that were in |
| 22 | # Android API level 25 excluding those from android.test.runner. |
| 23 | # Also contains the com.android.internal.util.Predicate[s] classes. |
| 24 | include $(CLEAR_VARS) |
| 25 | |
| 26 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
| 27 | |
| 28 | LOCAL_MODULE := android.test.base |
| 29 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 30 | LOCAL_JAVA_LIBRARIES := core-oj core-libart framework |
| 31 | |
| 32 | include $(BUILD_JAVA_LIBRARY) |
| 33 | |
Paul Duffin | e20f193 | 2016-11-28 15:51:09 +0000 | [diff] [blame] | 34 | # Build the legacy-test library |
| 35 | # ============================= |
Paul Duffin | 2ffc4ad | 2017-01-17 14:36:12 +0000 | [diff] [blame] | 36 | # This contains the junit.framework and android.test classes that were in |
Paul Duffin | 4e0c190 | 2017-05-02 13:13:13 +0100 | [diff] [blame] | 37 | # Android API level 25 excluding those from android.test.runner. |
Paul Duffin | f71d5b5 | 2017-05-09 15:52:46 +0100 | [diff] [blame] | 38 | # Also contains the com.android.internal.util.Predicate[s] classes. |
Paul Duffin | e20f193 | 2016-11-28 15:51:09 +0000 | [diff] [blame] | 39 | include $(CLEAR_VARS) |
| 40 | |
Paul Duffin | df25760 | 2016-11-30 13:29:39 +0000 | [diff] [blame] | 41 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
Paul Duffin | f71d5b5 | 2017-05-09 15:52:46 +0100 | [diff] [blame] | 42 | |
Paul Duffin | e20f193 | 2016-11-28 15:51:09 +0000 | [diff] [blame] | 43 | LOCAL_MODULE := legacy-test |
Paul Duffin | df25760 | 2016-11-30 13:29:39 +0000 | [diff] [blame] | 44 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 45 | LOCAL_JAVA_LIBRARIES := core-oj core-libart framework |
Paul Duffin | e20f193 | 2016-11-28 15:51:09 +0000 | [diff] [blame] | 46 | |
| 47 | include $(BUILD_JAVA_LIBRARY) |
Paul Duffin | 02f42f9 | 2016-12-07 14:21:53 +0000 | [diff] [blame] | 48 | |
Paul Duffin | 8eaf94b | 2017-07-05 09:51:25 +0100 | [diff] [blame] | 49 | # Build the repackaged-legacy-test library |
| 50 | # ======================================== |
| 51 | # This contains repackaged versions of the classes from legacy-test. |
| 52 | include $(CLEAR_VARS) |
| 53 | |
| 54 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
| 55 | |
| 56 | LOCAL_MODULE := repackaged-legacy-test |
| 57 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 58 | LOCAL_JAVA_LIBRARIES := core-oj core-libart framework |
| 59 | LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt |
| 60 | |
| 61 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 62 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 63 | # Build the repackaged.android.test.base library |
| 64 | # ============================================== |
| 65 | # This contains repackaged versions of the classes from legacy-test. |
| 66 | include $(CLEAR_VARS) |
| 67 | |
| 68 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
| 69 | |
| 70 | LOCAL_MODULE := repackaged.android.test.base |
| 71 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 72 | LOCAL_JAVA_LIBRARIES := core-oj core-libart framework |
| 73 | LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt |
| 74 | |
| 75 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 76 | |
| 77 | # Generate the stub source files for android.test.base.stubs |
| 78 | # ========================================================== |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 79 | include $(CLEAR_VARS) |
| 80 | |
| 81 | LOCAL_SRC_FILES := \ |
| 82 | $(call all-java-files-under, src) |
| 83 | |
| 84 | LOCAL_JAVA_LIBRARIES := \ |
| 85 | core-oj \ |
| 86 | core-libart \ |
| 87 | framework \ |
| 88 | |
| 89 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 90 | LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src |
| 91 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 92 | ANDROID_TEST_BASE_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/api.txt |
| 93 | ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/removed.txt |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 94 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 95 | ANDROID_TEST_BASE_API_FILE := $(LOCAL_PATH)/api/android-test-base-current.txt |
| 96 | ANDROID_TEST_BASE_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-base-removed.txt |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 97 | |
| 98 | LOCAL_DROIDDOC_OPTIONS:= \ |
| 99 | -stubpackages android.test:android.test.suitebuilder.annotation:com.android.internal.util:junit.framework \ |
| 100 | -stubsourceonly \ |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 101 | -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/src \ |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 102 | -nodocs \ |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 103 | -api $(ANDROID_TEST_BASE_OUTPUT_API_FILE) \ |
| 104 | -removedApi $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE) \ |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 105 | |
| 106 | LOCAL_UNINSTALLABLE_MODULE := true |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 107 | LOCAL_MODULE := android-test-base-api-stubs-gen |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 108 | |
| 109 | include $(BUILD_DROIDDOC) |
| 110 | |
| 111 | # Remember the target that will trigger the code generation. |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 112 | android_test_base_gen_stamp := $(full_target) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 113 | |
| 114 | # Add some additional dependencies |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 115 | $(ANDROID_TEST_BASE_OUTPUT_API_FILE): $(full_target) |
| 116 | $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE): $(full_target) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 117 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 118 | # Build the android.test.base.stubs library |
| 119 | # ========================================= |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 120 | include $(CLEAR_VARS) |
| 121 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 122 | LOCAL_MODULE := android.test.base.stubs |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 123 | |
| 124 | LOCAL_SOURCE_FILES_ALL_GENERATED := true |
Paul Duffin | d41d847 | 2017-06-30 16:02:09 +0100 | [diff] [blame] | 125 | LOCAL_SDK_VERSION := current |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 126 | |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 127 | # Make sure to run droiddoc first to generate the stub source files. |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 128 | LOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_base_gen_stamp) |
| 129 | android_test_base_gen_stamp := |
Colin Cross | 85ab406 | 2017-09-05 22:59:27 -0700 | [diff] [blame] | 130 | |
| 131 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 132 | |
| 133 | # Archive a copy of the classes.jar in SDK build. |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 134 | $(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.base.stubs.jar) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 135 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 136 | # Check that the android.test.base.stubs library has not changed |
| 137 | # ============================================================== |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 138 | |
| 139 | # Check that the API we're building hasn't changed from the not-yet-released |
| 140 | # SDK version. |
| 141 | $(eval $(call check-api, \ |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 142 | check-android-test-base-api-current, \ |
| 143 | $(ANDROID_TEST_BASE_API_FILE), \ |
| 144 | $(ANDROID_TEST_BASE_OUTPUT_API_FILE), \ |
| 145 | $(ANDROID_TEST_BASE_REMOVED_API_FILE), \ |
| 146 | $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE), \ |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 147 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 148 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 149 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 150 | -error 25 -error 26 -error 27, \ |
Paul Duffin | f779efd | 2017-11-16 15:47:05 +0000 | [diff] [blame] | 151 | cat $(LOCAL_PATH)/api/apicheck_msg_android_test_base.txt, \ |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 152 | check-android-test-base-api, \ |
| 153 | $(call doc-timestamp-for,android-test-base-api-stubs-gen) \ |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 154 | )) |
| 155 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 156 | .PHONY: check-android-test-base-api |
| 157 | checkapi: check-android-test-base-api |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 158 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 159 | .PHONY: update-android-test-base-api |
| 160 | update-api: update-android-test-base-api |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 161 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 162 | update-android-test-base-api: $(ANDROID_TEST_BASE_OUTPUT_API_FILE) | $(ACP) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 163 | @echo Copying current.txt |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 164 | $(hide) $(ACP) $(ANDROID_TEST_BASE_OUTPUT_API_FILE) $(ANDROID_TEST_BASE_API_FILE) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 165 | @echo Copying removed.txt |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 166 | $(hide) $(ACP) $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE) $(ANDROID_TEST_BASE_REMOVED_API_FILE) |
Paul Duffin | bacad40 | 2017-06-28 11:57:59 +0100 | [diff] [blame] | 167 | |
Paul Duffin | 2ffc4ad | 2017-01-17 14:36:12 +0000 | [diff] [blame] | 168 | # Build the legacy-android-test library |
Paul Duffin | f71d5b5 | 2017-05-09 15:52:46 +0100 | [diff] [blame] | 169 | # ===================================== |
Paul Duffin | 4e0c190 | 2017-05-02 13:13:13 +0100 | [diff] [blame] | 170 | # This contains the android.test classes that were in Android API level 25, |
| 171 | # including those from android.test.runner. |
Paul Duffin | f71d5b5 | 2017-05-09 15:52:46 +0100 | [diff] [blame] | 172 | # Also contains the com.android.internal.util.Predicate[s] classes. |
Paul Duffin | 2ffc4ad | 2017-01-17 14:36:12 +0000 | [diff] [blame] | 173 | include $(CLEAR_VARS) |
| 174 | |
Paul Duffin | 4e0c190 | 2017-05-02 13:13:13 +0100 | [diff] [blame] | 175 | LOCAL_SRC_FILES := \ |
| 176 | $(call all-java-files-under, src/android) \ |
Paul Duffin | f71d5b5 | 2017-05-09 15:52:46 +0100 | [diff] [blame] | 177 | $(call all-java-files-under, ../test-runner/src/android) \ |
Paul Duffin | e254526 | 2017-11-15 11:39:14 +0000 | [diff] [blame] | 178 | $(call all-java-files-under, ../test-mock/src/android) \ |
Paul Duffin | f71d5b5 | 2017-05-09 15:52:46 +0100 | [diff] [blame] | 179 | $(call all-java-files-under, src/com) |
Paul Duffin | 2ffc4ad | 2017-01-17 14:36:12 +0000 | [diff] [blame] | 180 | LOCAL_MODULE := legacy-android-test |
| 181 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 182 | LOCAL_JAVA_LIBRARIES := core-oj core-libart framework junit |
| 183 | |
| 184 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 185 | |
Paul Duffin | 5c99382 | 2017-11-16 15:53:09 +0000 | [diff] [blame] | 186 | # Build the legacy.test.stubs library |
| 187 | # =================================== |
| 188 | include $(CLEAR_VARS) |
| 189 | |
| 190 | LOCAL_MODULE := legacy.test.stubs |
| 191 | LOCAL_SDK_VERSION := current |
| 192 | |
| 193 | LOCAL_STATIC_JAVA_LIBRARIES := android.test.base.stubs |
| 194 | |
| 195 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 196 | |
Paul Duffin | 02f42f9 | 2016-12-07 14:21:53 +0000 | [diff] [blame] | 197 | ifeq ($(HOST_OS),linux) |
| 198 | # Build the legacy-performance-test-hostdex library |
| 199 | # ================================================= |
| 200 | # This contains the android.test.PerformanceTestCase class only |
| 201 | include $(CLEAR_VARS) |
| 202 | |
Paul Duffin | df25760 | 2016-11-30 13:29:39 +0000 | [diff] [blame] | 203 | LOCAL_SRC_FILES := src/android/test/PerformanceTestCase.java |
Paul Duffin | 02f42f9 | 2016-12-07 14:21:53 +0000 | [diff] [blame] | 204 | LOCAL_MODULE := legacy-performance-test-hostdex |
| 205 | |
Paul Duffin | f1c5961 | 2017-02-22 11:42:46 +0000 | [diff] [blame] | 206 | include $(BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY) |
Paul Duffin | 02f42f9 | 2016-12-07 14:21:53 +0000 | [diff] [blame] | 207 | endif # HOST_OS == linux |