blob: dc5fda5c506da485c4089454e22386a85375b071 [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 \
destradaa65c7cdb2013-10-28 16:36:12 -070033
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070034LOCAL_PACKAGE_NAME := CtsVerifier
35
Eino-Ville Talvala32b5cce2013-06-03 11:25:25 -070036LOCAL_JNI_SHARED_LIBRARIES := libctsverifier_jni \
37 #libcameraanalyzer # Needed for the disabled CameraAnalyzer tests
Brian Muramatsuaccc6842010-08-11 18:57:27 -070038
Brian Muramatsu3076e742011-08-23 19:37:24 -070039LOCAL_PROGUARD_FLAG_FILES := proguard.flags
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070040
Nicholas Sauer6bc2a0e2014-07-16 23:04:19 -070041LOCAL_SDK_VERSION := current
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070042
Ying Wang27941062013-07-09 18:01:48 -070043LOCAL_DEX_PREOPT := false
44
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070045include $(BUILD_PACKAGE)
46
Chris Wren7e1b81a2014-10-24 17:11:08 -040047notification-bot := $(call intermediates-dir-for,APPS,NotificationBot)/package.apk
48
Brian Muramatsuf65e6202010-11-29 16:07:30 -080049# Builds and launches CTS Verifier on a device.
50.PHONY: cts-verifier
Chris Wren7e1b81a2014-10-24 17:11:08 -040051cts-verifier: CtsVerifier adb NotificationBot
destradaa9732fb12014-08-15 10:40:50 -070052 adb install -r $(PRODUCT_OUT)/data/app/CtsVerifier/CtsVerifier.apk \
Chris Wren7e1b81a2014-10-24 17:11:08 -040053 && adb install -r $(notification-bot) \
Brian Muramatsuf65e6202010-11-29 16:07:30 -080054 && adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity"
55
Brian Muramatsu2ddd8052011-08-10 16:55:44 -070056#
57# Creates a "cts-verifier" directory that will contain:
58#
59# 1. Out directory with a "android-cts-verifier" containing the CTS Verifier
60# and other binaries it needs.
61#
62# 2. Zipped version of the android-cts-verifier directory to be included with
63# the build distribution.
64#
65cts-dir := $(HOST_OUT)/cts-verifier
66verifier-dir-name := android-cts-verifier
67verifier-dir := $(cts-dir)/$(verifier-dir-name)
68verifier-zip-name := $(verifier-dir-name).zip
69verifier-zip := $(cts-dir)/$(verifier-zip-name)
70
Dan Zhanga867e122014-10-24 16:50:22 -070071# turned off sensor power tests in initial L release
72#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/execute_power_tests.py
73#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/power_monitors/monsoon.py
John Rusnakddf82c12014-08-04 15:49:51 -070074
destradaa69d7ee22014-08-21 09:29:10 -070075# Copy the necessary host-side scripts to include in the zip file:
Dan Zhanga867e122014-10-24 16:50:22 -070076#$(verifier-dir)/power/power_monitors/monsoon.py: cts/apps/CtsVerifier/assets/scripts/power_monitors/monsoon.py | $(ACP)
77# $(hide) mkdir -p $(verifier-dir)/power/power_monitors
78# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/power_monitors/*.py $(verifier-dir)/power/power_monitors/.
79#
80#$(verifier-dir)/power/execute_power_tests.py: cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py | $(ACP)
81# $(hide) mkdir -p $(verifier-dir)/power
82# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py $@
John Rusnakddf82c12014-08-04 15:49:51 -070083
Brian Muramatsu2ddd8052011-08-10 16:55:44 -070084cts : $(verifier-zip)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080085ifeq ($(HOST_OS),linux)
86$(verifier-zip) : $(HOST_OUT)/bin/cts-usb-accessory
87endif
Ruben Brunk370e2432014-10-14 18:33:23 -070088$(verifier-zip) : $(HOST_OUT)/CameraITS
Chris Wren7e1b81a2014-10-24 17:11:08 -040089$(verifier-zip) : $(notification-bot)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080090$(verifier-zip) : $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk | $(ACP)
Brian Muramatsu2ddd8052011-08-10 16:55:44 -070091 $(hide) mkdir -p $(verifier-dir)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080092 $(hide) $(ACP) -fp $< $(verifier-dir)/CtsVerifier.apk
Chris Wren7e1b81a2014-10-24 17:11:08 -040093 $(ACP) -fp $(notification-bot) $(verifier-dir)/NotificationBot.apk
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080094ifeq ($(HOST_OS),linux)
Brian Muramatsudd2bf712011-08-12 12:46:07 -070095 $(hide) $(ACP) -fp $(HOST_OUT)/bin/cts-usb-accessory $(verifier-dir)/cts-usb-accessory
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080096endif
Ruben Brunk370e2432014-10-14 18:33:23 -070097 $(hide) $(ACP) -fpr $(HOST_OUT)/CameraITS $(verifier-dir)
Brian Muramatsu2ddd8052011-08-10 16:55:44 -070098 $(hide) cd $(cts-dir) && zip -rq $(verifier-dir-name) $(verifier-dir-name)
99
100ifneq ($(filter cts, $(MAKECMDGOALS)),)
101 $(call dist-for-goals, cts, $(verifier-zip):$(verifier-zip-name))
102endif
103
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -0700104include $(call all-makefiles-under,$(LOCAL_PATH))