blob: 9fc70f3972632608e465dc46412548ceabcae01e [file] [log] [blame]
Paul Duffine20f1932016-11-28 15:51:09 +00001#
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
17LOCAL_PATH:= $(call my-dir)
18
Paul Duffin5c993822017-11-16 15:53:09 +000019# Build the android.test.base library
20# ===================================
21# This contains the junit.framework and android.test classes that were in
22# Android API level 25 excluding those from android.test.runner.
23# Also contains the com.android.internal.util.Predicate[s] classes.
24include $(CLEAR_VARS)
25
26LOCAL_SRC_FILES := $(call all-java-files-under, src)
27
28LOCAL_MODULE := android.test.base
29LOCAL_NO_STANDARD_LIBRARIES := true
30LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
31
32include $(BUILD_JAVA_LIBRARY)
33
Paul Duffine20f1932016-11-28 15:51:09 +000034# Build the legacy-test library
35# =============================
Paul Duffin2ffc4ad2017-01-17 14:36:12 +000036# This contains the junit.framework and android.test classes that were in
Paul Duffin4e0c1902017-05-02 13:13:13 +010037# Android API level 25 excluding those from android.test.runner.
Paul Duffinf71d5b52017-05-09 15:52:46 +010038# Also contains the com.android.internal.util.Predicate[s] classes.
Paul Duffine20f1932016-11-28 15:51:09 +000039include $(CLEAR_VARS)
40
Paul Duffindf257602016-11-30 13:29:39 +000041LOCAL_SRC_FILES := $(call all-java-files-under, src)
Paul Duffinf71d5b52017-05-09 15:52:46 +010042
Paul Duffine20f1932016-11-28 15:51:09 +000043LOCAL_MODULE := legacy-test
Paul Duffindf257602016-11-30 13:29:39 +000044LOCAL_NO_STANDARD_LIBRARIES := true
45LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
Paul Duffine20f1932016-11-28 15:51:09 +000046
47include $(BUILD_JAVA_LIBRARY)
Paul Duffin02f42f92016-12-07 14:21:53 +000048
Paul Duffin8eaf94b2017-07-05 09:51:25 +010049# Build the repackaged-legacy-test library
50# ========================================
51# This contains repackaged versions of the classes from legacy-test.
52include $(CLEAR_VARS)
53
54LOCAL_SRC_FILES := $(call all-java-files-under, src)
55
56LOCAL_MODULE := repackaged-legacy-test
57LOCAL_NO_STANDARD_LIBRARIES := true
58LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
59LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
60
61include $(BUILD_STATIC_JAVA_LIBRARY)
62
Paul Duffin5c993822017-11-16 15:53:09 +000063# Build the repackaged.android.test.base library
64# ==============================================
65# This contains repackaged versions of the classes from legacy-test.
66include $(CLEAR_VARS)
67
68LOCAL_SRC_FILES := $(call all-java-files-under, src)
69
70LOCAL_MODULE := repackaged.android.test.base
71LOCAL_NO_STANDARD_LIBRARIES := true
72LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
73LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
74
75include $(BUILD_STATIC_JAVA_LIBRARY)
76
77# Generate the stub source files for android.test.base.stubs
78# ==========================================================
Paul Duffinbacad402017-06-28 11:57:59 +010079include $(CLEAR_VARS)
80
81LOCAL_SRC_FILES := \
82 $(call all-java-files-under, src)
83
84LOCAL_JAVA_LIBRARIES := \
85 core-oj \
86 core-libart \
87 framework \
88
89LOCAL_MODULE_CLASS := JAVA_LIBRARIES
90LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src
91
Paul Duffin5c993822017-11-16 15:53:09 +000092ANDROID_TEST_BASE_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/api.txt
93ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/removed.txt
Paul Duffinbacad402017-06-28 11:57:59 +010094
Paul Duffin5c993822017-11-16 15:53:09 +000095ANDROID_TEST_BASE_API_FILE := $(LOCAL_PATH)/api/android-test-base-current.txt
96ANDROID_TEST_BASE_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-base-removed.txt
Paul Duffinbacad402017-06-28 11:57:59 +010097
98LOCAL_DROIDDOC_OPTIONS:= \
99 -stubpackages android.test:android.test.suitebuilder.annotation:com.android.internal.util:junit.framework \
100 -stubsourceonly \
Paul Duffin5c993822017-11-16 15:53:09 +0000101 -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/src \
Paul Duffinbacad402017-06-28 11:57:59 +0100102 -nodocs \
Paul Duffin5c993822017-11-16 15:53:09 +0000103 -api $(ANDROID_TEST_BASE_OUTPUT_API_FILE) \
104 -removedApi $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE) \
Paul Duffinbacad402017-06-28 11:57:59 +0100105
106LOCAL_UNINSTALLABLE_MODULE := true
Paul Duffin5c993822017-11-16 15:53:09 +0000107LOCAL_MODULE := android-test-base-api-stubs-gen
Paul Duffinbacad402017-06-28 11:57:59 +0100108
109include $(BUILD_DROIDDOC)
110
111# Remember the target that will trigger the code generation.
Paul Duffin5c993822017-11-16 15:53:09 +0000112android_test_base_gen_stamp := $(full_target)
Paul Duffinbacad402017-06-28 11:57:59 +0100113
114# Add some additional dependencies
Paul Duffin5c993822017-11-16 15:53:09 +0000115$(ANDROID_TEST_BASE_OUTPUT_API_FILE): $(full_target)
116$(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE): $(full_target)
Paul Duffinbacad402017-06-28 11:57:59 +0100117
Paul Duffin5c993822017-11-16 15:53:09 +0000118# Build the android.test.base.stubs library
119# =========================================
Paul Duffinbacad402017-06-28 11:57:59 +0100120include $(CLEAR_VARS)
121
Paul Duffin5c993822017-11-16 15:53:09 +0000122LOCAL_MODULE := android.test.base.stubs
Paul Duffinbacad402017-06-28 11:57:59 +0100123
124LOCAL_SOURCE_FILES_ALL_GENERATED := true
Paul Duffind41d8472017-06-30 16:02:09 +0100125LOCAL_SDK_VERSION := current
Paul Duffinbacad402017-06-28 11:57:59 +0100126
Paul Duffinbacad402017-06-28 11:57:59 +0100127# Make sure to run droiddoc first to generate the stub source files.
Paul Duffin5c993822017-11-16 15:53:09 +0000128LOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_base_gen_stamp)
129android_test_base_gen_stamp :=
Colin Cross85ab4062017-09-05 22:59:27 -0700130
131include $(BUILD_STATIC_JAVA_LIBRARY)
Paul Duffinbacad402017-06-28 11:57:59 +0100132
133# Archive a copy of the classes.jar in SDK build.
Paul Duffin5c993822017-11-16 15:53:09 +0000134$(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.base.stubs.jar)
Paul Duffinbacad402017-06-28 11:57:59 +0100135
Paul Duffin5c993822017-11-16 15:53:09 +0000136# Check that the android.test.base.stubs library has not changed
137# ==============================================================
Paul Duffinbacad402017-06-28 11:57:59 +0100138
139# Check that the API we're building hasn't changed from the not-yet-released
140# SDK version.
141$(eval $(call check-api, \
Paul Duffin5c993822017-11-16 15:53:09 +0000142 check-android-test-base-api-current, \
143 $(ANDROID_TEST_BASE_API_FILE), \
144 $(ANDROID_TEST_BASE_OUTPUT_API_FILE), \
145 $(ANDROID_TEST_BASE_REMOVED_API_FILE), \
146 $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE), \
Paul Duffinbacad402017-06-28 11:57:59 +0100147 -error 2 -error 3 -error 4 -error 5 -error 6 \
148 -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
149 -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
150 -error 25 -error 26 -error 27, \
Paul Duffinf779efd2017-11-16 15:47:05 +0000151 cat $(LOCAL_PATH)/api/apicheck_msg_android_test_base.txt, \
Paul Duffin5c993822017-11-16 15:53:09 +0000152 check-android-test-base-api, \
153 $(call doc-timestamp-for,android-test-base-api-stubs-gen) \
Paul Duffinbacad402017-06-28 11:57:59 +0100154 ))
155
Paul Duffin5c993822017-11-16 15:53:09 +0000156.PHONY: check-android-test-base-api
157checkapi: check-android-test-base-api
Paul Duffinbacad402017-06-28 11:57:59 +0100158
Paul Duffin5c993822017-11-16 15:53:09 +0000159.PHONY: update-android-test-base-api
160update-api: update-android-test-base-api
Paul Duffinbacad402017-06-28 11:57:59 +0100161
Paul Duffin5c993822017-11-16 15:53:09 +0000162update-android-test-base-api: $(ANDROID_TEST_BASE_OUTPUT_API_FILE) | $(ACP)
Paul Duffinbacad402017-06-28 11:57:59 +0100163 @echo Copying current.txt
Paul Duffin5c993822017-11-16 15:53:09 +0000164 $(hide) $(ACP) $(ANDROID_TEST_BASE_OUTPUT_API_FILE) $(ANDROID_TEST_BASE_API_FILE)
Paul Duffinbacad402017-06-28 11:57:59 +0100165 @echo Copying removed.txt
Paul Duffin5c993822017-11-16 15:53:09 +0000166 $(hide) $(ACP) $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE) $(ANDROID_TEST_BASE_REMOVED_API_FILE)
Paul Duffinbacad402017-06-28 11:57:59 +0100167
Paul Duffin2ffc4ad2017-01-17 14:36:12 +0000168# Build the legacy-android-test library
Paul Duffinf71d5b52017-05-09 15:52:46 +0100169# =====================================
Paul Duffin4e0c1902017-05-02 13:13:13 +0100170# This contains the android.test classes that were in Android API level 25,
171# including those from android.test.runner.
Paul Duffinf71d5b52017-05-09 15:52:46 +0100172# Also contains the com.android.internal.util.Predicate[s] classes.
Paul Duffin2ffc4ad2017-01-17 14:36:12 +0000173include $(CLEAR_VARS)
174
Paul Duffin4e0c1902017-05-02 13:13:13 +0100175LOCAL_SRC_FILES := \
176 $(call all-java-files-under, src/android) \
Paul Duffinf71d5b52017-05-09 15:52:46 +0100177 $(call all-java-files-under, ../test-runner/src/android) \
Paul Duffine2545262017-11-15 11:39:14 +0000178 $(call all-java-files-under, ../test-mock/src/android) \
Paul Duffinf71d5b52017-05-09 15:52:46 +0100179 $(call all-java-files-under, src/com)
Paul Duffin2ffc4ad2017-01-17 14:36:12 +0000180LOCAL_MODULE := legacy-android-test
181LOCAL_NO_STANDARD_LIBRARIES := true
182LOCAL_JAVA_LIBRARIES := core-oj core-libart framework junit
183
184include $(BUILD_STATIC_JAVA_LIBRARY)
185
Paul Duffin5c993822017-11-16 15:53:09 +0000186# Build the legacy.test.stubs library
187# ===================================
188include $(CLEAR_VARS)
189
190LOCAL_MODULE := legacy.test.stubs
191LOCAL_SDK_VERSION := current
192
193LOCAL_STATIC_JAVA_LIBRARIES := android.test.base.stubs
194
195include $(BUILD_STATIC_JAVA_LIBRARY)
196
Paul Duffin02f42f92016-12-07 14:21:53 +0000197ifeq ($(HOST_OS),linux)
198# Build the legacy-performance-test-hostdex library
199# =================================================
200# This contains the android.test.PerformanceTestCase class only
201include $(CLEAR_VARS)
202
Paul Duffindf257602016-11-30 13:29:39 +0000203LOCAL_SRC_FILES := src/android/test/PerformanceTestCase.java
Paul Duffin02f42f92016-12-07 14:21:53 +0000204LOCAL_MODULE := legacy-performance-test-hostdex
205
Paul Duffinf1c59612017-02-22 11:42:46 +0000206include $(BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY)
Paul Duffin02f42f92016-12-07 14:21:53 +0000207endif # HOST_OS == linux