Brett Chabot | caf30a1 | 2011-07-28 19:33:22 -0700 | [diff] [blame] | 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 | |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 18 | LOCAL_USE_AAPT2 := true |
Brett Chabot | caf30a1 | 2011-07-28 19:33:22 -0700 | [diff] [blame] | 19 | LOCAL_MODULE_TAGS := tests |
| 20 | |
Sid Soundararajan | b58c46a | 2016-01-26 15:39:27 -0800 | [diff] [blame] | 21 | LOCAL_JACK_FLAGS := --multi-dex native |
Colin Cross | 254a418 | 2017-01-20 14:46:38 -0800 | [diff] [blame] | 22 | LOCAL_DX_FLAGS := --multi-dex |
Sid Soundararajan | b58c46a | 2016-01-26 15:39:27 -0800 | [diff] [blame] | 23 | |
Blazej Magnowski | 7232332 | 2015-07-24 11:49:40 -0700 | [diff] [blame] | 24 | LOCAL_PROTOC_OPTIMIZE_TYPE := nano |
| 25 | LOCAL_PROTOC_FLAGS := -I$(LOCAL_PATH)/.. |
| 26 | LOCAL_PROTO_JAVA_OUTPUT_PARAMS := optional_field_style=accessors |
| 27 | |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 28 | LOCAL_PACKAGE_NAME := SystemUITests |
Simran Basi | 473a16e | 2017-03-15 14:43:58 -0700 | [diff] [blame] | 29 | LOCAL_COMPATIBILITY_SUITE := device-tests |
Winson | 190fe3bf | 2015-10-20 14:57:24 -0700 | [diff] [blame] | 30 | |
Jason Monk | 29f7a7b | 2014-11-17 14:40:56 -0500 | [diff] [blame] | 31 | LOCAL_SRC_FILES := $(call all-java-files-under, src) \ |
Winson | 190fe3bf | 2015-10-20 14:57:24 -0700 | [diff] [blame] | 32 | $(call all-Iaidl-files-under, src) \ |
Adrian Roos | 4cc2a58 | 2016-02-25 09:28:13 -0800 | [diff] [blame] | 33 | $(call all-java-files-under, ../src) |
Jason Monk | 29f7a7b | 2014-11-17 14:40:56 -0500 | [diff] [blame] | 34 | |
| 35 | LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \ |
| 36 | frameworks/base/packages/SystemUI/res \ |
Jason Monk | 23f85ec | 2017-01-31 14:29:32 -0500 | [diff] [blame] | 37 | frameworks/base/packages/SystemUI/res-keyguard \ |
Brett Chabot | caf30a1 | 2011-07-28 19:33:22 -0700 | [diff] [blame] | 38 | |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 39 | LOCAL_STATIC_ANDROID_LIBRARIES := \ |
Jason Monk | 86bc331 | 2016-08-16 13:17:56 -0400 | [diff] [blame] | 40 | SystemUIPluginLib \ |
Selim Cinek | 0f66a4c | 2017-04-28 19:26:28 -0700 | [diff] [blame] | 41 | android-support-v4 \ |
Jason Monk | 87ccd55 | 2015-12-11 21:39:54 -0500 | [diff] [blame] | 42 | android-support-v7-recyclerview \ |
| 43 | android-support-v7-preference \ |
| 44 | android-support-v7-appcompat \ |
Jason Monk | 1cbf5fb | 2017-03-30 15:23:43 -0400 | [diff] [blame] | 45 | android-support-v7-mediarouter \ |
Selim Cinek | 5fb73f8 | 2017-04-20 16:55:38 -0700 | [diff] [blame] | 46 | android-support-v7-palette \ |
Sid Soundararajan | b58c46a | 2016-01-26 15:39:27 -0800 | [diff] [blame] | 47 | android-support-v14-preference \ |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 48 | android-support-v17-leanback |
| 49 | |
| 50 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 51 | metrics-helper-lib \ |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 52 | android-support-test \ |
Paul Duffin | a7773c2 | 2017-03-14 16:37:39 +0000 | [diff] [blame] | 53 | mockito-target-minus-junit4 \ |
Jorim Jaggi | d056517 | 2016-09-15 16:31:14 -0700 | [diff] [blame] | 54 | SystemUI-proto \ |
Paul Duffin | 8aeb59e | 2017-01-10 12:08:23 +0000 | [diff] [blame] | 55 | SystemUI-tags \ |
Jason Monk | 340b0e5 | 2017-03-08 14:57:56 -0500 | [diff] [blame] | 56 | legacy-android-test \ |
| 57 | testables |
Brett Chabot | caf30a1 | 2011-07-28 19:33:22 -0700 | [diff] [blame] | 58 | |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 59 | LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.car |
| 60 | |
Jason Monk | 23f85ec | 2017-01-31 14:29:32 -0500 | [diff] [blame] | 61 | LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui:com.android.keyguard |
Adam Lesinski | 38e8966 | 2016-06-24 15:00:11 -0700 | [diff] [blame] | 62 | |
Brett Chabot | caf30a1 | 2011-07-28 19:33:22 -0700 | [diff] [blame] | 63 | # sign this with platform cert, so this test is allowed to inject key events into |
| 64 | # UI it doesn't own. This is necessary to allow screenshots to be taken |
| 65 | LOCAL_CERTIFICATE := platform |
| 66 | |
Allen Hair | 8fef05f | 2016-08-29 12:21:02 -0700 | [diff] [blame] | 67 | # Provide jack a list of classes to exclude from code coverage. |
| 68 | # This is needed because the SystemUITests compile SystemUI source directly, rather than using |
| 69 | # LOCAL_INSTRUMENTATION_FOR := SystemUI. |
| 70 | # |
| 71 | # We want to exclude the test classes from code coverage measurements, but they share the same |
| 72 | # package as the rest of SystemUI so they can't be easily filtered by package name. |
| 73 | # |
| 74 | # Generate a comma separated list of patterns based on the test source files under src/ |
| 75 | # SystemUI classes are in ../src/ so they won't be excluded. |
| 76 | # Example: |
| 77 | # Input files: src/com/android/systemui/Test.java src/com/android/systemui/AnotherTest.java |
| 78 | # Generated exclude list: com.android.systemui.Test*,com.android.systemui.AnotherTest* |
| 79 | |
| 80 | # Filter all src files under src/ to just java files |
| 81 | local_java_files := $(filter %.java,$(call all-java-files-under, src)) |
| 82 | # Transform java file names into full class names. |
| 83 | # This only works if the class name matches the file name and the directory structure |
| 84 | # matches the package. |
| 85 | local_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files))) |
| 86 | local_comma := , |
| 87 | local_empty := |
| 88 | local_space := $(local_empty) $(local_empty) |
| 89 | # Convert class name list to jacoco exclude list |
| 90 | # This appends a * to all classes and replace the space separators with commas. |
| 91 | jacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes))) |
| 92 | |
Allen Hair | 02fd6094 | 2016-08-25 16:06:26 -0700 | [diff] [blame] | 93 | LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.systemui.* |
Allen Hair | 8fef05f | 2016-08-29 12:21:02 -0700 | [diff] [blame] | 94 | LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := com.android.systemui.tests.*,$(jacoco_exclude) |
Allen Hair | 02fd6094 | 2016-08-25 16:06:26 -0700 | [diff] [blame] | 95 | |
Jason Monk | 2ba4ce6 | 2015-01-13 10:08:23 -0500 | [diff] [blame] | 96 | include frameworks/base/packages/SettingsLib/common.mk |
| 97 | |
Jason Monk | 4f70b9c | 2016-10-26 15:05:42 -0400 | [diff] [blame] | 98 | ifeq ($(EXCLUDE_SYSTEMUI_TESTS),) |
| 99 | include $(BUILD_PACKAGE) |
| 100 | endif |
Allen Hair | 8fef05f | 2016-08-29 12:21:02 -0700 | [diff] [blame] | 101 | |
| 102 | # Reset variables |
| 103 | local_java_files := |
| 104 | local_classes := |
| 105 | local_comma := |
| 106 | local_space := |
| 107 | jacoco_exclude := |