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