blob: ff45fb5e119e8f7bed0c56bd1209480b015f580a [file] [log] [blame]
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -07001#
2# Copyright (C) 2010 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)
18include $(CLEAR_VARS)
19
20LOCAL_MODULE_TAGS := optional
21
22LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
23
Nicholas Sauer234dce92014-10-20 21:54:20 -070024LOCAL_MULTILIB := both
25
Harsh Modife5933d2014-08-12 16:52:16 -070026LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, src)
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070027
Nicholas Sauer90f8a232014-08-17 17:36:53 -070028LOCAL_STATIC_JAVA_LIBRARIES := android-ex-camera2 \
Stuart Scott76f0d6d2015-06-02 08:13:27 -070029 compatibility-common-util-devicesidelib \
Nicholas Sauer90f8a232014-08-17 17:36:53 -070030 cts-sensors-tests \
Sumit Kumare1046842016-03-31 16:09:09 -070031 cts-location-tests \
Nicholas Sauer90f8a232014-08-17 17:36:53 -070032 ctstestrunner \
Raymond054a4412015-03-17 20:51:23 -070033 apache-commons-math \
34 androidplot \
Peng Xuc14f0122015-04-28 18:38:38 -070035 ctsverifier-opencv \
Brian Carlstrom93d57d02016-03-08 22:00:12 -080036 core-tests-support \
Aravind Akelladbc95c52015-06-09 10:22:16 -070037 android-support-v4 \
Guang Zhua21da062016-08-15 14:48:42 -070038 mockito-target-minus-junit4 \
Robin Leeb4be0a92015-06-15 19:13:00 -070039 mockwebserver \
Zoltan Szatmary-Banc87193d2015-06-30 16:23:02 +010040 compatibility-device-util \
Colin Cross64be6352017-01-30 17:03:40 -080041 platform-test-annotations
destradaa65c7cdb2013-10-28 16:36:12 -070042
Paul Duffinde806402017-06-13 16:11:01 +010043LOCAL_JAVA_LIBRARIES := legacy-android-test
44
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070045LOCAL_PACKAGE_NAME := CtsVerifier
46
Timothy Knight48b8f562016-06-20 18:51:05 -070047LOCAL_JNI_SHARED_LIBRARIES := libctsverifier_jni \
48 libaudioloopback_jni \
49 libnativehelper_compat_libc++
Brian Muramatsuaccc6842010-08-11 18:57:27 -070050
Brian Muramatsu3076e742011-08-23 19:37:24 -070051LOCAL_PROGUARD_FLAG_FILES := proguard.flags
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070052
Julia Reynolds0d63e432016-04-25 14:58:12 -040053LOCAL_SDK_VERSION := test_current
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070054
Ying Wang27941062013-07-09 18:01:48 -070055LOCAL_DEX_PREOPT := false
jdesprez6b119e52017-05-04 15:30:11 -070056-include cts/error_prone_rules_tests.mk
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070057include $(BUILD_PACKAGE)
58
Kevin Maf6623502015-10-30 13:22:45 -070059# Build CTS verifier framework as a libary.
60
61include $(CLEAR_VARS)
62
63define java-files-in
64$(sort $(patsubst ./%,%, \
65 $(shell cd $(LOCAL_PATH) ; \
66 find -L $(1) -maxdepth 1 -name *.java -and -not -name ".*") \
67 ))
68endef
69
70LOCAL_MODULE := cts-verifier-framework
71LOCAL_AAPT_FLAGS := --auto-add-overlay --extra-packages android.support.v4
72LOCAL_SDK_VERSION := current
73LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
74LOCAL_SRC_FILES := \
75 $(call java-files-in, src/com/android/cts/verifier) \
Kevin Maf6623502015-10-30 13:22:45 -070076 $(call all-Iaidl-files-under, src)
77
78LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 \
79 compatibility-common-util-devicesidelib \
80 compatibility-device-util \
81
82include $(BUILD_STATIC_JAVA_LIBRARY)
Peng Xuc14f0122015-04-28 18:38:38 -070083
84# opencv library
85include $(CLEAR_VARS)
86
87LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
Peng Xu6133d242015-09-22 21:50:47 -070088 ctsverifier-opencv:libs/opencv3-android.jar
Peng Xuc14f0122015-04-28 18:38:38 -070089
90include $(BUILD_MULTI_PREBUILT)
91
Charles He89bda132017-06-14 13:59:04 +010092pre-installed-apps := \
Suprabh Shukla27e38a62017-09-01 14:39:01 -070093 CtsEmptyDeviceAdmin \
Tony Mak44bd9692018-05-08 18:11:42 +010094 CtsEmptyDeviceOwner \
Charles He89bda132017-06-14 13:59:04 +010095 CtsPermissionApp \
96 NotificationBot
Peng Xuc14f0122015-04-28 18:38:38 -070097
Charles He89bda132017-06-14 13:59:04 +010098other-required-apps := \
Charles He89bda132017-06-14 13:59:04 +010099 CtsVerifierUSBCompanion \
100 CtsVpnFirewallAppApi23 \
101 CtsVpnFirewallAppApi24 \
102 CtsVpnFirewallAppNotAlwaysOn
103
104apps-to-include := \
105 $(pre-installed-apps) \
106 $(other-required-apps)
107
108define apk-location-for
109 $(call intermediates-dir-for,APPS,$(1))/package.apk
110endef
Chris Wren7e1b81a2014-10-24 17:11:08 -0400111
Brian Muramatsuf65e6202010-11-29 16:07:30 -0800112# Builds and launches CTS Verifier on a device.
113.PHONY: cts-verifier
Charles He89bda132017-06-14 13:59:04 +0100114cts-verifier: CtsVerifier adb $(pre-installed-apps)
destradaa9732fb12014-08-15 10:40:50 -0700115 adb install -r $(PRODUCT_OUT)/data/app/CtsVerifier/CtsVerifier.apk \
Charles He89bda132017-06-14 13:59:04 +0100116 $(foreach app,$(pre-installed-apps), \
Tony Mak44bd9692018-05-08 18:11:42 +0100117 && adb install -r -t $(call apk-location-for,$(app))) \
Brian Muramatsuf65e6202010-11-29 16:07:30 -0800118 && adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity"
119
Brian Muramatsu2ddd8052011-08-10 16:55:44 -0700120#
121# Creates a "cts-verifier" directory that will contain:
122#
123# 1. Out directory with a "android-cts-verifier" containing the CTS Verifier
124# and other binaries it needs.
125#
126# 2. Zipped version of the android-cts-verifier directory to be included with
127# the build distribution.
128#
129cts-dir := $(HOST_OUT)/cts-verifier
130verifier-dir-name := android-cts-verifier
131verifier-dir := $(cts-dir)/$(verifier-dir-name)
132verifier-zip-name := $(verifier-dir-name).zip
133verifier-zip := $(cts-dir)/$(verifier-zip-name)
134
Dan Zhanga867e122014-10-24 16:50:22 -0700135# turned off sensor power tests in initial L release
136#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/execute_power_tests.py
137#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/power_monitors/monsoon.py
John Rusnakddf82c12014-08-04 15:49:51 -0700138
destradaa69d7ee22014-08-21 09:29:10 -0700139# Copy the necessary host-side scripts to include in the zip file:
Dan Zhanga867e122014-10-24 16:50:22 -0700140#$(verifier-dir)/power/power_monitors/monsoon.py: cts/apps/CtsVerifier/assets/scripts/power_monitors/monsoon.py | $(ACP)
141# $(hide) mkdir -p $(verifier-dir)/power/power_monitors
142# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/power_monitors/*.py $(verifier-dir)/power/power_monitors/.
143#
144#$(verifier-dir)/power/execute_power_tests.py: cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py | $(ACP)
145# $(hide) mkdir -p $(verifier-dir)/power
146# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py $@
John Rusnakddf82c12014-08-04 15:49:51 -0700147
Brian Muramatsu2ddd8052011-08-10 16:55:44 -0700148cts : $(verifier-zip)
Ruben Brunk370e2432014-10-14 18:33:23 -0700149$(verifier-zip) : $(HOST_OUT)/CameraITS
Charles He89bda132017-06-14 13:59:04 +0100150$(verifier-zip) : $(foreach app,$(apps-to-include),$(call apk-location-for,$(app)))
Brian Muramatsu430a5ea2011-11-17 13:09:44 -0800151$(verifier-zip) : $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk | $(ACP)
Brian Muramatsu2ddd8052011-08-10 16:55:44 -0700152 $(hide) mkdir -p $(verifier-dir)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -0800153 $(hide) $(ACP) -fp $< $(verifier-dir)/CtsVerifier.apk
Charles He89bda132017-06-14 13:59:04 +0100154 $(foreach app,$(apps-to-include), \
155 $(ACP) -fp $(call apk-location-for,$(app)) $(verifier-dir)/$(app).apk;)
Ruben Brunk370e2432014-10-14 18:33:23 -0700156 $(hide) $(ACP) -fpr $(HOST_OUT)/CameraITS $(verifier-dir)
Brian Muramatsu2ddd8052011-08-10 16:55:44 -0700157 $(hide) cd $(cts-dir) && zip -rq $(verifier-dir-name) $(verifier-dir-name)
158
159ifneq ($(filter cts, $(MAKECMDGOALS)),)
160 $(call dist-for-goals, cts, $(verifier-zip):$(verifier-zip-name))
161endif
162
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -0700163include $(call all-makefiles-under,$(LOCAL_PATH))