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