blob: 90dac47e353c1c9d2e1721c934c01dbe48002527 [file] [log] [blame]
Colin Cross35be4242018-11-20 09:46:47 -08001//########################################################################
2// Build WmTests package
3//########################################################################
4
Bob Badoure539dba2021-02-12 17:07:05 -08005package {
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
Hongwei Wang6014caf2020-07-20 18:04:35 -070014// 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
Colin Cross35be4242018-11-20 09:46:47 -080040android_test {
41 name: "WmTests",
42
43 // We only want this apk build for tests.
Hongwei Wang6014caf2020-07-20 18:04:35 -070044 srcs: [":wmtests.protologsrc"],
Colin Cross35be4242018-11-20 09:46:47 -080045
46 static_libs: [
Ram Muthiaha4bb0442019-12-11 17:37:00 -080047 "frameworks-base-testutils",
Colin Cross35be4242018-11-20 09:46:47 -080048 "services.core",
49 "androidx.test.runner",
50 "androidx.test.rules",
51 "mockito-target-extended-minus-junit4",
52 "platform-test-annotations",
53 "servicestests-utils",
Yuncheol Heo13a6eb62020-03-04 23:50:37 -080054 "testng",
Colin Cross35be4242018-11-20 09:46:47 -080055 "truth-prebuilt",
56 "testables",
57 "ub-uiautomator",
58 "hamcrest-library",
Benjamin Franz06bb87d2020-11-16 16:56:13 +000059 "platform-compat-test-rules",
Colin Cross35be4242018-11-20 09:46:47 -080060 ],
61
62 libs: [
Jeongik Cha969b9212021-01-28 00:49:47 +090063 "android.hardware.power-V1-java",
Colin Cross35be4242018-11-20 09:46:47 -080064 "android.test.mock",
65 "android.test.base",
66 "android.test.runner",
67 ],
68
69 // These are not normally accessible from apps so they must be explicitly included.
70 jni_libs: [
71 "libdexmakerjvmtiagent",
72 "libstaticjvmtiagent",
73 ],
74
75 platform_apis: true,
76 test_suites: ["device-tests"],
77
78 certificate: "platform",
79
80 dxflags: ["--multi-dex"],
81
82 optimize: {
83 enabled: false,
84 },
85
86}