blob: 924524b7995f14680fc9350d62b376af8292d9bf [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 \
Sander Alewijnse7e24fda2015-03-26 17:41:57 +000029 android-support-v4 \
Nicholas Sauer90f8a232014-08-17 17:36:53 -070030 compatibility-common-util-devicesidelib_v2 \
31 cts-sensors-tests \
32 ctstestrunner \
Raymond054a4412015-03-17 20:51:23 -070033 apache-commons-math \
34 androidplot \
Peng Xuc14f0122015-04-28 18:38:38 -070035 ctsverifier-opencv \
Robin Leeb4be0a92015-06-15 19:13:00 -070036 core-tests \
Aravind Akelladbc95c52015-06-09 10:22:16 -070037 android-support-v4 \
Robin Leeb4be0a92015-06-15 19:13:00 -070038 mockito-target \
39 mockwebserver \
Zoltan Szatmary-Ban01ce4542015-06-22 11:14:47 +010040 compatibility-device-util_v2 \
destradaa65c7cdb2013-10-28 16:36:12 -070041
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070042LOCAL_PACKAGE_NAME := CtsVerifier
43
Daniel Xie032fd6b2015-10-22 15:49:45 -070044LOCAL_AAPT_FLAGS += --version-name "6.0_r1.5 $(BUILD_NUMBER)"
leozwang23740202015-06-02 16:23:00 -070045
Ricardo Garciae908b092015-07-13 19:10:50 -070046LOCAL_JNI_SHARED_LIBRARIES := libctsverifier_jni libaudioloopback_jni
Brian Muramatsuaccc6842010-08-11 18:57:27 -070047
Brian Muramatsu3076e742011-08-23 19:37:24 -070048LOCAL_PROGUARD_FLAG_FILES := proguard.flags
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070049
Nicholas Sauer6bc2a0e2014-07-16 23:04:19 -070050LOCAL_SDK_VERSION := current
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070051
Ying Wang27941062013-07-09 18:01:48 -070052LOCAL_DEX_PREOPT := false
53
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070054include $(BUILD_PACKAGE)
55
Peng Xuc14f0122015-04-28 18:38:38 -070056
57# opencv library
58include $(CLEAR_VARS)
59
60LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
61 ctsverifier-opencv:libs/opencv-android.jar
62
63include $(BUILD_MULTI_PREBUILT)
64
65
Chris Wren7e1b81a2014-10-24 17:11:08 -040066notification-bot := $(call intermediates-dir-for,APPS,NotificationBot)/package.apk
Sudheer Shanka72ba56a2015-07-17 18:30:44 +010067permission-app := $(call intermediates-dir-for,APPS,CtsPermissionApp)/package.apk
Chris Wren7e1b81a2014-10-24 17:11:08 -040068
Brian Muramatsuf65e6202010-11-29 16:07:30 -080069# Builds and launches CTS Verifier on a device.
70.PHONY: cts-verifier
Sudheer Shanka72ba56a2015-07-17 18:30:44 +010071cts-verifier: CtsVerifier adb NotificationBot CtsPermissionApp
destradaa9732fb12014-08-15 10:40:50 -070072 adb install -r $(PRODUCT_OUT)/data/app/CtsVerifier/CtsVerifier.apk \
Chris Wren7e1b81a2014-10-24 17:11:08 -040073 && adb install -r $(notification-bot) \
Sudheer Shanka72ba56a2015-07-17 18:30:44 +010074 && adb install -r $(permission-app) \
Brian Muramatsuf65e6202010-11-29 16:07:30 -080075 && adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity"
76
Brian Muramatsu2ddd8052011-08-10 16:55:44 -070077#
78# Creates a "cts-verifier" directory that will contain:
79#
80# 1. Out directory with a "android-cts-verifier" containing the CTS Verifier
81# and other binaries it needs.
82#
83# 2. Zipped version of the android-cts-verifier directory to be included with
84# the build distribution.
85#
86cts-dir := $(HOST_OUT)/cts-verifier
87verifier-dir-name := android-cts-verifier
88verifier-dir := $(cts-dir)/$(verifier-dir-name)
89verifier-zip-name := $(verifier-dir-name).zip
90verifier-zip := $(cts-dir)/$(verifier-zip-name)
91
Dan Zhanga867e122014-10-24 16:50:22 -070092# turned off sensor power tests in initial L release
93#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/execute_power_tests.py
94#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/power_monitors/monsoon.py
John Rusnakddf82c12014-08-04 15:49:51 -070095
destradaa69d7ee22014-08-21 09:29:10 -070096# Copy the necessary host-side scripts to include in the zip file:
Dan Zhanga867e122014-10-24 16:50:22 -070097#$(verifier-dir)/power/power_monitors/monsoon.py: cts/apps/CtsVerifier/assets/scripts/power_monitors/monsoon.py | $(ACP)
98# $(hide) mkdir -p $(verifier-dir)/power/power_monitors
99# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/power_monitors/*.py $(verifier-dir)/power/power_monitors/.
100#
101#$(verifier-dir)/power/execute_power_tests.py: cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py | $(ACP)
102# $(hide) mkdir -p $(verifier-dir)/power
103# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py $@
John Rusnakddf82c12014-08-04 15:49:51 -0700104
Brian Muramatsu2ddd8052011-08-10 16:55:44 -0700105cts : $(verifier-zip)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -0800106ifeq ($(HOST_OS),linux)
107$(verifier-zip) : $(HOST_OUT)/bin/cts-usb-accessory
108endif
Ruben Brunk370e2432014-10-14 18:33:23 -0700109$(verifier-zip) : $(HOST_OUT)/CameraITS
Chris Wren7e1b81a2014-10-24 17:11:08 -0400110$(verifier-zip) : $(notification-bot)
Sudheer Shanka72ba56a2015-07-17 18:30:44 +0100111$(verifier-zip) : $(permission-app)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -0800112$(verifier-zip) : $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk | $(ACP)
Brian Muramatsu2ddd8052011-08-10 16:55:44 -0700113 $(hide) mkdir -p $(verifier-dir)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -0800114 $(hide) $(ACP) -fp $< $(verifier-dir)/CtsVerifier.apk
Chris Wren7e1b81a2014-10-24 17:11:08 -0400115 $(ACP) -fp $(notification-bot) $(verifier-dir)/NotificationBot.apk
Sudheer Shanka72ba56a2015-07-17 18:30:44 +0100116 $(ACP) -fp $(permission-app) $(verifier-dir)/CtsPermissionApp.apk
Brian Muramatsu430a5ea2011-11-17 13:09:44 -0800117ifeq ($(HOST_OS),linux)
Brian Muramatsudd2bf712011-08-12 12:46:07 -0700118 $(hide) $(ACP) -fp $(HOST_OUT)/bin/cts-usb-accessory $(verifier-dir)/cts-usb-accessory
Brian Muramatsu430a5ea2011-11-17 13:09:44 -0800119endif
Ruben Brunk370e2432014-10-14 18:33:23 -0700120 $(hide) $(ACP) -fpr $(HOST_OUT)/CameraITS $(verifier-dir)
Brian Muramatsu2ddd8052011-08-10 16:55:44 -0700121 $(hide) cd $(cts-dir) && zip -rq $(verifier-dir-name) $(verifier-dir-name)
122
123ifneq ($(filter cts, $(MAKECMDGOALS)),)
124 $(call dist-for-goals, cts, $(verifier-zip):$(verifier-zip-name))
125endif
126
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -0700127include $(call all-makefiles-under,$(LOCAL_PATH))