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: [":wmtests.protologsrc"], 45 46 static_libs: [ 47 "frameworks-base-testutils", 48 "services.core", 49 "androidx.test.runner", 50 "androidx.test.rules", 51 "mockito-target-extended-minus-junit4", 52 "platform-test-annotations", 53 "servicestests-utils", 54 "testng", 55 "truth-prebuilt", 56 "testables", 57 "ub-uiautomator", 58 "hamcrest-library", 59 "platform-compat-test-rules", 60 ], 61 62 libs: [ 63 "android.hardware.power-V1-java", 64 "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} 87