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 14filegroup { 15 name: "wmtests-support-sources", 16 srcs: [ 17 "src/com/android/server/wm/WindowManagerServiceTestSupport.kt", 18 ], 19 path: "src", 20 visibility: ["//visibility:private"], 21} 22 23java_library { 24 name: "wmtests-support", 25 srcs: [":wmtests-support-sources"], 26 static_libs: [ 27 "com.android.window.flags.window-aconfig-java", 28 "kotlin-stdlib", 29 "services.core", 30 ], 31 lint: { 32 test: true, 33 }, 34 visibility: [ 35 "//frameworks/base/services/tests/wmtests", 36 "//frameworks/opt/car/services/updatableServices/tests", 37 ], 38} 39 40// Include all test files, but exclude test support files. 41filegroup { 42 name: "wmtests-sources", 43 srcs: ["src/**/*.java"], 44 exclude_srcs: [":wmtests-support-sources"], 45 path: "src", 46 visibility: ["//visibility:private"], 47} 48 49java_genrule { 50 name: "wmtests.protologsrc", 51 srcs: [ 52 ":protolog-groups", 53 ":protolog-impl", 54 ":wmtests-sources", 55 ], 56 tools: ["protologtool"], 57 cmd: "$(location protologtool) transform-protolog-calls " + 58 "--protolog-class com.android.internal.protolog.ProtoLog " + 59 "--loggroups-class com.android.internal.protolog.WmProtoLogGroups " + 60 "--loggroups-jar $(location :protolog-groups) " + 61 // Used for the ProtoLogIntegrationTest, where don't test decoding or writing to file 62 // so the parameters below are irrelevant. 63 "--viewer-config-file-path /some/unused/file/path.pb " + 64 "--legacy-viewer-config-file-path /some/unused/file/path.json.gz " + 65 "--legacy-output-file-path /some/unused/file/path.winscope " + 66 // END of irrelevant params. 67 "--output-srcjar $(out) " + 68 "$(locations :wmtests-sources)", 69 out: ["wmtests.protolog.srcjar"], 70} 71 72android_test { 73 name: "WmTests", 74 75 // We only want this apk build for tests. 76 srcs: [ 77 ":wmtests-sources", 78 "src/**/*.aidl", 79 ], 80 81 static_libs: [ 82 "CtsSurfaceValidatorLib", 83 "android.view.inputmethod.flags-aconfig-java", 84 "androidx.test.rules", 85 "androidx.test.runner", 86 "com.android.window.flags.window-aconfig-java", 87 "cts-input-lib", 88 "flag-junit", 89 "flickerlib", 90 "frameworks-base-testutils", 91 "hamcrest-library", 92 "junit-params", 93 "mockito-kotlin2", 94 "mockito-target-extended-minus-junit4", 95 "platform-compat-test-rules", 96 "platform-test-annotations", 97 "service-permission.stubs.system_server", 98 "service-sdksandbox.impl", 99 "services.core", 100 "servicestests-utils", 101 "testables", 102 "testng", 103 "truth", 104 "wmtests-support", 105 ], 106 107 libs: [ 108 "android.hardware.power-V1-java", 109 "android.test.base.stubs.system", 110 "android.test.mock.stubs.system", 111 "android.test.runner.stubs.system", 112 ], 113 114 defaults: [ 115 "modules-utils-testable-device-config-defaults", 116 ], 117 118 // These are not normally accessible from apps so they must be explicitly included. 119 jni_libs: [ 120 "libdexmakerjvmtiagent", 121 "libstaticjvmtiagent", 122 ], 123 124 platform_apis: true, 125 test_suites: [ 126 "automotive-tests", 127 "device-tests", 128 ], 129 130 certificate: "platform", 131 132 dxflags: ["--multi-dex"], 133 134 optimize: { 135 enabled: false, 136 }, 137 138 data: [ 139 ":OverlayTestApp", 140 ], 141} 142 143test_module_config { 144 name: "WmTests_server_policy_Presubmit", 145 base: "WmTests", 146 test_suites: [ 147 "automotive-tests", 148 "device-tests", 149 ], 150 include_filters: ["com.android.server.policy."], 151 include_annotations: ["android.platform.test.annotations.Presubmit"], 152} 153 154test_module_config { 155 name: "WmTests_server_policy", 156 base: "WmTests", 157 test_suites: [ 158 "automotive-tests", 159 "device-tests", 160 ], 161 include_filters: ["com.android.server.policy."], 162} 163 164test_module_config { 165 name: "WmTests_wm_utils_Presubmit", 166 base: "WmTests", 167 test_suites: [ 168 "automotive-tests", 169 "device-tests", 170 ], 171 include_filters: ["com.android.server.wm.utils"], 172 include_annotations: ["android.platform.test.annotations.Presubmit"], 173} 174