1############################################## 2# Compile Robolectric processor 3############################################## 4LOCAL_PATH := $(call my-dir) 5include $(CLEAR_VARS) 6 7LOCAL_MODULE := Robolectric_processor 8LOCAL_MODULE_CLASS := JAVA_LIBRARIES 9LOCAL_IS_HOST_MODULE := true 10 11sdks_txt_file := $(call local-intermediates-dir)/sdks.txt 12 13LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java) 14 15LOCAL_JAVA_RESOURCE_DIRS := src/main/resources 16 17LOCAL_CLASSPATH := $(HOST_JDK_TOOLS_JAR) 18 19LOCAL_JAVA_LIBRARIES := \ 20 Robolectric_annotations \ 21 Robolectric_shadowapi \ 22 robolectric-asm-commons-6.0 \ 23 robolectric-guava-25.1-jre \ 24 robolectric-asm-tree-6.0 \ 25 robolectric-gson-2.8 \ 26 robolectric-asm-6.0 \ 27 jsr305 28 29LOCAL_JAVA_RESOURCE_FILES := $(sdks_txt_file) 30 31$(sdks_txt_file): private_top := $(TOP) 32 33$(sdks_txt_file): 34 $(hide) rm -f $@ 35 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-4.1.2_r1-robolectric-r1.jar" >>$@ 36 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-4.2.2_r1.2-robolectric-r1.jar" >>$@ 37 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-4.3_r2-robolectric-r1.jar" >>$@ 38 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-4.4_r1-robolectric-r2.jar" >>$@ 39 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-5.0.2_r3-robolectric-r0.jar" >>$@ 40 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-5.1.1_r9-robolectric-r2.jar" >>$@ 41 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-6.0.1_r3-robolectric-r1.jar" >>$@ 42 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-7.0.0_r1-robolectric-r1.jar" >>$@ 43 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-7.1.0_r7-robolectric-r1.jar" >>$@ 44 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-8.0.0_r4-robolectric-r1.jar" >>$@ 45 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-8.1.0-robolectric-4611349.jar" >>$@ 46 $(hide) echo "$(private_top)/prebuilts/misc/common/robolectric/android-all/android-all-9-robolectric-4913185-2.jar" >>$@ 47 48ifdef TARGET_OPENJDK9 49LOCAL_JAVACFLAGS := \ 50 --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ 51 --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED 52endif 53 54include $(BUILD_HOST_JAVA_LIBRARY) 55 56############################################## 57# Compile Robolectric processor tests 58############################################## 59include $(CLEAR_VARS) 60 61LOCAL_MODULE := Robolectric_processor_tests 62 63LOCAL_SRC_FILES := $(call all-java-files-under, src/test/java) 64 65LOCAL_JAVA_RESOURCE_DIRS := src/test/resources 66 67LOCAL_JAVA_RESOURCE_FILES := $(LOCAL_PATH)/src/test/resources 68 69LOCAL_JAVA_LIBRARIES := \ 70 Robolectric_annotations \ 71 Robolectric_processor \ 72 robolectric-compile-testing-0.15 \ 73 robolectric-mockito-core-2.16.0 \ 74 robolectric-guava-25.1-jre \ 75 robolectric-junit-4.12 \ 76 robolectric-truth-0.42 \ 77 robolectric-gson-2.8 \ 78 jsr305 79 80# Disable annotation processing while compiling tests to avoid executing RobolectricProcessor. 81LOCAL_JAVACFLAGS := -proc:none 82 83include $(BUILD_HOST_JAVA_LIBRARY) 84 85############################################## 86# Execute Robolectric processor tests 87############################################## 88include $(CLEAR_VARS) 89 90LOCAL_MODULE := Run_robolectric_processor_tests 91 92test_source_directory := $(LOCAL_PATH)/src/test/java 93 94test_runtime_libraries := \ 95 Robolectric_processor_tests \ 96 Robolectric_annotations \ 97 Robolectric_processor \ 98 Robolectric_shadowapi \ 99 robolectric-javax.annotation-api-1.2 \ 100 robolectric-byte-buddy-agent-1.6.5 \ 101 robolectric-compile-testing-0.15 \ 102 robolectric-mockito-core-2.16.0 \ 103 robolectric-hamcrest-core-1.3 \ 104 robolectric-byte-buddy-1.6.5 \ 105 robolectric-guava-25.1-jre \ 106 robolectric-objenesis-2.5 \ 107 robolectric-junit-4.12 \ 108 robolectric-truth-0.42 \ 109 robolectric-gson-2.8 \ 110 jsr305 111 112include external/robolectric-shadows/run_robolectric_module_tests.mk 113