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