blob: 77716df59e2b280bea693e2b43ca2b1dd5da8bd5 [file] [log] [blame]
Brett Chabotcaf30a12011-07-28 19:33:22 -07001# 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
15LOCAL_PATH := $(call my-dir)
16include $(CLEAR_VARS)
17
Adam Lesinski38e89662016-06-24 15:00:11 -070018LOCAL_USE_AAPT2 := true
Brett Chabotcaf30a12011-07-28 19:33:22 -070019LOCAL_MODULE_TAGS := tests
20
Sid Soundararajanb58c46a2016-01-26 15:39:27 -080021LOCAL_JACK_FLAGS := --multi-dex native
Colin Cross254a4182017-01-20 14:46:38 -080022LOCAL_DX_FLAGS := --multi-dex
Sid Soundararajanb58c46a2016-01-26 15:39:27 -080023
Blazej Magnowski72323322015-07-24 11:49:40 -070024LOCAL_PROTOC_OPTIMIZE_TYPE := nano
25LOCAL_PROTOC_FLAGS := -I$(LOCAL_PATH)/..
26LOCAL_PROTO_JAVA_OUTPUT_PARAMS := optional_field_style=accessors
27
Adam Lesinski38e89662016-06-24 15:00:11 -070028LOCAL_PACKAGE_NAME := SystemUITests
Anton Hanssond137c872018-02-23 12:57:51 +000029LOCAL_PRIVATE_PLATFORM_APIS := true
Simran Basi473a16e2017-03-15 14:43:58 -070030LOCAL_COMPATIBILITY_SUITE := device-tests
Winson190fe3bf2015-10-20 14:57:24 -070031
Jason Monk29f7a7b2014-11-17 14:40:56 -050032LOCAL_SRC_FILES := $(call all-java-files-under, src) \
Winson190fe3bf2015-10-20 14:57:24 -070033 $(call all-Iaidl-files-under, src) \
Adrian Roos4cc2a582016-02-25 09:28:13 -080034 $(call all-java-files-under, ../src)
Jason Monk29f7a7b2014-11-17 14:40:56 -050035
36LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
37 frameworks/base/packages/SystemUI/res \
Jason Monk23f85ec2017-01-31 14:29:32 -050038 frameworks/base/packages/SystemUI/res-keyguard \
Brett Chabotcaf30a12011-07-28 19:33:22 -070039
Adam Lesinski38e89662016-06-24 15:00:11 -070040LOCAL_STATIC_ANDROID_LIBRARIES := \
Jason Monk86bc3312016-08-16 13:17:56 -040041 SystemUIPluginLib \
Winson Chung6519c1b2017-10-13 17:12:56 -070042 SystemUISharedLib \
Aurimas Liutikasfd52c142018-04-17 09:50:46 -070043 androidx.car_car \
44 androidx.legacy_legacy-support-v4 \
45 androidx.recyclerview_recyclerview \
46 androidx.preference_preference \
47 androidx.appcompat_appcompat \
48 androidx.mediarouter_mediarouter \
49 androidx.palette_palette \
50 androidx.legacy_legacy-preference-v14 \
51 androidx.leanback_leanback \
52 androidx.slice_slice-core \
53 androidx.slice_slice-view \
54 androidx.slice_slice-builders \
55 androidx.arch.core_core-runtime \
56 androidx.lifecycle_lifecycle-extensions \
Adam Lesinski38e89662016-06-24 15:00:11 -070057
58LOCAL_STATIC_JAVA_LIBRARIES := \
Chris Wren27a52fa2017-02-01 14:21:43 -050059 metrics-helper-lib \
Geoffrey Pitsch2c403db2016-08-26 09:09:39 -040060 android-support-test \
Jason Monk1fc931a2017-12-14 13:22:58 -050061 mockito-target-inline-minus-junit4 \
Jorim Jaggid0565172016-09-15 16:31:14 -070062 SystemUI-proto \
Paul Duffin8aeb59e2017-01-10 12:08:23 +000063 SystemUI-tags \
jackqdyulei8443dd02017-08-24 16:14:34 -070064 testables \
65 truth-prebuilt \
Brett Chabotcaf30a12011-07-28 19:33:22 -070066
Jason Monk1fc931a2017-12-14 13:22:58 -050067LOCAL_MULTILIB := both
68
69LOCAL_JNI_SHARED_LIBRARIES := \
70 libdexmakerjvmtiagent \
71 libmultiplejvmtiagentsinterferenceagent
72
73
Paul Duffinb8663072017-12-08 00:02:42 +000074LOCAL_JAVA_LIBRARIES := \
75 android.test.runner \
76 telephony-common \
Paul Duffinb8663072017-12-08 00:02:42 +000077 android.test.base \
Weijie Wang66373212018-06-06 16:56:28 +080078 android.car \
79 qtiNetworkLib
Adam Lesinski38e89662016-06-24 15:00:11 -070080
Jason Monk23f85ec2017-01-31 14:29:32 -050081LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui:com.android.keyguard
Adam Lesinski38e89662016-06-24 15:00:11 -070082
Brett Chabotcaf30a12011-07-28 19:33:22 -070083# sign this with platform cert, so this test is allowed to inject key events into
84# UI it doesn't own. This is necessary to allow screenshots to be taken
85LOCAL_CERTIFICATE := platform
86
Allen Hair8fef05f2016-08-29 12:21:02 -070087# Provide jack a list of classes to exclude from code coverage.
88# This is needed because the SystemUITests compile SystemUI source directly, rather than using
89# LOCAL_INSTRUMENTATION_FOR := SystemUI.
90#
91# We want to exclude the test classes from code coverage measurements, but they share the same
92# package as the rest of SystemUI so they can't be easily filtered by package name.
93#
94# Generate a comma separated list of patterns based on the test source files under src/
95# SystemUI classes are in ../src/ so they won't be excluded.
96# Example:
97# Input files: src/com/android/systemui/Test.java src/com/android/systemui/AnotherTest.java
98# Generated exclude list: com.android.systemui.Test*,com.android.systemui.AnotherTest*
99
100# Filter all src files under src/ to just java files
101local_java_files := $(filter %.java,$(call all-java-files-under, src))
102# Transform java file names into full class names.
103# This only works if the class name matches the file name and the directory structure
104# matches the package.
105local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files)))
106local_comma := ,
107local_empty :=
108local_space := $(local_empty) $(local_empty)
109# Convert class name list to jacoco exclude list
110# This appends a * to all classes and replace the space separators with commas.
111jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes)))
112
Allen Hair02fd60942016-08-25 16:06:26 -0700113LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.systemui.*
Allen Hair8fef05f2016-08-29 12:21:02 -0700114LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := com.android.systemui.tests.*,$(jacoco_exclude)
Allen Hair02fd60942016-08-25 16:06:26 -0700115
Jason Monk2ba4ce62015-01-13 10:08:23 -0500116include frameworks/base/packages/SettingsLib/common.mk
117
Jason Monk4f70b9c2016-10-26 15:05:42 -0400118ifeq ($(EXCLUDE_SYSTEMUI_TESTS),)
119 include $(BUILD_PACKAGE)
120endif
Allen Hair8fef05f2016-08-29 12:21:02 -0700121
122# Reset variables
123local_java_files :=
124local_classes :=
125local_comma :=
126local_space :=
127jacoco_exclude :=