1 # Copyright (C) 2011 The Android Open Source Project 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 LOCAL_PATH := $(call my-dir) 16 include $(CLEAR_VARS) 17 18 LOCAL_USE_AAPT2 := true 19 LOCAL_MODULE_TAGS := tests 20 21 LOCAL_JACK_FLAGS := --multi-dex native 22 LOCAL_DX_FLAGS := --multi-dex 23 24 LOCAL_PROTOC_OPTIMIZE_TYPE := nano 25 LOCAL_PROTOC_FLAGS := -I$(LOCAL_PATH)/.. 26 LOCAL_PROTO_JAVA_OUTPUT_PARAMS := optional_field_style=accessors 27 28 LOCAL_PACKAGE_NAME := SystemUITests 29 LOCAL_PRIVATE_PLATFORM_APIS := true 30 LOCAL_COMPATIBILITY_SUITE := device-tests 31 32 LOCAL_SRC_FILES := $(call all-java-files-under, src) \ 33 $(call all-Iaidl-files-under, src) \ 34 $(call all-java-files-under, ../src) 35 36 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \ 37 frameworks/base/packages/SystemUI/res \ 38 frameworks/base/packages/SystemUI/res-keyguard \ 39 40 LOCAL_STATIC_ANDROID_LIBRARIES := \ 41 SystemUIPluginLib \ 42 SystemUISharedLib \ 43 android-support-car \ 44 android-support-v4 \ 45 android-support-v7-recyclerview \ 46 android-support-v7-preference \ 47 android-support-v7-appcompat \ 48 android-support-v7-mediarouter \ 49 android-support-v7-palette \ 50 android-support-v14-preference \ 51 android-support-v17-leanback \ 52 android-slices-core \ 53 android-slices-view \ 54 android-slices-builders \ 55 android-arch-core-runtime \ 56 android-arch-lifecycle-extensions \ 57 58 LOCAL_STATIC_JAVA_LIBRARIES := \ 59 metrics-helper-lib \ 60 android-support-test \ 61 mockito-target-inline-minus-junit4 \ 62 SystemUI-proto \ 63 SystemUI-tags \ 64 testables \ 65 truth-prebuilt \ 66 67 LOCAL_MULTILIB := both 68 69 LOCAL_JNI_SHARED_LIBRARIES := \ 70 libdexmakerjvmtiagent \ 71 libmultiplejvmtiagentsinterferenceagent 72 73 74 LOCAL_JAVA_LIBRARIES := \ 75 android.test.runner \ 76 telephony-common \ 77 android.test.base \ 78 android.car 79 80 LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui:com.android.keyguard 81 82 # sign this with platform cert, so this test is allowed to inject key events into 83 # UI it doesn't own. This is necessary to allow screenshots to be taken 84 LOCAL_CERTIFICATE := platform 85 86 # Provide jack a list of classes to exclude from code coverage. 87 # This is needed because the SystemUITests compile SystemUI source directly, rather than using 88 # LOCAL_INSTRUMENTATION_FOR := SystemUI. 89 # 90 # We want to exclude the test classes from code coverage measurements, but they share the same 91 # package as the rest of SystemUI so they can't be easily filtered by package name. 92 # 93 # Generate a comma separated list of patterns based on the test source files under src/ 94 # SystemUI classes are in ../src/ so they won't be excluded. 95 # Example: 96 # Input files: src/com/android/systemui/Test.java src/com/android/systemui/AnotherTest.java 97 # Generated exclude list: com.android.systemui.Test*,com.android.systemui.AnotherTest* 98 99 # Filter all src files under src/ to just java files 100 local_java_files := $(filter %.java,$(call all-java-files-under, src)) 101 # Transform java file names into full class names. 102 # This only works if the class name matches the file name and the directory structure 103 # matches the package. 104 local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files))) 105 local_comma := , 106 local_empty := 107 local_space := $(local_empty) $(local_empty) 108 # Convert class name list to jacoco exclude list 109 # This appends a * to all classes and replace the space separators with commas. 110 jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes))) 111 112 LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.systemui.* 113 LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := com.android.systemui.tests.*,$(jacoco_exclude) 114 115 include frameworks/base/packages/SettingsLib/common.mk 116 117 ifeq ($(EXCLUDE_SYSTEMUI_TESTS),) 118 include $(BUILD_PACKAGE) 119 endif 120 121 # Reset variables 122 local_java_files := 123 local_classes := 124 local_comma := 125 local_space := 126 jacoco_exclude := 127