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