1//########################################################################
2// Build WmTests package
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 "frameworks_base_license"
9    // to get the below license kinds:
10    //   SPDX-license-identifier-Apache-2.0
11    default_applicable_licenses: ["frameworks_base_license"],
12}
13
14// Include all test java files.
15filegroup {
16    name: "wmtests-sources",
17    srcs: [
18        "src/**/*.java",
19    ],
20}
21
22genrule {
23    name: "wmtests.protologsrc",
24    srcs: [
25        ":protolog-groups",
26        ":wmtests-sources",
27    ],
28    tools: ["protologtool"],
29    cmd: "$(location protologtool) transform-protolog-calls " +
30        "--protolog-class com.android.internal.protolog.common.ProtoLog " +
31        "--protolog-impl-class com.android.internal.protolog.ProtoLogImpl " +
32        "--protolog-cache-class 'com.android.server.wm.ProtoLogCache' " +
33        "--loggroups-class com.android.internal.protolog.ProtoLogGroup " +
34        "--loggroups-jar $(location :protolog-groups) " +
35        "--output-srcjar $(out) " +
36        "$(locations :wmtests-sources)",
37    out: ["wmtests.protolog.srcjar"],
38}
39
40android_test {
41    name: "WmTests",
42
43    // We only want this apk build for tests.
44    srcs: [
45        ":wmtests.protologsrc",
46        "src/**/*.aidl",
47    ],
48
49    static_libs: [
50        "frameworks-base-testutils",
51        "services.core",
52        "androidx.test.runner",
53        "androidx.test.rules",
54        "junit-params",
55        "mockito-target-extended-minus-junit4",
56        "platform-test-annotations",
57        "servicestests-utils",
58        "testng",
59        "truth-prebuilt",
60        "testables",
61        "ub-uiautomator",
62        "hamcrest-library",
63        "platform-compat-test-rules",
64        "CtsSurfaceValidatorLib",
65        "service-sdksandbox.impl",
66    ],
67
68    libs: [
69        "android.hardware.power-V1-java",
70        "android.test.mock",
71        "android.test.base",
72        "android.test.runner",
73    ],
74
75    defaults: [
76        "modules-utils-testable-device-config-defaults",
77    ],
78
79    // These are not normally accessible from apps so they must be explicitly included.
80    jni_libs: [
81        "libdexmakerjvmtiagent",
82        "libstaticjvmtiagent",
83    ],
84
85    platform_apis: true,
86    test_suites: [
87        "device-tests",
88        "automotive-tests",
89    ],
90
91    certificate: "platform",
92
93    dxflags: ["--multi-dex"],
94
95    optimize: {
96        enabled: false,
97    },
98
99}
100