1//#############################################
2// Compile Robolectric robolectric
3//#############################################
4
5package {
6    // See: http://go/android-license-faq
7    // A large-scale-change added 'default_applicable_licenses' to import
8    // all of the 'license_kinds' from "external_robolectric-shadows_license"
9    // to get the below license kinds:
10    //   SPDX-license-identifier-Apache-2.0
11    default_applicable_licenses: ["external_robolectric-shadows_license"],
12}
13
14java_library_host {
15    name: "Robolectric_robolectric",
16    libs: [
17        "Robolectric_shadows_framework",
18        "Robolectric_annotations",
19        "Robolectric_shadowapi",
20        "Robolectric_resources",
21        "Robolectric_sandbox",
22        "Robolectric_junit",
23        "Robolectric_utils",
24        "robolectric-host-androidx-test-ext-junit",
25        "robolectric-host-androidx-test-monitor",
26        "robolectric-maven-ant-tasks-2.1.3",
27        "bouncycastle-unbundled",
28        "asm-commons-6.0",
29        "guava",
30        "robolectric-xstream-1.4.8",
31        "asm-tree-6.0",
32        "junit",
33        "robolectric-ant-1.8.0",
34        "asm-6.0",
35        "jsr305",
36        "robolectric-host-android_all",
37    ],
38    srcs: ["src/main/java/**/*.java"],
39
40    java_resources: [":robolectric-version.properties"],
41}
42
43genrule {
44    name: "robolectric-version.properties",
45    out: ["robolectric-version.properties"],
46    cmd: "echo -n 'robolectric.version=4.0-SNAPSHOT' > $(out)",
47}
48
49//#############################################
50// Compile Robolectric robolectric tests
51//#############################################
52java_test_host {
53    name: "Robolectric_robolectric_tests",
54    srcs: ["src/test/java/**/*.java"],
55    java_resource_dirs: ["src/test/resources"],
56    static_libs: [
57        "Robolectric_robolectric",
58        "Robolectric_shadows_framework",
59        "Robolectric_annotations",
60        "Robolectric_shadowapi",
61        "Robolectric_resources",
62        "Robolectric_sandbox",
63        "Robolectric_junit",
64        "Robolectric_utils",
65        "robolectric-host-androidx-test-ext-junit",
66        "robolectric-host-androidx-test-monitor",
67        "robolectric-host-androidx-test-core",
68        "robolectric-maven-ant-tasks-2.1.3",
69        "mockito",
70        "bouncycastle-unbundled",
71        "hamcrest",
72        "robolectric-sqlite4java-0.282",
73        "asm-commons-6.0",
74        "robolectric-diffutils-1.3.0",
75        "guava",
76        "objenesis",
77        "robolectric-xstream-1.4.8",
78        "asm-tree-6.0",
79        "junit",
80        "icu4j",
81        "truth-prebuilt",
82        "robolectric-ant-1.8.0",
83        "asm-6.0",
84        "jsr305",
85    ],
86    libs: ["robolectric-host-android_all"],
87    // Robolectric tests do not work well with unit tests setup yet
88    test_options: {
89        unit_test: false,
90    },
91}
92