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                                compatibility-common-util-devicesidelib_v2 \
     30                                cts-sensors-tests \
     31                                ctstestrunner \
     32 
     33 LOCAL_PACKAGE_NAME := CtsVerifier
     34 
     35 LOCAL_JNI_SHARED_LIBRARIES := libctsverifier_jni \
     36 	#libcameraanalyzer # Needed for the disabled CameraAnalyzer tests
     37 
     38 LOCAL_PROGUARD_FLAG_FILES := proguard.flags
     39 
     40 LOCAL_SDK_VERSION := current
     41 
     42 LOCAL_DEX_PREOPT := false
     43 
     44 include $(BUILD_PACKAGE)
     45 
     46 notification-bot := $(call intermediates-dir-for,APPS,NotificationBot)/package.apk
     47 
     48 # Builds and launches CTS Verifier on a device.
     49 .PHONY: cts-verifier
     50 cts-verifier: CtsVerifier adb NotificationBot
     51 	adb install -r $(PRODUCT_OUT)/data/app/CtsVerifier/CtsVerifier.apk \
     52 		&& adb install -r $(notification-bot) \
     53 		&& adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity"
     54 
     55 #
     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 #
     64 cts-dir := $(HOST_OUT)/cts-verifier
     65 verifier-dir-name := android-cts-verifier
     66 verifier-dir := $(cts-dir)/$(verifier-dir-name)
     67 verifier-zip-name := $(verifier-dir-name).zip
     68 verifier-zip := $(cts-dir)/$(verifier-zip-name)
     69 
     70 # 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
     73 
     74 # Copy the necessary host-side scripts to include in the zip file:
     75 #$(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 $@
     82 
     83 cts : $(verifier-zip)
     84 ifeq ($(HOST_OS),linux)
     85 $(verifier-zip) : $(HOST_OUT)/bin/cts-usb-accessory
     86 endif
     87 $(verifier-zip) : $(HOST_OUT)/CameraITS
     88 $(verifier-zip) : $(notification-bot)
     89 $(verifier-zip) : $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk | $(ACP)
     90 		$(hide) mkdir -p $(verifier-dir)
     91 		$(hide) $(ACP) -fp $< $(verifier-dir)/CtsVerifier.apk
     92 		$(ACP) -fp $(notification-bot) $(verifier-dir)/NotificationBot.apk
     93 ifeq ($(HOST_OS),linux)
     94 		$(hide) $(ACP) -fp $(HOST_OUT)/bin/cts-usb-accessory $(verifier-dir)/cts-usb-accessory
     95 endif
     96 		$(hide) $(ACP) -fpr $(HOST_OUT)/CameraITS $(verifier-dir)
     97 		$(hide) cd $(cts-dir) && zip -rq $(verifier-dir-name) $(verifier-dir-name)
     98 
     99 ifneq ($(filter cts, $(MAKECMDGOALS)),)
    100   $(call dist-for-goals, cts, $(verifier-zip):$(verifier-zip-name))
    101 endif
    102 
    103 include $(call all-makefiles-under,$(LOCAL_PATH))
    104