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