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