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 17LOCAL_PATH:= $(call my-dir) 18include $(CLEAR_VARS) 19 20LOCAL_MODULE_TAGS := optional 21 22LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) 23 24LOCAL_MULTILIB := both 25 26LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, src) \ 27 ../ForceStopHelperApp/src/com/android/cts/forcestophelper/Constants.java 28 29LOCAL_AIDL_INCLUDES := \ 30 frameworks/native/aidl/gui 31 32LOCAL_USE_AAPT2 := true 33 34LOCAL_STATIC_JAVA_LIBRARIES := android-ex-camera2 \ 35 compatibility-common-util-devicesidelib \ 36 cts-sensors-tests \ 37 cts-camera-performance-tests \ 38 ctstestrunner-axt \ 39 apache-commons-math \ 40 androidplot \ 41 ctsverifier-opencv \ 42 core-tests-support \ 43 androidx.legacy_legacy-support-v4 \ 44 mockito-target-minus-junit4 \ 45 mockwebserver \ 46 compatibility-device-util-axt \ 47 platform-test-annotations \ 48 cts-security-test-support-library \ 49 cts-midi-lib \ 50 cbor-java 51 52LOCAL_STATIC_ANDROID_LIBRARIES := \ 53 androidx.legacy_legacy-support-v4 54 55LOCAL_JAVA_LIBRARIES += telephony-common 56LOCAL_JAVA_LIBRARIES += android.test.runner.stubs 57LOCAL_JAVA_LIBRARIES += android.test.base.stubs 58LOCAL_JAVA_LIBRARIES += android.test.mock.stubs 59LOCAL_JAVA_LIBRARIES += android.car 60LOCAL_JAVA_LIBRARIES += voip-common 61LOCAL_JAVA_LIBRARIES += truth-prebuilt 62 63LOCAL_PACKAGE_NAME := CtsVerifier 64LOCAL_PRIVATE_PLATFORM_APIS := true 65 66LOCAL_JNI_SHARED_LIBRARIES := \ 67 libctsverifier_jni \ 68 libctsnativemidi_jni \ 69 libaudioloopback_jni \ 70 71LOCAL_PROGUARD_FLAG_FILES := proguard.flags 72 73LOCAL_DEX_PREOPT := false 74-include cts/error_prone_rules_tests.mk 75include $(BUILD_PACKAGE) 76 77# Build CTS verifier framework as a libary. 78 79include $(CLEAR_VARS) 80 81define java-files-in 82$(sort $(patsubst ./%,%, \ 83 $(shell cd $(LOCAL_PATH) ; \ 84 find -L $(1) -maxdepth 1 -name *.java -and -not -name ".*") \ 85 )) 86endef 87 88LOCAL_MODULE := cts-verifier-framework 89LOCAL_AAPT_FLAGS := --auto-add-overlay --extra-packages android.support.v4 90LOCAL_SDK_VERSION := current 91LOCAL_MIN_SDK_VERSION := 19 92LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res 93LOCAL_SRC_FILES := \ 94 $(call java-files-in, src/com/android/cts/verifier) \ 95 $(call all-Iaidl-files-under, src) 96 97LOCAL_STATIC_JAVA_LIBRARIES := androidx.legacy_legacy-support-v4 \ 98 compatibility-common-util-devicesidelib \ 99 compatibility-device-util-axt 100 101include $(BUILD_STATIC_JAVA_LIBRARY) 102 103# opencv library 104include $(CLEAR_VARS) 105 106LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \ 107 ctsverifier-opencv:libs/opencv3-android.jar 108 109include $(BUILD_MULTI_PREBUILT) 110 111pre-installed-apps := \ 112 CtsEmptyDeviceAdmin \ 113 CtsEmptyDeviceOwner \ 114 CtsPermissionApp \ 115 CtsForceStopHelper \ 116 NotificationBot \ 117 CrossProfileTestApp 118 119# Apps to be installed as Instant App using adb install --instant 120pre-installed-instant-app := CtsVerifierInstantApp 121 122other-required-apps := \ 123 CtsVerifierUSBCompanion \ 124 CtsVpnFirewallAppApi23 \ 125 CtsVpnFirewallAppApi24 \ 126 CtsVpnFirewallAppNotAlwaysOn 127 128apps-to-include := \ 129 $(pre-installed-apps) \ 130 $(pre-installed-instant-app) \ 131 $(other-required-apps) 132 133define apk-location-for 134 $(call intermediates-dir-for,APPS,$(1))/package.apk 135endef 136 137# Builds and launches CTS Verifier on a device. 138.PHONY: cts-verifier 139cts-verifier: CtsVerifier adb $(pre-installed-apps) $(pre-installed-instant-app) 140 adb install -r $(PRODUCT_OUT)/data/app/CtsVerifier/CtsVerifier.apk \ 141 $(foreach app,$(pre-installed-apps), \ 142 && adb install -r -t $(call apk-location-for,$(app))) \ 143 && adb install -r --instant $(call apk-location-for,$(pre-installed-instant-app)) \ 144 && adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity" 145 146# 147# Creates a "cts-verifier" directory that will contain: 148# 149# 1. Out directory with a "android-cts-verifier" containing the CTS Verifier 150# and other binaries it needs. 151# 152# 2. Zipped version of the android-cts-verifier directory to be included with 153# the build distribution. 154# 155cts-dir := $(HOST_OUT)/cts-verifier 156verifier-dir-name := android-cts-verifier 157verifier-dir := $(cts-dir)/$(verifier-dir-name) 158verifier-zip-name := $(verifier-dir-name).zip 159verifier-zip := $(cts-dir)/$(verifier-zip-name) 160 161# turned off sensor power tests in initial L release 162#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/execute_power_tests.py 163#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/power_monitors/monsoon.py 164 165# Copy the necessary host-side scripts to include in the zip file: 166#$(verifier-dir)/power/power_monitors/monsoon.py: cts/apps/CtsVerifier/assets/scripts/power_monitors/monsoon.py | $(ACP) 167# $(hide) mkdir -p $(verifier-dir)/power/power_monitors 168# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/power_monitors/*.py $(verifier-dir)/power/power_monitors/. 169# 170#$(verifier-dir)/power/execute_power_tests.py: cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py | $(ACP) 171# $(hide) mkdir -p $(verifier-dir)/power 172# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py $@ 173 174cts : $(verifier-zip) 175$(verifier-zip) : $(HOST_OUT)/CameraITS 176$(verifier-zip) : $(foreach app,$(apps-to-include),$(call apk-location-for,$(app))) 177$(verifier-zip) : $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk | $(ACP) 178 $(hide) mkdir -p $(verifier-dir) 179 $(hide) $(ACP) -fp $< $(verifier-dir)/CtsVerifier.apk 180 $(foreach app,$(apps-to-include), \ 181 $(ACP) -fp $(call apk-location-for,$(app)) $(verifier-dir)/$(app).apk;) 182 $(hide) $(ACP) -fpr $(HOST_OUT)/CameraITS $(verifier-dir) 183 $(hide) cd $(cts-dir) && zip -rq $(verifier-dir-name) $(verifier-dir-name) 184 185$(call dist-for-goals, cts, $(verifier-zip):$(verifier-zip-name)) 186 187include $(call all-makefiles-under,$(LOCAL_PATH)) 188