| Artem Iglikov | 5ed1dab | 2017-05-25 15:56:05 +0100 | [diff] [blame] | 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 | # FrameworksServicesLib app just for Robolectric test target. # |
| 18 | ############################################################ |
| 19 | LOCAL_PATH := $(call my-dir) |
| 20 | |
| 21 | include $(CLEAR_VARS) |
| 22 | |
| 23 | LOCAL_PACKAGE_NAME := FrameworksServicesLib |
| 24 | LOCAL_MODULE_TAGS := optional |
| 25 | |
| 26 | LOCAL_PRIVILEGED_MODULE := true |
| 27 | |
| 28 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
| Artem Iglikov | 5ed1dab | 2017-05-25 15:56:05 +0100 | [diff] [blame] | 29 | services.backup \ |
| Bernardo Rufino | 58dd6c3 | 2017-11-09 19:30:32 +0000 | [diff] [blame] | 30 | services.core |
| Artem Iglikov | 5ed1dab | 2017-05-25 15:56:05 +0100 | [diff] [blame] | 31 | |
| 32 | include $(BUILD_PACKAGE) |
| 33 | |
| 34 | ############################################# |
| 35 | # FrameworksServices Robolectric test target. # |
| 36 | ############################################# |
| 37 | include $(CLEAR_VARS) |
| 38 | |
| 39 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
| 40 | |
| 41 | # Include the testing libraries (JUnit4 + Robolectric libs). |
| 42 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
| Bernardo Rufino | 58dd6c3 | 2017-11-09 19:30:32 +0000 | [diff] [blame] | 43 | android-support-test \ |
| 44 | mockito-robolectric-prebuilt \ |
| 45 | platform-test-annotations \ |
| Artem Iglikov | 5ed1dab | 2017-05-25 15:56:05 +0100 | [diff] [blame] | 46 | truth-prebuilt |
| 47 | |
| Bernardo Rufino | b7e9ac8f | 2017-11-13 17:26:17 +0000 | [diff] [blame] | 48 | # TODO(b/69254249): Migrate to Robolectric 3.4.2 |
| Artem Iglikov | 5ed1dab | 2017-05-25 15:56:05 +0100 | [diff] [blame] | 49 | LOCAL_JAVA_LIBRARIES := \ |
| 50 | junit \ |
| Maurice Lam | d42f99c | 2017-11-14 13:10:36 -0800 | [diff] [blame] | 51 | platform-robolectric-3.1.1-prebuilt |
| Artem Iglikov | 5ed1dab | 2017-05-25 15:56:05 +0100 | [diff] [blame] | 52 | |
| 53 | LOCAL_INSTRUMENTATION_FOR := FrameworksServicesLib |
| 54 | LOCAL_MODULE := FrameworksServicesRoboTests |
| 55 | |
| 56 | LOCAL_MODULE_TAGS := optional |
| 57 | |
| 58 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 59 | |
| 60 | ############################################################# |
| 61 | # FrameworksServices runner target to run the previous target. # |
| 62 | ############################################################# |
| 63 | include $(CLEAR_VARS) |
| 64 | |
| 65 | LOCAL_MODULE := RunFrameworksServicesRoboTests |
| 66 | |
| 67 | LOCAL_SDK_VERSION := current |
| 68 | |
| 69 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
| 70 | FrameworksServicesRoboTests |
| 71 | |
| 72 | LOCAL_TEST_PACKAGE := FrameworksServicesLib |
| 73 | |
| Artem Iglikov | bd476ea | 2017-09-01 10:57:26 +0100 | [diff] [blame] | 74 | LOCAL_INSTRUMENT_SOURCE_DIRS := $(dir $(LOCAL_PATH))backup/java |
| 75 | |
| Bernardo Rufino | b7e9ac8f | 2017-11-13 17:26:17 +0000 | [diff] [blame] | 76 | # TODO(b/69254249): Migrate to Robolectric 3.4.2 |
| 77 | include prebuilts/misc/common/robolectric/3.1.1/run_robotests.mk |