blob: 861385467a0f5b53fb06af7d68181c6e6234eadd [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 Duffin1f090a82017-12-06 12:43:28 +000019# For unbundled build we'll use the prebuilt jar from prebuilts/sdk.
20ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)))
21
Paul Duffin5c993822017-11-16 15:53:09 +000022# Generate the stub source files for android.test.base.stubs
23# ==========================================================
Paul Duffinbacad402017-06-28 11:57:59 +010024include $(CLEAR_VARS)
25
26LOCAL_SRC_FILES := \
27 $(call all-java-files-under, src)
28
29LOCAL_JAVA_LIBRARIES := \
30 core-oj \
31 core-libart \
32 framework \
33
34LOCAL_MODULE_CLASS := JAVA_LIBRARIES
35LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src
36
Paul Duffin5c993822017-11-16 15:53:09 +000037ANDROID_TEST_BASE_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/api.txt
38ANDROID_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 +010039
Paul Duffin5c993822017-11-16 15:53:09 +000040ANDROID_TEST_BASE_API_FILE := $(LOCAL_PATH)/api/android-test-base-current.txt
41ANDROID_TEST_BASE_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-base-removed.txt
Paul Duffinbacad402017-06-28 11:57:59 +010042
43LOCAL_DROIDDOC_OPTIONS:= \
44 -stubpackages android.test:android.test.suitebuilder.annotation:com.android.internal.util:junit.framework \
45 -stubsourceonly \
Paul Duffin5c993822017-11-16 15:53:09 +000046 -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/src \
Paul Duffinbacad402017-06-28 11:57:59 +010047 -nodocs \
Paul Duffin5c993822017-11-16 15:53:09 +000048 -api $(ANDROID_TEST_BASE_OUTPUT_API_FILE) \
49 -removedApi $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE) \
Paul Duffinbacad402017-06-28 11:57:59 +010050
51LOCAL_UNINSTALLABLE_MODULE := true
Paul Duffin5c993822017-11-16 15:53:09 +000052LOCAL_MODULE := android-test-base-api-stubs-gen
Paul Duffinbacad402017-06-28 11:57:59 +010053
54include $(BUILD_DROIDDOC)
55
56# Remember the target that will trigger the code generation.
Paul Duffin5c993822017-11-16 15:53:09 +000057android_test_base_gen_stamp := $(full_target)
Paul Duffinbacad402017-06-28 11:57:59 +010058
59# Add some additional dependencies
Paul Duffin5c993822017-11-16 15:53:09 +000060$(ANDROID_TEST_BASE_OUTPUT_API_FILE): $(full_target)
61$(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE): $(full_target)
Paul Duffinbacad402017-06-28 11:57:59 +010062
Paul Duffin5c993822017-11-16 15:53:09 +000063# Build the android.test.base.stubs library
64# =========================================
Paul Duffinbacad402017-06-28 11:57:59 +010065include $(CLEAR_VARS)
66
Paul Duffin5c993822017-11-16 15:53:09 +000067LOCAL_MODULE := android.test.base.stubs
Paul Duffinbacad402017-06-28 11:57:59 +010068
69LOCAL_SOURCE_FILES_ALL_GENERATED := true
Paul Duffind41d8472017-06-30 16:02:09 +010070LOCAL_SDK_VERSION := current
Paul Duffinbacad402017-06-28 11:57:59 +010071
Paul Duffinbacad402017-06-28 11:57:59 +010072# Make sure to run droiddoc first to generate the stub source files.
Paul Duffin5c993822017-11-16 15:53:09 +000073LOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_base_gen_stamp)
74android_test_base_gen_stamp :=
Colin Cross85ab4062017-09-05 22:59:27 -070075
76include $(BUILD_STATIC_JAVA_LIBRARY)
Paul Duffinbacad402017-06-28 11:57:59 +010077
78# Archive a copy of the classes.jar in SDK build.
Paul Duffin5c993822017-11-16 15:53:09 +000079$(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.base.stubs.jar)
Paul Duffinbacad402017-06-28 11:57:59 +010080
Paul Duffin5c993822017-11-16 15:53:09 +000081# Check that the android.test.base.stubs library has not changed
82# ==============================================================
Paul Duffinbacad402017-06-28 11:57:59 +010083
84# Check that the API we're building hasn't changed from the not-yet-released
85# SDK version.
86$(eval $(call check-api, \
Paul Duffin5c993822017-11-16 15:53:09 +000087 check-android-test-base-api-current, \
88 $(ANDROID_TEST_BASE_API_FILE), \
89 $(ANDROID_TEST_BASE_OUTPUT_API_FILE), \
90 $(ANDROID_TEST_BASE_REMOVED_API_FILE), \
91 $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE), \
Paul Duffinbacad402017-06-28 11:57:59 +010092 -error 2 -error 3 -error 4 -error 5 -error 6 \
93 -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
94 -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
95 -error 25 -error 26 -error 27, \
Paul Duffinf779efd2017-11-16 15:47:05 +000096 cat $(LOCAL_PATH)/api/apicheck_msg_android_test_base.txt, \
Paul Duffin5c993822017-11-16 15:53:09 +000097 check-android-test-base-api, \
98 $(call doc-timestamp-for,android-test-base-api-stubs-gen) \
Paul Duffinbacad402017-06-28 11:57:59 +010099 ))
100
Paul Duffin5c993822017-11-16 15:53:09 +0000101.PHONY: check-android-test-base-api
102checkapi: check-android-test-base-api
Paul Duffinbacad402017-06-28 11:57:59 +0100103
Paul Duffin5c993822017-11-16 15:53:09 +0000104.PHONY: update-android-test-base-api
105update-api: update-android-test-base-api
Paul Duffinbacad402017-06-28 11:57:59 +0100106
Paul Duffin5c993822017-11-16 15:53:09 +0000107update-android-test-base-api: $(ANDROID_TEST_BASE_OUTPUT_API_FILE) | $(ACP)
Paul Duffinbacad402017-06-28 11:57:59 +0100108 @echo Copying current.txt
Paul Duffin5c993822017-11-16 15:53:09 +0000109 $(hide) $(ACP) $(ANDROID_TEST_BASE_OUTPUT_API_FILE) $(ANDROID_TEST_BASE_API_FILE)
Paul Duffinbacad402017-06-28 11:57:59 +0100110 @echo Copying removed.txt
Paul Duffin5c993822017-11-16 15:53:09 +0000111 $(hide) $(ACP) $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE) $(ANDROID_TEST_BASE_REMOVED_API_FILE)
Paul Duffinbacad402017-06-28 11:57:59 +0100112
Paul Duffin1f090a82017-12-06 12:43:28 +0000113endif # not TARGET_BUILD_APPS not TARGET_BUILD_PDK=true
114
Paul Duffin02f42f92016-12-07 14:21:53 +0000115ifeq ($(HOST_OS),linux)
116# Build the legacy-performance-test-hostdex library
117# =================================================
118# This contains the android.test.PerformanceTestCase class only
119include $(CLEAR_VARS)
120
Paul Duffindf257602016-11-30 13:29:39 +0000121LOCAL_SRC_FILES := src/android/test/PerformanceTestCase.java
Paul Duffin02f42f92016-12-07 14:21:53 +0000122LOCAL_MODULE := legacy-performance-test-hostdex
123
Paul Duffinf1c59612017-02-22 11:42:46 +0000124include $(BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY)
Paul Duffin02f42f92016-12-07 14:21:53 +0000125endif # HOST_OS == linux