• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1################################################################
2# Compile Robolectric shadows androidx fragment                #
3################################################################
4LOCAL_PATH := $(call my-dir)
5include $(CLEAR_VARS)
6
7LOCAL_MODULE := Robolectric_shadows_androidx_fragment
8
9LOCAL_JAVA_LIBRARIES := \
10  Robolectric_shadows_framework \
11  Robolectric_shadowapi \
12  robolectric-host-android_all \
13  robolectric-host-androidx
14
15LOCAL_ANNOTATION_PROCESSORS := \
16  Robolectric_annotations \
17  Robolectric_processor \
18  robolectric-guava-25.1-jre \
19  robolectric-gson-2.8
20
21LOCAL_ANNOTATION_PROCESSOR_CLASSES := org.robolectric.annotation.processing.RobolectricProcessor
22
23LOCAL_JAVACFLAGS := -Aorg.robolectric.annotation.processing.shadowPackage=org.robolectric.shadows.androidx.fragment
24
25LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java)
26
27include $(BUILD_HOST_JAVA_LIBRARY)
28
29################################################################
30# Androidx Shadows Shell app just for Robolectric test target. #
31################################################################
32include $(CLEAR_VARS)
33
34LOCAL_PACKAGE_NAME := Robolectric_shadows_androidx_fragment_shell_app
35
36LOCAL_MANIFEST_FILE := src/test/AndroidManifest.xml
37
38LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/src/test/resources/res
39
40# This exists to coerce make into generating and compiling R.java.
41LOCAL_STATIC_JAVA_LIBRARIES := androidx.fragment_fragment
42
43LOCAL_MIN_SDK_VERSION := 16
44
45LOCAL_SDK_VERSION := current
46
47LOCAL_USE_AAPT2 := true
48
49LOCAL_PROGUARD_ENABLED := disabled
50
51include $(BUILD_PACKAGE)
52
53################################################################
54# Androidx Shadows test target.                                #
55################################################################
56include $(CLEAR_VARS)
57
58LOCAL_MODULE := Robolectric_shadows_androidx_fragment_tests
59LOCAL_MODULE_CLASS := JAVA_LIBRARIES
60
61LOCAL_SRC_FILES := $(call all-java-files-under, src/test/java)
62
63LOCAL_JAVA_LIBRARIES := \
64    robolectric_android-all-stub \
65    Robolectric_all-target \
66    truth-prebuilt
67
68LOCAL_INSTRUMENTATION_FOR := Robolectric_shadows_androidx_fragment_shell_app
69
70LOCAL_MODULE_TAGS := optional
71
72# Generate test_config.properties
73include external/robolectric-shadows/gen_test_config.mk
74
75include $(BUILD_STATIC_JAVA_LIBRARY)
76
77################################################################
78# Androidx Shadows runner target to run the previous target.   #
79################################################################
80include $(CLEAR_VARS)
81
82LOCAL_MODULE := Run_robolectric_shadows_androidx_fragment_tests
83
84LOCAL_JAVA_LIBRARIES := \
85    Robolectric_shadows_androidx_fragment_tests \
86    robolectric_android-all-stub \
87    Robolectric_all-target \
88    truth-prebuilt
89
90LOCAL_TEST_PACKAGE := Robolectric_shadows_androidx_fragment_shell_app
91
92LOCAL_ROBOTEST_FILES := $(call find-files-in-subdirs,$(LOCAL_PATH)/src/test/java,*Test.java,.)
93
94include external/robolectric-shadows/run_robotests.mk