blob: 87fe83127e2c877356bd8f4fdc1c24b4d9763148 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001#
2# Copyright (C) 2008 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 Duffinf7475222017-05-19 09:05:54 +010019# Build the android.test.runner library
20# =====================================
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021include $(CLEAR_VARS)
22
Paul Duffine2545262017-11-15 11:39:14 +000023LOCAL_SRC_FILES := $(call all-java-files-under, src)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024
Paul Duffin855d7022017-07-10 15:16:07 +010025LOCAL_JAVA_LIBRARIES := \
26 core-oj \
27 core-libart \
28 framework \
Paul Duffin5c993822017-11-16 15:53:09 +000029 android.test.base \
Paul Duffin855d7022017-07-10 15:16:07 +010030 android.test.mock \
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031
32LOCAL_MODULE:= android.test.runner
33
34include $(BUILD_JAVA_LIBRARY)
Brett Chabote70f61b2010-02-19 10:49:27 -080035
Paul Duffin8eaf94b2017-07-05 09:51:25 +010036# Build the repackaged.android.test.runner library
37# ================================================
38include $(CLEAR_VARS)
39
40LOCAL_SRC_FILES := $(call all-java-files-under, src)
41
Paul Duffine2545262017-11-15 11:39:14 +000042LOCAL_JAVA_LIBRARIES := \
43 core-oj \
44 core-libart \
45 framework \
Paul Duffin5c993822017-11-16 15:53:09 +000046 android.test.base \
Paul Duffine2545262017-11-15 11:39:14 +000047 android.test.mock \
Paul Duffin8eaf94b2017-07-05 09:51:25 +010048
Paul Duffinf779efd2017-11-16 15:47:05 +000049LOCAL_JARJAR_RULES := $(LOCAL_PATH)/../test-base/jarjar-rules.txt
Paul Duffin8eaf94b2017-07-05 09:51:25 +010050
51LOCAL_MODULE:= repackaged.android.test.runner
52
53include $(BUILD_STATIC_JAVA_LIBRARY)
54
Paul Duffine1446022017-11-07 07:33:11 +000055# For unbundled build we'll use the prebuilt jar from prebuilts/sdk.
56ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)))
57
Paul Duffinbacad402017-06-28 11:57:59 +010058# Generate the stub source files for android.test.runner.stubs
59# ============================================================
60include $(CLEAR_VARS)
61
Paul Duffine2545262017-11-15 11:39:14 +000062LOCAL_SRC_FILES := $(call all-java-files-under, src)
Paul Duffinbacad402017-06-28 11:57:59 +010063
64LOCAL_JAVA_LIBRARIES := \
65 core-oj \
66 core-libart \
67 framework \
Paul Duffin5c993822017-11-16 15:53:09 +000068 android.test.base \
Paul Duffinbacad402017-06-28 11:57:59 +010069 android.test.mock \
70
71LOCAL_MODULE_CLASS := JAVA_LIBRARIES
72LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src
73
74ANDROID_TEST_RUNNER_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/api.txt
75ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/removed.txt
76
77ANDROID_TEST_RUNNER_API_FILE := $(LOCAL_PATH)/api/android-test-runner-current.txt
78ANDROID_TEST_RUNNER_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-runner-removed.txt
79
80LOCAL_DROIDDOC_OPTIONS:= \
81 -stubpackages android.test:android.test.suitebuilder:junit.runner:junit.textui \
82 -stubsourceonly \
83 -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/src \
84 -nodocs \
85 -api $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE) \
86 -removedApi $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE) \
87
88LOCAL_UNINSTALLABLE_MODULE := true
89LOCAL_MODULE := android-test-runner-api-stubs-gen
90
91include $(BUILD_DROIDDOC)
92
93# Remember the target that will trigger the code generation.
94android_test_runner_api_gen_stamp := $(full_target)
95
96# Add some additional dependencies
97$(ANDROID_TEST_RUNNER_OUTPUT_API_FILE): $(full_target)
98$(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE): $(full_target)
99
100# Build the android.test.runner.stubs library
101# ===========================================
102include $(CLEAR_VARS)
103
104LOCAL_MODULE := android.test.runner.stubs
105
106LOCAL_JAVA_LIBRARIES := \
Paul Duffin5c993822017-11-16 15:53:09 +0000107 android.test.base.stubs \
Paul Duffinbacad402017-06-28 11:57:59 +0100108 android.test.mock.stubs \
109
110LOCAL_SOURCE_FILES_ALL_GENERATED := true
Paul Duffind41d8472017-06-30 16:02:09 +0100111LOCAL_SDK_VERSION := current
Paul Duffinbacad402017-06-28 11:57:59 +0100112
Paul Duffinbacad402017-06-28 11:57:59 +0100113# Make sure to run droiddoc first to generate the stub source files.
Colin Cross85ab4062017-09-05 22:59:27 -0700114LOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_runner_api_gen_stamp)
Paul Duffind41d8472017-06-30 16:02:09 +0100115android_test_runner_api_gen_stamp :=
Colin Cross85ab4062017-09-05 22:59:27 -0700116
117include $(BUILD_STATIC_JAVA_LIBRARY)
Paul Duffinbacad402017-06-28 11:57:59 +0100118
119# Archive a copy of the classes.jar in SDK build.
120$(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.runner.stubs.jar)
121
122# Check that the android.test.runner.stubs library has not changed
123# ================================================================
124
125# Check that the API we're building hasn't changed from the not-yet-released
126# SDK version.
127$(eval $(call check-api, \
128 check-android-test-runner-api-current, \
129 $(ANDROID_TEST_RUNNER_API_FILE), \
130 $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE), \
131 $(ANDROID_TEST_RUNNER_REMOVED_API_FILE), \
132 $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE), \
133 -error 2 -error 3 -error 4 -error 5 -error 6 \
134 -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
135 -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
136 -error 25 -error 26 -error 27, \
137 cat $(LOCAL_PATH)/api/apicheck_msg_android_test_runner.txt, \
138 check-android-test-runner-api, \
139 $(call doc-timestamp-for,android-test-runner-api-stubs-gen) \
140 ))
141
142.PHONY: check-android-test-runner-api
143checkapi: check-android-test-runner-api
144
145.PHONY: update-android-test-runner-api
146update-api: update-android-test-runner-api
147
148update-android-test-runner-api: $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE) | $(ACP)
149 @echo Copying current.txt
150 $(hide) $(ACP) $(ANDROID_TEST_RUNNER_OUTPUT_API_FILE) $(ANDROID_TEST_RUNNER_API_FILE)
151 @echo Copying removed.txt
152 $(hide) $(ACP) $(ANDROID_TEST_RUNNER_OUTPUT_REMOVED_API_FILE) $(ANDROID_TEST_RUNNER_REMOVED_API_FILE)
153
Paul Duffine1446022017-11-07 07:33:11 +0000154endif # not TARGET_BUILD_APPS not TARGET_BUILD_PDK=true