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 | |
| 66 | LEGACY_TEST_API_FILE := $(LOCAL_PATH)/api/legacy-test-current.txt |
| 67 | LEGACY_TEST_REMOVED_API_FILE := $(LOCAL_PATH)/api/legacy-test-removed.txt |
| 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 |
| 96 | |
| 97 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 98 | |
| 99 | # Make sure to run droiddoc first to generate the stub source files. |
| 100 | $(full_classes_compiled_jar) : $(legacy_test_api_gen_stamp) |
| 101 | $(full_classes_jack) : $(legacy_test_api_gen_stamp) |
| 102 | |
| 103 | # Archive a copy of the classes.jar in SDK build. |
| 104 | $(call dist-for-goals,sdk win_sdk,$(full_classes_jar):legacy.test.stubs.jar) |
| 105 | |
| 106 | # Check that the legacy.test.stubs library has not changed |
| 107 | # ======================================================== |
| 108 | |
| 109 | # Check that the API we're building hasn't changed from the not-yet-released |
| 110 | # SDK version. |
| 111 | $(eval $(call check-api, \ |
| 112 | check-legacy-test-api-current, \ |
| 113 | $(LEGACY_TEST_API_FILE), \ |
| 114 | $(LEGACY_TEST_OUTPUT_API_FILE), \ |
| 115 | $(LEGACY_TEST_REMOVED_API_FILE), \ |
| 116 | $(LEGACY_TEST_OUTPUT_REMOVED_API_FILE), \ |
| 117 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 118 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 119 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 120 | -error 25 -error 26 -error 27, \ |
| 121 | cat $(LOCAL_PATH)/api/apicheck_msg_legacy_test.txt, \ |
| 122 | check-legacy-test-api, \ |
| 123 | $(call doc-timestamp-for,legacy-test-api-stubs-gen) \ |
| 124 | )) |
| 125 | |
| 126 | .PHONY: check-legacy-test-api |
| 127 | checkapi: check-legacy-test-api |
| 128 | |
| 129 | .PHONY: update-legacy-test-api |
| 130 | update-api: update-legacy-test-api |
| 131 | |
| 132 | update-legacy-test-api: $(LEGACY_TEST_OUTPUT_API_FILE) | $(ACP) |
| 133 | @echo Copying current.txt |
| 134 | $(hide) $(ACP) $(LEGACY_TEST_OUTPUT_API_FILE) $(LEGACY_TEST_API_FILE) |
| 135 | @echo Copying removed.txt |
| 136 | $(hide) $(ACP) $(LEGACY_TEST_OUTPUT_REMOVED_API_FILE) $(LEGACY_TEST_REMOVED_API_FILE) |
| 137 | |
Paul Duffin | 2ffc4ad | 2017-01-17 14:36:12 +0000 | [diff] [blame] | 138 | # Build the legacy-android-test library |
Paul Duffin | f71d5b5 | 2017-05-09 15:52:46 +0100 | [diff] [blame] | 139 | # ===================================== |
Paul Duffin | 4e0c190 | 2017-05-02 13:13:13 +0100 | [diff] [blame] | 140 | # This contains the android.test classes that were in Android API level 25, |
| 141 | # including those from android.test.runner. |
Paul Duffin | f71d5b5 | 2017-05-09 15:52:46 +0100 | [diff] [blame] | 142 | # Also contains the com.android.internal.util.Predicate[s] classes. |
Paul Duffin | 2ffc4ad | 2017-01-17 14:36:12 +0000 | [diff] [blame] | 143 | include $(CLEAR_VARS) |
| 144 | |
Paul Duffin | 4e0c190 | 2017-05-02 13:13:13 +0100 | [diff] [blame] | 145 | LOCAL_SRC_FILES := \ |
| 146 | $(call all-java-files-under, src/android) \ |
Paul Duffin | f71d5b5 | 2017-05-09 15:52:46 +0100 | [diff] [blame] | 147 | $(call all-java-files-under, ../test-runner/src/android) \ |
| 148 | $(call all-java-files-under, src/com) |
Paul Duffin | 2ffc4ad | 2017-01-17 14:36:12 +0000 | [diff] [blame] | 149 | LOCAL_MODULE := legacy-android-test |
| 150 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 151 | LOCAL_JAVA_LIBRARIES := core-oj core-libart framework junit |
| 152 | |
| 153 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 154 | |
Paul Duffin | 02f42f9 | 2016-12-07 14:21:53 +0000 | [diff] [blame] | 155 | ifeq ($(HOST_OS),linux) |
| 156 | # Build the legacy-performance-test-hostdex library |
| 157 | # ================================================= |
| 158 | # This contains the android.test.PerformanceTestCase class only |
| 159 | include $(CLEAR_VARS) |
| 160 | |
Paul Duffin | df25760 | 2016-11-30 13:29:39 +0000 | [diff] [blame] | 161 | LOCAL_SRC_FILES := src/android/test/PerformanceTestCase.java |
Paul Duffin | 02f42f9 | 2016-12-07 14:21:53 +0000 | [diff] [blame] | 162 | LOCAL_MODULE := legacy-performance-test-hostdex |
| 163 | |
Paul Duffin | f1c5961 | 2017-02-22 11:42:46 +0000 | [diff] [blame] | 164 | include $(BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY) |
Paul Duffin | 02f42f9 | 2016-12-07 14:21:53 +0000 | [diff] [blame] | 165 | endif # HOST_OS == linux |