1package {
2    default_team: "trendy_team_android_settings_app",
3    // See: http://go/android-license-faq
4    // A large-scale-change added 'default_applicable_licenses' to import
5    // all of the 'license_kinds' from "packages_apps_Settings_license"
6    // to get the below license kinds:
7    //   SPDX-license-identifier-Apache-2.0
8    default_applicable_licenses: ["packages_apps_Settings_license"],
9}
10
11// Build SettingsRoboTestStub.apk which includes test-only resources.
12android_app {
13    name: "SettingsRoboTestStub",
14    defaults: [
15        "SettingsLib-search-defaults",
16        "SettingsLibDefaults",
17    ],
18    platform_apis: true,
19    certificate: "platform",
20    privileged: true,
21    use_resource_processor: true,
22    resource_dirs: ["res"],
23
24    static_libs: [
25        "Settings-core",
26        "androidx.fragment_fragment",
27        "androidx.fragment_fragment-testing",
28        "androidx.lifecycle_lifecycle-runtime-testing",
29        "frameworks-base-testutils",
30        "kotlinx_coroutines_test",
31    ],
32
33    aaptflags: ["--extra-packages com.android.settings"],
34
35    libs: [
36        "ims-common",
37        "telephony-common",
38    ],
39    uses_libs: ["org.apache.http.legacy"],
40    optional_uses_libs: [
41        "androidx.window.extensions",
42        "androidx.window.sidecar",
43    ],
44}
45
46// Settings Robolectric test target.
47android_robolectric_test {
48    name: "SettingsRoboTests",
49    srcs: [
50        "src/**/*.java",
51        "src/**/*.kt",
52    ],
53
54    // test_suites attribute is not needed. This module will be configured in ATP GCL file.
55
56    static_libs: [
57        "Robolectric_shadows_androidx_fragment_upstream",
58        "Settings-robo-testutils",
59        "Settings-testutils2",
60        "SettingsLib-robo-testutils",
61        "SettingsLibPreference-testutils",
62        "Settings_robolectric_meta_service_file",
63        "aconfig_settings_flags_lib",
64        "android.webkit.flags-aconfig-java",
65        "androidx.test.core",
66        "androidx.test.espresso.core",
67        "androidx.test.ext.junit",
68        "androidx.test.rules",
69        "androidx.test.runner",
70        "com_android_server_accessibility_flags_lib",
71        "flag-junit",
72        "flag-junit-base",
73        "kotlin-test",
74        "mockito-robolectric-prebuilt", // mockito deps order matters!
75        "mockito-kotlin2",
76        "notification_flags_lib",
77        "platform-test-annotations",
78        "testables",
79        "android.app.flags-aconfig-java",
80    ],
81
82    libs: [
83        "android.test.mock.impl",
84        "ims-common",
85    ],
86
87    java_resource_dirs: [
88        "config",
89        "resources",
90    ],
91
92    instrumentation_for: "SettingsRoboTestStub",
93
94    test_options: {
95        timeout: 36000,
96        shards: 10,
97    },
98
99    coverage_libs: [
100        "Settings-core",
101        "SettingsLib",
102        "SettingsLib-search",
103    ],
104
105    upstream: true,
106
107    strict_mode: false,
108}
109
110java_library {
111    name: "Settings-robo-testutils",
112    srcs: [
113        "testutils/**/*.java",
114        "testutils/**/*.kt",
115    ],
116    libs: [
117        "Robolectric_all-target_upstream",
118        "Settings-core",
119        "mockito-robolectric-prebuilt",
120        "truth",
121    ],
122}
123