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