Brian Muramatsu | 70a9e3f | 2010-06-25 15:27:09 -0700 | [diff] [blame] | 1 | # |
| 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 | |
| 17 | LOCAL_PATH:= $(call my-dir) |
| 18 | include $(CLEAR_VARS) |
| 19 | |
| 20 | LOCAL_MODULE_TAGS := optional |
| 21 | |
| 22 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) |
| 23 | |
Nicholas Sauer | 234dce9 | 2014-10-20 21:54:20 -0700 | [diff] [blame] | 24 | LOCAL_MULTILIB := both |
| 25 | |
Harsh Modi | fe5933d | 2014-08-12 16:52:16 -0700 | [diff] [blame] | 26 | LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, src) |
Brian Muramatsu | 70a9e3f | 2010-06-25 15:27:09 -0700 | [diff] [blame] | 27 | |
Nicholas Sauer | 90f8a23 | 2014-08-17 17:36:53 -0700 | [diff] [blame] | 28 | LOCAL_STATIC_JAVA_LIBRARIES := android-ex-camera2 \ |
Stuart Scott | 76f0d6d | 2015-06-02 08:13:27 -0700 | [diff] [blame] | 29 | compatibility-common-util-devicesidelib \ |
Nicholas Sauer | 90f8a23 | 2014-08-17 17:36:53 -0700 | [diff] [blame] | 30 | cts-sensors-tests \ |
Sumit Kumar | e104684 | 2016-03-31 16:09:09 -0700 | [diff] [blame] | 31 | cts-location-tests \ |
Nicholas Sauer | 90f8a23 | 2014-08-17 17:36:53 -0700 | [diff] [blame] | 32 | ctstestrunner \ |
Raymond | 054a441 | 2015-03-17 20:51:23 -0700 | [diff] [blame] | 33 | apache-commons-math \ |
| 34 | androidplot \ |
Peng Xu | c14f012 | 2015-04-28 18:38:38 -0700 | [diff] [blame] | 35 | ctsverifier-opencv \ |
Brian Carlstrom | 93d57d0 | 2016-03-08 22:00:12 -0800 | [diff] [blame] | 36 | core-tests-support \ |
Aravind Akella | dbc95c5 | 2015-06-09 10:22:16 -0700 | [diff] [blame] | 37 | android-support-v4 \ |
Guang Zhu | a21da06 | 2016-08-15 14:48:42 -0700 | [diff] [blame] | 38 | mockito-target-minus-junit4 \ |
Robin Lee | b4be0a9 | 2015-06-15 19:13:00 -0700 | [diff] [blame] | 39 | mockwebserver \ |
Zoltan Szatmary-Ban | c87193d | 2015-06-30 16:23:02 +0100 | [diff] [blame] | 40 | compatibility-device-util \ |
Colin Cross | 64be635 | 2017-01-30 17:03:40 -0800 | [diff] [blame] | 41 | platform-test-annotations |
destradaa | 65c7cdb | 2013-10-28 16:36:12 -0700 | [diff] [blame] | 42 | |
Paul Duffin | de80640 | 2017-06-13 16:11:01 +0100 | [diff] [blame] | 43 | LOCAL_JAVA_LIBRARIES := legacy-android-test |
| 44 | |
Brian Muramatsu | 70a9e3f | 2010-06-25 15:27:09 -0700 | [diff] [blame] | 45 | LOCAL_PACKAGE_NAME := CtsVerifier |
| 46 | |
Timothy Knight | 48b8f56 | 2016-06-20 18:51:05 -0700 | [diff] [blame] | 47 | LOCAL_JNI_SHARED_LIBRARIES := libctsverifier_jni \ |
| 48 | libaudioloopback_jni \ |
| 49 | libnativehelper_compat_libc++ |
Brian Muramatsu | accc684 | 2010-08-11 18:57:27 -0700 | [diff] [blame] | 50 | |
Brian Muramatsu | 3076e74 | 2011-08-23 19:37:24 -0700 | [diff] [blame] | 51 | LOCAL_PROGUARD_FLAG_FILES := proguard.flags |
Brian Muramatsu | 70a9e3f | 2010-06-25 15:27:09 -0700 | [diff] [blame] | 52 | |
Julia Reynolds | 0d63e43 | 2016-04-25 14:58:12 -0400 | [diff] [blame] | 53 | LOCAL_SDK_VERSION := test_current |
Brian Muramatsu | 70a9e3f | 2010-06-25 15:27:09 -0700 | [diff] [blame] | 54 | |
Ying Wang | 2794106 | 2013-07-09 18:01:48 -0700 | [diff] [blame] | 55 | LOCAL_DEX_PREOPT := false |
jdesprez | 6b119e5 | 2017-05-04 15:30:11 -0700 | [diff] [blame] | 56 | -include cts/error_prone_rules_tests.mk |
Brian Muramatsu | 70a9e3f | 2010-06-25 15:27:09 -0700 | [diff] [blame] | 57 | include $(BUILD_PACKAGE) |
| 58 | |
Kevin Ma | f662350 | 2015-10-30 13:22:45 -0700 | [diff] [blame] | 59 | # Build CTS verifier framework as a libary. |
| 60 | |
| 61 | include $(CLEAR_VARS) |
| 62 | |
| 63 | define java-files-in |
| 64 | $(sort $(patsubst ./%,%, \ |
| 65 | $(shell cd $(LOCAL_PATH) ; \ |
| 66 | find -L $(1) -maxdepth 1 -name *.java -and -not -name ".*") \ |
| 67 | )) |
| 68 | endef |
| 69 | |
| 70 | LOCAL_MODULE := cts-verifier-framework |
| 71 | LOCAL_AAPT_FLAGS := --auto-add-overlay --extra-packages android.support.v4 |
| 72 | LOCAL_SDK_VERSION := current |
| 73 | LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res |
| 74 | LOCAL_SRC_FILES := \ |
| 75 | $(call java-files-in, src/com/android/cts/verifier) \ |
Kevin Ma | f662350 | 2015-10-30 13:22:45 -0700 | [diff] [blame] | 76 | $(call all-Iaidl-files-under, src) |
| 77 | |
| 78 | LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 \ |
| 79 | compatibility-common-util-devicesidelib \ |
| 80 | compatibility-device-util \ |
| 81 | |
| 82 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Peng Xu | c14f012 | 2015-04-28 18:38:38 -0700 | [diff] [blame] | 83 | |
| 84 | # opencv library |
| 85 | include $(CLEAR_VARS) |
| 86 | |
| 87 | LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \ |
Peng Xu | 6133d24 | 2015-09-22 21:50:47 -0700 | [diff] [blame] | 88 | ctsverifier-opencv:libs/opencv3-android.jar |
Peng Xu | c14f012 | 2015-04-28 18:38:38 -0700 | [diff] [blame] | 89 | |
| 90 | include $(BUILD_MULTI_PREBUILT) |
| 91 | |
Charles He | 89bda13 | 2017-06-14 13:59:04 +0100 | [diff] [blame] | 92 | pre-installed-apps := \ |
Suprabh Shukla | 27e38a6 | 2017-09-01 14:39:01 -0700 | [diff] [blame] | 93 | CtsEmptyDeviceAdmin \ |
Tony Mak | 44bd969 | 2018-05-08 18:11:42 +0100 | [diff] [blame] | 94 | CtsEmptyDeviceOwner \ |
Charles He | 89bda13 | 2017-06-14 13:59:04 +0100 | [diff] [blame] | 95 | CtsPermissionApp \ |
| 96 | NotificationBot |
Peng Xu | c14f012 | 2015-04-28 18:38:38 -0700 | [diff] [blame] | 97 | |
Charles He | 89bda13 | 2017-06-14 13:59:04 +0100 | [diff] [blame] | 98 | other-required-apps := \ |
Charles He | 89bda13 | 2017-06-14 13:59:04 +0100 | [diff] [blame] | 99 | CtsVerifierUSBCompanion \ |
| 100 | CtsVpnFirewallAppApi23 \ |
| 101 | CtsVpnFirewallAppApi24 \ |
| 102 | CtsVpnFirewallAppNotAlwaysOn |
| 103 | |
| 104 | apps-to-include := \ |
| 105 | $(pre-installed-apps) \ |
| 106 | $(other-required-apps) |
| 107 | |
| 108 | define apk-location-for |
| 109 | $(call intermediates-dir-for,APPS,$(1))/package.apk |
| 110 | endef |
Chris Wren | 7e1b81a | 2014-10-24 17:11:08 -0400 | [diff] [blame] | 111 | |
Brian Muramatsu | f65e620 | 2010-11-29 16:07:30 -0800 | [diff] [blame] | 112 | # Builds and launches CTS Verifier on a device. |
| 113 | .PHONY: cts-verifier |
Charles He | 89bda13 | 2017-06-14 13:59:04 +0100 | [diff] [blame] | 114 | cts-verifier: CtsVerifier adb $(pre-installed-apps) |
destradaa | 9732fb1 | 2014-08-15 10:40:50 -0700 | [diff] [blame] | 115 | adb install -r $(PRODUCT_OUT)/data/app/CtsVerifier/CtsVerifier.apk \ |
Charles He | 89bda13 | 2017-06-14 13:59:04 +0100 | [diff] [blame] | 116 | $(foreach app,$(pre-installed-apps), \ |
Tony Mak | 44bd969 | 2018-05-08 18:11:42 +0100 | [diff] [blame] | 117 | && adb install -r -t $(call apk-location-for,$(app))) \ |
Brian Muramatsu | f65e620 | 2010-11-29 16:07:30 -0800 | [diff] [blame] | 118 | && adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity" |
| 119 | |
Brian Muramatsu | 2ddd805 | 2011-08-10 16:55:44 -0700 | [diff] [blame] | 120 | # |
| 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 | # |
| 129 | cts-dir := $(HOST_OUT)/cts-verifier |
| 130 | verifier-dir-name := android-cts-verifier |
| 131 | verifier-dir := $(cts-dir)/$(verifier-dir-name) |
| 132 | verifier-zip-name := $(verifier-dir-name).zip |
| 133 | verifier-zip := $(cts-dir)/$(verifier-zip-name) |
| 134 | |
Dan Zhang | a867e12 | 2014-10-24 16:50:22 -0700 | [diff] [blame] | 135 | # 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 Rusnak | ddf82c1 | 2014-08-04 15:49:51 -0700 | [diff] [blame] | 138 | |
destradaa | 69d7ee2 | 2014-08-21 09:29:10 -0700 | [diff] [blame] | 139 | # Copy the necessary host-side scripts to include in the zip file: |
Dan Zhang | a867e12 | 2014-10-24 16:50:22 -0700 | [diff] [blame] | 140 | #$(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 Rusnak | ddf82c1 | 2014-08-04 15:49:51 -0700 | [diff] [blame] | 147 | |
Brian Muramatsu | 2ddd805 | 2011-08-10 16:55:44 -0700 | [diff] [blame] | 148 | cts : $(verifier-zip) |
Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 149 | $(verifier-zip) : $(HOST_OUT)/CameraITS |
Charles He | 89bda13 | 2017-06-14 13:59:04 +0100 | [diff] [blame] | 150 | $(verifier-zip) : $(foreach app,$(apps-to-include),$(call apk-location-for,$(app))) |
Brian Muramatsu | 430a5ea | 2011-11-17 13:09:44 -0800 | [diff] [blame] | 151 | $(verifier-zip) : $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk | $(ACP) |
Brian Muramatsu | 2ddd805 | 2011-08-10 16:55:44 -0700 | [diff] [blame] | 152 | $(hide) mkdir -p $(verifier-dir) |
Brian Muramatsu | 430a5ea | 2011-11-17 13:09:44 -0800 | [diff] [blame] | 153 | $(hide) $(ACP) -fp $< $(verifier-dir)/CtsVerifier.apk |
Charles He | 89bda13 | 2017-06-14 13:59:04 +0100 | [diff] [blame] | 154 | $(foreach app,$(apps-to-include), \ |
| 155 | $(ACP) -fp $(call apk-location-for,$(app)) $(verifier-dir)/$(app).apk;) |
Ruben Brunk | 370e243 | 2014-10-14 18:33:23 -0700 | [diff] [blame] | 156 | $(hide) $(ACP) -fpr $(HOST_OUT)/CameraITS $(verifier-dir) |
Brian Muramatsu | 2ddd805 | 2011-08-10 16:55:44 -0700 | [diff] [blame] | 157 | $(hide) cd $(cts-dir) && zip -rq $(verifier-dir-name) $(verifier-dir-name) |
| 158 | |
| 159 | ifneq ($(filter cts, $(MAKECMDGOALS)),) |
| 160 | $(call dist-for-goals, cts, $(verifier-zip):$(verifier-zip-name)) |
| 161 | endif |
| 162 | |
Brian Muramatsu | 70a9e3f | 2010-06-25 15:27:09 -0700 | [diff] [blame] | 163 | include $(call all-makefiles-under,$(LOCAL_PATH)) |