blob: ef2950b2f026a31e19d798a15ac55f29c29f7147 [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
19# Build the legacy-test library
20# =============================
Paul Duffin2ffc4ad2017-01-17 14:36:12 +000021# This contains the junit.framework and android.test classes that were in
Paul Duffin4e0c1902017-05-02 13:13:13 +010022# Android API level 25 excluding those from android.test.runner.
Paul Duffinf71d5b52017-05-09 15:52:46 +010023# Also contains the com.android.internal.util.Predicate[s] classes.
Paul Duffine20f1932016-11-28 15:51:09 +000024include $(CLEAR_VARS)
25
Paul Duffindf257602016-11-30 13:29:39 +000026LOCAL_SRC_FILES := $(call all-java-files-under, src)
Paul Duffinf71d5b52017-05-09 15:52:46 +010027
Paul Duffine20f1932016-11-28 15:51:09 +000028LOCAL_MODULE := legacy-test
Paul Duffindf257602016-11-30 13:29:39 +000029LOCAL_NO_STANDARD_LIBRARIES := true
30LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
Paul Duffine20f1932016-11-28 15:51:09 +000031
32include $(BUILD_JAVA_LIBRARY)
Paul Duffin02f42f92016-12-07 14:21:53 +000033
Paul Duffin8eaf94b2017-07-05 09:51:25 +010034# Build the repackaged-legacy-test library
35# ========================================
36# This contains repackaged versions of the classes from legacy-test.
37include $(CLEAR_VARS)
38
39LOCAL_SRC_FILES := $(call all-java-files-under, src)
40
41LOCAL_MODULE := repackaged-legacy-test
42LOCAL_NO_STANDARD_LIBRARIES := true
43LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
44LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
45
46include $(BUILD_STATIC_JAVA_LIBRARY)
47
Paul Duffinbacad402017-06-28 11:57:59 +010048# Generate the stub source files for legacy.test.stubs
49# ====================================================
50include $(CLEAR_VARS)
51
52LOCAL_SRC_FILES := \
53 $(call all-java-files-under, src)
54
55LOCAL_JAVA_LIBRARIES := \
56 core-oj \
57 core-libart \
58 framework \
59
60LOCAL_MODULE_CLASS := JAVA_LIBRARIES
61LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src
62
63LEGACY_TEST_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/legacy.test.stubs_intermediates/api.txt
64LEGACY_TEST_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/legacy.test.stubs_intermediates/removed.txt
65
66LEGACY_TEST_API_FILE := $(LOCAL_PATH)/api/legacy-test-current.txt
67LEGACY_TEST_REMOVED_API_FILE := $(LOCAL_PATH)/api/legacy-test-removed.txt
68
69LOCAL_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
77LOCAL_UNINSTALLABLE_MODULE := true
78LOCAL_MODULE := legacy-test-api-stubs-gen
79
80include $(BUILD_DROIDDOC)
81
82# Remember the target that will trigger the code generation.
83legacy_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# ===================================
91include $(CLEAR_VARS)
92
93LOCAL_MODULE := legacy.test.stubs
94
95LOCAL_SOURCE_FILES_ALL_GENERATED := true
96
97include $(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
127checkapi: check-legacy-test-api
128
129.PHONY: update-legacy-test-api
130update-api: update-legacy-test-api
131
132update-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 Duffin2ffc4ad2017-01-17 14:36:12 +0000138# Build the legacy-android-test library
Paul Duffinf71d5b52017-05-09 15:52:46 +0100139# =====================================
Paul Duffin4e0c1902017-05-02 13:13:13 +0100140# This contains the android.test classes that were in Android API level 25,
141# including those from android.test.runner.
Paul Duffinf71d5b52017-05-09 15:52:46 +0100142# Also contains the com.android.internal.util.Predicate[s] classes.
Paul Duffin2ffc4ad2017-01-17 14:36:12 +0000143include $(CLEAR_VARS)
144
Paul Duffin4e0c1902017-05-02 13:13:13 +0100145LOCAL_SRC_FILES := \
146 $(call all-java-files-under, src/android) \
Paul Duffinf71d5b52017-05-09 15:52:46 +0100147 $(call all-java-files-under, ../test-runner/src/android) \
148 $(call all-java-files-under, src/com)
Paul Duffin2ffc4ad2017-01-17 14:36:12 +0000149LOCAL_MODULE := legacy-android-test
150LOCAL_NO_STANDARD_LIBRARIES := true
151LOCAL_JAVA_LIBRARIES := core-oj core-libart framework junit
152
153include $(BUILD_STATIC_JAVA_LIBRARY)
154
Paul Duffin02f42f92016-12-07 14:21:53 +0000155ifeq ($(HOST_OS),linux)
156# Build the legacy-performance-test-hostdex library
157# =================================================
158# This contains the android.test.PerformanceTestCase class only
159include $(CLEAR_VARS)
160
Paul Duffindf257602016-11-30 13:29:39 +0000161LOCAL_SRC_FILES := src/android/test/PerformanceTestCase.java
Paul Duffin02f42f92016-12-07 14:21:53 +0000162LOCAL_MODULE := legacy-performance-test-hostdex
163
Paul Duffinf1c59612017-02-22 11:42:46 +0000164include $(BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY)
Paul Duffin02f42f92016-12-07 14:21:53 +0000165endif # HOST_OS == linux