1# Copyright (C) 2016 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
16############################################################
17# SettingsLib Shell app just for Robolectric test target.  #
18############################################################
19LOCAL_PATH := $(call my-dir)
20
21include $(CLEAR_VARS)
22
23LOCAL_PACKAGE_NAME := SettingsLibShell
24LOCAL_MODULE_TAGS := optional
25
26LOCAL_PRIVILEGED_MODULE := true
27
28LOCAL_RESOURCE_DIR := \
29    $(LOCAL_PATH)/res
30
31include frameworks/base/packages/SettingsLib/common.mk
32
33include $(BUILD_PACKAGE)
34
35#############################################
36# SettingsLib Robolectric test target. #
37#############################################
38include $(CLEAR_VARS)
39
40LOCAL_SRC_FILES := $(call all-java-files-under, src)
41
42# Include the testing libraries (JUnit4 + Robolectric libs).
43LOCAL_STATIC_JAVA_LIBRARIES := \
44    platform-system-robolectric \
45    truth-prebuilt
46
47LOCAL_JAVA_LIBRARIES := \
48    junit \
49    platform-robolectric-prebuilt
50
51LOCAL_INSTRUMENTATION_FOR := SettingsLibShell
52LOCAL_MODULE := SettingsLibRoboTests
53
54LOCAL_MODULE_TAGS := optional
55
56include $(BUILD_STATIC_JAVA_LIBRARY)
57
58#############################################################
59# SettingsLib runner target to run the previous target. #
60#############################################################
61include $(CLEAR_VARS)
62
63LOCAL_MODULE := RunSettingsLibRoboTests
64
65LOCAL_SDK_VERSION := current
66
67LOCAL_STATIC_JAVA_LIBRARIES := \
68    SettingsLibRoboTests
69
70LOCAL_TEST_PACKAGE := SettingsLibShell
71
72include prebuilts/misc/common/robolectric/run_robotests.mk
73