1##############################################
2# Compile Robolectric robolectric
3##############################################
4LOCAL_PATH := $(call my-dir)
5include $(CLEAR_VARS)
6
7LOCAL_MODULE := Robolectric_robolectric
8LOCAL_MODULE_CLASS := JAVA_LIBRARIES
9LOCAL_IS_HOST_MODULE := true
10
11intermediates := $(call local-intermediates-dir)
12
13LOCAL_JAVA_LIBRARIES := \
14  Robolectric_shadows_framework \
15  Robolectric_annotations \
16  Robolectric_shadowapi \
17  Robolectric_resources \
18  Robolectric_sandbox \
19  Robolectric_junit \
20  Robolectric_utils \
21  robolectric-host-android_all \
22  robolectric-host-monitor-1.0.2-alpha1 \
23  robolectric-maven-ant-tasks-2.1.3 \
24  robolectric-bouncycastle-1.46 \
25  robolectric-asm-commons-6.0 \
26  robolectric-xstream-1.4.8 \
27  robolectric-asm-tree-6.0 \
28  robolectric-junit-4.12 \
29  robolectric-guava-20.0 \
30  robolectric-ant-1.8.0 \
31  robolectric-asm-6.0 \
32  jsr305lib
33
34LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java)
35
36$(intermediates)/robolectric-version.properties:
37	$(hide) echo -n "robolectric.version=3.7-SNAPSHOT" >$@
38
39LOCAL_JAVA_RESOURCE_FILES := $(intermediates)/robolectric-version.properties
40
41include $(BUILD_HOST_JAVA_LIBRARY)
42
43##############################################
44# Compile Robolectric robolectric tests
45##############################################
46include $(CLEAR_VARS)
47
48LOCAL_MODULE := Robolectric_robolectric_tests
49
50LOCAL_SRC_FILES := $(call all-java-files-under, src/test/java)
51
52LOCAL_JAVA_RESOURCE_DIRS := src/test/resources
53
54LOCAL_JAVA_LIBRARIES := \
55  Robolectric_shadows_framework \
56  Robolectric_annotations \
57  Robolectric_robolectric \
58  Robolectric_resources \
59  Robolectric_shadowapi \
60  Robolectric_sandbox \
61  Robolectric_junit \
62  Robolectric_utils \
63  robolectric-host-monitor-1.0.2-alpha1 \
64  robolectric-maven-ant-tasks-2.1.3 \
65  robolectric-assertj-core-3.8.0 \
66  robolectric-mockito-core-2.7.6 \
67  robolectric-bouncycastle-1.46 \
68  robolectric-hamcrest-core-1.3 \
69  robolectric-sqlite4java-0.282 \
70  robolectric-host-android_all \
71  robolectric-guava-20.0 \
72  robolectric-junit-4.12 \
73  robolectric-ant-1.8.0 \
74  jsr305lib
75
76include $(BUILD_HOST_JAVA_LIBRARY)
77
78##############################################
79# Execute Robolectric robolectric tests
80##############################################
81include $(CLEAR_VARS)
82
83LOCAL_MODULE := Run_robolectric_robolectric_tests
84
85test_source_directory := $(LOCAL_PATH)/src/test/java
86
87test_resources_directory := $(LOCAL_PATH)/src/test/resources
88
89test_runtime_libraries := \
90  Robolectric_robolectric_tests \
91  Robolectric_shadows_framework \
92  Robolectric_annotations \
93  Robolectric_robolectric \
94  Robolectric_resources \
95  Robolectric_shadowapi \
96  Robolectric_sandbox \
97  Robolectric_junit \
98  Robolectric_utils \
99  robolectric-host-monitor-1.0.2-alpha1 \
100  robolectric-byte-buddy-agent-1.6.5 \
101  robolectric-maven-ant-tasks-2.1.3 \
102  robolectric-assertj-core-3.8.0 \
103  robolectric-mockito-core-2.7.6 \
104  robolectric-bouncycastle-1.46 \
105  robolectric-hamcrest-core-1.3 \
106  robolectric-sqlite4java-0.282 \
107  robolectric-byte-buddy-1.6.5 \
108  robolectric-host-android_all \
109  robolectric-asm-commons-6.0 \
110  robolectric-objenesis-2.5 \
111  robolectric-xstream-1.4.8 \
112  robolectric-asm-tree-6.0 \
113  robolectric-guava-20.0 \
114  robolectric-junit-4.12 \
115  robolectric-icu4j-53.1 \
116  robolectric-ant-1.8.0 \
117  robolectric-asm-6.0 \
118  jsr305lib
119
120include external/robolectric-shadows/run_robolectric_module_tests.mk
121
122###########################################
123# HACK: specify these *TARGET* jars needed to compile robolectric as though they are prebuilt *HOST* java libraries
124###########################################
125LOCAL_PATH := $(LOCAL_PATH)/../../../
126include $(CLEAR_VARS)
127
128# Add this line to LOCAL_PREBUILT_JAVA_LIBRARIES below to compile robolectric against the latest SDK
129# robolectric-host-android_all:$(call java-lib-files, robolectric_android-all)
130
131# Add this line to LOCAL_PREBUILT_JAVA_LIBRARIES below to compile robolectric against the O SDK
132# robolectric-host-android_all:prebuilts/misc/common/robolectric/android-all/android-all-o-preview-4-robolectric-0.jar
133
134LOCAL_PREBUILT_JAVA_LIBRARIES := \
135  robolectric-host-android_all:$(call intermediates-dir-for, JAVA_LIBRARIES, robolectric_android-all-stub,,COMMON)/classes-with-res.jar \
136  robolectric-host-android-support-v4:$(call java-lib-files, android-support-v4) \
137  robolectric-host-android-support-multidex:$(call java-lib-files, android-support-multidex) \
138  robolectric-host-org_apache_http_legacy:$(call java-lib-files, org.apache.http.legacy) \
139  robolectric-host-monitor-1.0.2-alpha1:$(call java-lib-files, robolectric-monitor-1.0.2-alpha1)
140
141include $(BUILD_HOST_PREBUILT)
142