blob: 87f962f322b5c23820bd01b7c0e045ed963443ad [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 \
29 compatibility-common-util-devicesidelib_v2 \
30 cts-sensors-tests \
31 ctstestrunner \
destradaa65c7cdb2013-10-28 16:36:12 -070032
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070033LOCAL_PACKAGE_NAME := CtsVerifier
34
Eino-Ville Talvala32b5cce2013-06-03 11:25:25 -070035LOCAL_JNI_SHARED_LIBRARIES := libctsverifier_jni \
36 #libcameraanalyzer # Needed for the disabled CameraAnalyzer tests
Brian Muramatsuaccc6842010-08-11 18:57:27 -070037
Brian Muramatsu3076e742011-08-23 19:37:24 -070038LOCAL_PROGUARD_FLAG_FILES := proguard.flags
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070039
Nicholas Sauer6bc2a0e2014-07-16 23:04:19 -070040LOCAL_SDK_VERSION := current
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070041
Ying Wang27941062013-07-09 18:01:48 -070042LOCAL_DEX_PREOPT := false
43
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -070044include $(BUILD_PACKAGE)
45
Chris Wren7e1b81a2014-10-24 17:11:08 -040046notification-bot := $(call intermediates-dir-for,APPS,NotificationBot)/package.apk
47
Brian Muramatsuf65e6202010-11-29 16:07:30 -080048# Builds and launches CTS Verifier on a device.
49.PHONY: cts-verifier
Chris Wren7e1b81a2014-10-24 17:11:08 -040050cts-verifier: CtsVerifier adb NotificationBot
destradaa9732fb12014-08-15 10:40:50 -070051 adb install -r $(PRODUCT_OUT)/data/app/CtsVerifier/CtsVerifier.apk \
Chris Wren7e1b81a2014-10-24 17:11:08 -040052 && adb install -r $(notification-bot) \
Brian Muramatsuf65e6202010-11-29 16:07:30 -080053 && adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity"
54
Brian Muramatsu2ddd8052011-08-10 16:55:44 -070055#
56# Creates a "cts-verifier" directory that will contain:
57#
58# 1. Out directory with a "android-cts-verifier" containing the CTS Verifier
59# and other binaries it needs.
60#
61# 2. Zipped version of the android-cts-verifier directory to be included with
62# the build distribution.
63#
64cts-dir := $(HOST_OUT)/cts-verifier
65verifier-dir-name := android-cts-verifier
66verifier-dir := $(cts-dir)/$(verifier-dir-name)
67verifier-zip-name := $(verifier-dir-name).zip
68verifier-zip := $(cts-dir)/$(verifier-zip-name)
69
Dan Zhanga867e122014-10-24 16:50:22 -070070# turned off sensor power tests in initial L release
71#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/execute_power_tests.py
72#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/power_monitors/monsoon.py
John Rusnakddf82c12014-08-04 15:49:51 -070073
destradaa69d7ee22014-08-21 09:29:10 -070074# Copy the necessary host-side scripts to include in the zip file:
Dan Zhanga867e122014-10-24 16:50:22 -070075#$(verifier-dir)/power/power_monitors/monsoon.py: cts/apps/CtsVerifier/assets/scripts/power_monitors/monsoon.py | $(ACP)
76# $(hide) mkdir -p $(verifier-dir)/power/power_monitors
77# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/power_monitors/*.py $(verifier-dir)/power/power_monitors/.
78#
79#$(verifier-dir)/power/execute_power_tests.py: cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py | $(ACP)
80# $(hide) mkdir -p $(verifier-dir)/power
81# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py $@
John Rusnakddf82c12014-08-04 15:49:51 -070082
Brian Muramatsu2ddd8052011-08-10 16:55:44 -070083cts : $(verifier-zip)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080084ifeq ($(HOST_OS),linux)
85$(verifier-zip) : $(HOST_OUT)/bin/cts-usb-accessory
86endif
Ruben Brunk370e2432014-10-14 18:33:23 -070087$(verifier-zip) : $(HOST_OUT)/CameraITS
Chris Wren7e1b81a2014-10-24 17:11:08 -040088$(verifier-zip) : $(notification-bot)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080089$(verifier-zip) : $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk | $(ACP)
Brian Muramatsu2ddd8052011-08-10 16:55:44 -070090 $(hide) mkdir -p $(verifier-dir)
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080091 $(hide) $(ACP) -fp $< $(verifier-dir)/CtsVerifier.apk
Chris Wren7e1b81a2014-10-24 17:11:08 -040092 $(ACP) -fp $(notification-bot) $(verifier-dir)/NotificationBot.apk
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080093ifeq ($(HOST_OS),linux)
Brian Muramatsudd2bf712011-08-12 12:46:07 -070094 $(hide) $(ACP) -fp $(HOST_OUT)/bin/cts-usb-accessory $(verifier-dir)/cts-usb-accessory
Brian Muramatsu430a5ea2011-11-17 13:09:44 -080095endif
Ruben Brunk370e2432014-10-14 18:33:23 -070096 $(hide) $(ACP) -fpr $(HOST_OUT)/CameraITS $(verifier-dir)
Brian Muramatsu2ddd8052011-08-10 16:55:44 -070097 $(hide) cd $(cts-dir) && zip -rq $(verifier-dir-name) $(verifier-dir-name)
98
99ifneq ($(filter cts, $(MAKECMDGOALS)),)
100 $(call dist-for-goals, cts, $(verifier-zip):$(verifier-zip-name))
101endif
102
Brian Muramatsu70a9e3f2010-06-25 15:27:09 -0700103include $(call all-makefiles-under,$(LOCAL_PATH))