1# Copyright (C) 2018 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)
16
17###################################################################
18# BackupFrameworksServicesLib app just for Robolectric test target      #
19###################################################################
20include $(CLEAR_VARS)
21
22LOCAL_PACKAGE_NAME := BackupFrameworksServicesLib
23LOCAL_PRIVATE_PLATFORM_APIS := true
24LOCAL_MODULE_TAGS := optional
25
26LOCAL_PRIVILEGED_MODULE := true
27
28LOCAL_STATIC_JAVA_LIBRARIES := \
29    bmgr \
30    bu \
31    services.backup \
32    services.core \
33    services.net
34
35include $(BUILD_PACKAGE)
36
37###################################################################
38# BackupFrameworksServicesLib Robolectric test target.                  #
39###################################################################
40include $(CLEAR_VARS)
41
42LOCAL_MODULE := BackupFrameworksServicesRoboTests
43
44LOCAL_SRC_FILES := $(call all-java-files-under, src) \
45    $(call all-java-files-under, ../src/com/android/server/testing/shadows)
46
47LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
48
49LOCAL_JAVA_RESOURCE_DIRS := config
50
51# Include the testing libraries
52LOCAL_JAVA_LIBRARIES := \
53    platform-test-annotations \
54    robolectric_android-all-stub \
55    Robolectric_all-target \
56    mockito-robolectric-prebuilt \
57    truth-prebuilt \
58    testng
59
60LOCAL_INSTRUMENTATION_FOR := BackupFrameworksServicesLib
61
62LOCAL_MODULE_TAGS := optional
63
64include $(BUILD_STATIC_JAVA_LIBRARY)
65
66###################################################################
67# BackupFrameworksServicesLib runner target to run the previous target. #
68###################################################################
69include $(CLEAR_VARS)
70
71LOCAL_MODULE := RunBackupFrameworksServicesRoboTests
72
73LOCAL_JAVA_LIBRARIES := \
74    BackupFrameworksServicesRoboTests \
75    platform-test-annotations \
76    robolectric_android-all-stub \
77    Robolectric_all-target \
78    mockito-robolectric-prebuilt \
79    truth-prebuilt \
80    testng
81
82LOCAL_TEST_PACKAGE := BackupFrameworksServicesLib
83
84include external/robolectric-shadows/run_robotests.mk
85