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 28LOCAL_STATIC_JAVA_LIBRARIES := android-ex-camera2 \ 29 compatibility-common-util-devicesidelib \ 30 cts-sensors-tests \ 31 cts-location-tests \ 32 ctstestrunner \ 33 apache-commons-math \ 34 androidplot \ 35 ctsverifier-opencv \ 36 core-tests-support \ 37 android-support-v4 \ 38 mockito-target-minus-junit4 \ 39 mockwebserver \ 40 compatibility-device-util \ 41 platform-test-annotations 42 43LOCAL_PACKAGE_NAME := CtsVerifier 44 45LOCAL_JNI_SHARED_LIBRARIES := libctsverifier_jni \ 46 libaudioloopback_jni \ 47 libnativehelper_compat_libc++ 48 49LOCAL_PROGUARD_FLAG_FILES := proguard.flags 50 51LOCAL_SDK_VERSION := test_current 52 53LOCAL_DEX_PREOPT := false 54 55include $(BUILD_PACKAGE) 56 57# Build CTS verifier framework as a libary. 58 59include $(CLEAR_VARS) 60 61define java-files-in 62$(sort $(patsubst ./%,%, \ 63 $(shell cd $(LOCAL_PATH) ; \ 64 find -L $(1) -maxdepth 1 -name *.java -and -not -name ".*") \ 65 )) 66endef 67 68LOCAL_MODULE := cts-verifier-framework 69LOCAL_AAPT_FLAGS := --auto-add-overlay --extra-packages android.support.v4 70LOCAL_SDK_VERSION := current 71LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res 72LOCAL_SRC_FILES := \ 73 $(call java-files-in, src/com/android/cts/verifier) \ 74 $(call java-files-in, src/com/android/cts/verifier/backup) \ 75 $(call all-Iaidl-files-under, src) 76 77LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 \ 78 compatibility-common-util-devicesidelib \ 79 compatibility-device-util \ 80 81include $(BUILD_STATIC_JAVA_LIBRARY) 82 83# opencv library 84include $(CLEAR_VARS) 85 86LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \ 87 ctsverifier-opencv:libs/opencv3-android.jar 88 89include $(BUILD_MULTI_PREBUILT) 90 91 92notification-bot := $(call intermediates-dir-for,APPS,NotificationBot)/package.apk 93permission-app := $(call intermediates-dir-for,APPS,CtsPermissionApp)/package.apk 94usb-companion := $(call intermediates-dir-for,APPS,CtsVerifierUSBCompanion)/package.apk 95empty-device-admin := $(call intermediates-dir-for,APPS,CtsEmptyDeviceAdmin)/package.apk 96 97# Builds and launches CTS Verifier on a device. 98.PHONY: cts-verifier 99cts-verifier: CtsVerifier adb NotificationBot CtsPermissionApp 100 adb install -r $(PRODUCT_OUT)/data/app/CtsVerifier/CtsVerifier.apk \ 101 && adb install -r $(notification-bot) \ 102 && adb install -r $(permission-app) \ 103 && adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity" 104 105# 106# Creates a "cts-verifier" directory that will contain: 107# 108# 1. Out directory with a "android-cts-verifier" containing the CTS Verifier 109# and other binaries it needs. 110# 111# 2. Zipped version of the android-cts-verifier directory to be included with 112# the build distribution. 113# 114cts-dir := $(HOST_OUT)/cts-verifier 115verifier-dir-name := android-cts-verifier 116verifier-dir := $(cts-dir)/$(verifier-dir-name) 117verifier-zip-name := $(verifier-dir-name).zip 118verifier-zip := $(cts-dir)/$(verifier-zip-name) 119 120# turned off sensor power tests in initial L release 121#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/execute_power_tests.py 122#$(PRODUCT_OUT)/data/app/CtsVerifier.apk $(verifier-zip): $(verifier-dir)/power/power_monitors/monsoon.py 123 124# Copy the necessary host-side scripts to include in the zip file: 125#$(verifier-dir)/power/power_monitors/monsoon.py: cts/apps/CtsVerifier/assets/scripts/power_monitors/monsoon.py | $(ACP) 126# $(hide) mkdir -p $(verifier-dir)/power/power_monitors 127# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/power_monitors/*.py $(verifier-dir)/power/power_monitors/. 128# 129#$(verifier-dir)/power/execute_power_tests.py: cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py | $(ACP) 130# $(hide) mkdir -p $(verifier-dir)/power 131# $(hide) $(ACP) -fp cts/apps/CtsVerifier/assets/scripts/execute_power_tests.py $@ 132 133cts : $(verifier-zip) 134$(verifier-zip) : $(HOST_OUT)/CameraITS 135$(verifier-zip) : $(notification-bot) 136$(verifier-zip) : $(permission-app) 137$(verifier-zip) : $(usb-companion) 138$(verifier-zip) : $(empty-device-admin) 139$(verifier-zip) : $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk | $(ACP) 140 $(hide) mkdir -p $(verifier-dir) 141 $(hide) $(ACP) -fp $< $(verifier-dir)/CtsVerifier.apk 142 $(ACP) -fp $(notification-bot) $(verifier-dir)/NotificationBot.apk 143 $(ACP) -fp $(permission-app) $(verifier-dir)/CtsPermissionApp.apk 144 $(ACP) -fp $(usb-companion) $(verifier-dir)/CtsVerifierUSBCompanion.apk 145 $(ACP) -fp $(empty-device-admin) $(verifier-dir)/CtsEmptyDeviceAdmin.apk 146 $(hide) $(ACP) -fpr $(HOST_OUT)/CameraITS $(verifier-dir) 147 $(hide) cd $(cts-dir) && zip -rq $(verifier-dir-name) $(verifier-dir-name) 148 149ifneq ($(filter cts, $(MAKECMDGOALS)),) 150 $(call dist-for-goals, cts, $(verifier-zip):$(verifier-zip-name)) 151endif 152 153include $(call all-makefiles-under,$(LOCAL_PATH)) 154