Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 1 | // Copyright (C) 2019 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Bob Badour | 8a6a2bc | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 15 | package { |
| 16 | // See: http://go/android-license-faq |
| 17 | // A large-scale-change added 'default_applicable_licenses' to import |
| 18 | // all of the 'license_kinds' from "frameworks_base_license" |
| 19 | // to get the below license kinds: |
| 20 | // SPDX-license-identifier-Apache-2.0 |
| 21 | default_applicable_licenses: ["frameworks_base_license"], |
| 22 | } |
| 23 | |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 24 | // Begin ProtoLog |
| 25 | java_library { |
| 26 | name: "wm_shell_protolog-groups", |
| 27 | srcs: [ |
| 28 | "src/com/android/wm/shell/protolog/ShellProtoLogGroup.java", |
| 29 | ":protolog-common-src", |
| 30 | ], |
| 31 | } |
| 32 | |
| 33 | filegroup { |
| 34 | name: "wm_shell-sources", |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 35 | srcs: [ |
| 36 | "src/**/*.java", |
| 37 | ], |
| 38 | path: "src", |
| 39 | } |
| 40 | |
Winson Chung | 92a8e1a | 2021-10-16 21:44:25 -0700 | [diff] [blame] | 41 | // Sources that have no dependencies that can be used directly downstream of this library |
Winson Chung | 2b72add | 2021-02-02 23:27:07 -0800 | [diff] [blame] | 42 | filegroup { |
Evan Rosky | 14ea8c6 | 2021-09-30 17:28:35 -0700 | [diff] [blame] | 43 | name: "wm_shell_util-sources", |
| 44 | srcs: [ |
Pat Manning | f7d61d7 | 2022-09-07 17:33:41 +0100 | [diff] [blame] | 45 | "src/com/android/wm/shell/animation/Interpolators.java", |
Ivan Tkachenko | 1ef7e18 | 2023-06-13 18:17:00 +0100 | [diff] [blame] | 46 | "src/com/android/wm/shell/animation/PhysicsAnimator.kt", |
| 47 | "src/com/android/wm/shell/common/bubbles/*.kt", |
| 48 | "src/com/android/wm/shell/common/bubbles/*.java", |
| 49 | "src/com/android/wm/shell/common/magnetictarget/MagnetizedObject.kt", |
| 50 | "src/com/android/wm/shell/common/split/SplitScreenConstants.java", |
| 51 | "src/com/android/wm/shell/common/TransactionPool.java", |
| 52 | "src/com/android/wm/shell/common/TriangleShape.java", |
| 53 | "src/com/android/wm/shell/draganddrop/DragAndDropConstants.java", |
Hongwei Wang | be31a56 | 2023-01-26 13:10:28 -0800 | [diff] [blame] | 54 | "src/com/android/wm/shell/pip/PipContentOverlay.java", |
Pat Manning | f7d61d7 | 2022-09-07 17:33:41 +0100 | [diff] [blame] | 55 | "src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java", |
Ivan Tkachenko | 1ef7e18 | 2023-06-13 18:17:00 +0100 | [diff] [blame] | 56 | "src/com/android/wm/shell/sysui/ShellSharedConstants.java", |
| 57 | "src/com/android/wm/shell/util/**/*.java", |
Evan Rosky | 14ea8c6 | 2021-09-30 17:28:35 -0700 | [diff] [blame] | 58 | ], |
| 59 | path: "src", |
| 60 | } |
| 61 | |
Winson Chung | 92a8e1a | 2021-10-16 21:44:25 -0700 | [diff] [blame] | 62 | // Aidls which can be used directly downstream of this library |
Evan Rosky | 14ea8c6 | 2021-09-30 17:28:35 -0700 | [diff] [blame] | 63 | filegroup { |
Winson Chung | 2b72add | 2021-02-02 23:27:07 -0800 | [diff] [blame] | 64 | name: "wm_shell-aidls", |
| 65 | srcs: [ |
| 66 | "src/**/*.aidl", |
| 67 | ], |
| 68 | path: "src", |
| 69 | } |
| 70 | |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 71 | // TODO(b/168581922) protologtool do not support kotlin(*.kt) |
| 72 | filegroup { |
| 73 | name: "wm_shell-sources-kt", |
| 74 | srcs: [ |
| 75 | "src/**/*.kt", |
| 76 | ], |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 77 | path: "src", |
| 78 | } |
| 79 | |
| 80 | genrule { |
| 81 | name: "wm_shell_protolog_src", |
| 82 | srcs: [ |
| 83 | ":wm_shell_protolog-groups", |
| 84 | ":wm_shell-sources", |
| 85 | ], |
| 86 | tools: ["protologtool"], |
| 87 | cmd: "$(location protologtool) transform-protolog-calls " + |
Ats Jenk | f33f1da | 2021-12-14 14:10:20 -0800 | [diff] [blame] | 88 | "--protolog-class com.android.internal.protolog.common.ProtoLog " + |
| 89 | "--protolog-impl-class com.android.wm.shell.protolog.ShellProtoLogImpl " + |
| 90 | "--protolog-cache-class com.android.wm.shell.protolog.ShellProtoLogCache " + |
| 91 | "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " + |
| 92 | "--loggroups-jar $(location :wm_shell_protolog-groups) " + |
| 93 | "--output-srcjar $(out) " + |
| 94 | "$(locations :wm_shell-sources)", |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 95 | out: ["wm_shell_protolog.srcjar"], |
| 96 | } |
| 97 | |
| 98 | genrule { |
| 99 | name: "generate-wm_shell_protolog.json", |
| 100 | srcs: [ |
| 101 | ":wm_shell_protolog-groups", |
| 102 | ":wm_shell-sources", |
| 103 | ], |
| 104 | tools: ["protologtool"], |
| 105 | cmd: "$(location protologtool) generate-viewer-config " + |
Ats Jenk | f33f1da | 2021-12-14 14:10:20 -0800 | [diff] [blame] | 106 | "--protolog-class com.android.internal.protolog.common.ProtoLog " + |
| 107 | "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " + |
| 108 | "--loggroups-jar $(location :wm_shell_protolog-groups) " + |
| 109 | "--viewer-conf $(out) " + |
| 110 | "$(locations :wm_shell-sources)", |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 111 | out: ["wm_shell_protolog.json"], |
| 112 | } |
Ats Jenk | f33f1da | 2021-12-14 14:10:20 -0800 | [diff] [blame] | 113 | |
Hongwei Wang | 2b227ee | 2022-08-19 09:38:18 -0700 | [diff] [blame] | 114 | genrule { |
| 115 | name: "protolog.json.gz", |
| 116 | srcs: [":generate-wm_shell_protolog.json"], |
| 117 | out: ["wmshell.protolog.json.gz"], |
Elliott Hughes | e135c40 | 2023-06-20 16:44:50 -0700 | [diff] [blame] | 118 | cmd: "gzip -c < $(in) > $(out)", |
Hongwei Wang | 2b227ee | 2022-08-19 09:38:18 -0700 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | prebuilt_etc { |
| 122 | name: "wmshell.protolog.json.gz", |
| 123 | system_ext_specific: true, |
| 124 | src: ":protolog.json.gz", |
| 125 | filename_from_src: true, |
| 126 | } |
| 127 | |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 128 | // End ProtoLog |
| 129 | |
Winson Chung | eb1aa3d | 2020-08-25 19:02:29 -0700 | [diff] [blame] | 130 | java_library { |
| 131 | name: "WindowManager-Shell-proto", |
| 132 | |
| 133 | srcs: ["proto/*.proto"], |
| 134 | |
| 135 | proto: { |
| 136 | type: "nano", |
| 137 | }, |
| 138 | } |
| 139 | |
Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 140 | android_library { |
| 141 | name: "WindowManager-Shell", |
| 142 | srcs: [ |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 143 | ":wm_shell_protolog_src", |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 144 | // TODO(b/168581922) protologtool do not support kotlin(*.kt) |
| 145 | ":wm_shell-sources-kt", |
Winson Chung | 2b72add | 2021-02-02 23:27:07 -0800 | [diff] [blame] | 146 | ":wm_shell-aidls", |
Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 147 | ], |
| 148 | resource_dirs: [ |
| 149 | "res", |
| 150 | ], |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 151 | static_libs: [ |
Tony Huang | eb01a25 | 2020-10-27 11:37:11 +0800 | [diff] [blame] | 152 | "androidx.appcompat_appcompat", |
Jeff DeCew | 86e318e | 2023-07-27 11:00:36 -0400 | [diff] [blame] | 153 | "androidx.core_core-animation", |
Jorge Gil | 4a0c208 | 2023-09-05 16:18:24 +0000 | [diff] [blame] | 154 | "androidx.core_core-ktx", |
Tony Huang | eb01a25 | 2020-10-27 11:37:11 +0800 | [diff] [blame] | 155 | "androidx.arch.core_core-runtime", |
Ats Jenk | f33f1da | 2021-12-14 14:10:20 -0800 | [diff] [blame] | 156 | "androidx-constraintlayout_constraintlayout", |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 157 | "androidx.dynamicanimation_dynamicanimation", |
Sunny Goyal | dcdee33 | 2021-03-30 09:42:19 -0700 | [diff] [blame] | 158 | "androidx.recyclerview_recyclerview", |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 159 | "kotlinx-coroutines-android", |
| 160 | "kotlinx-coroutines-core", |
Tony Huang | eb01a25 | 2020-10-27 11:37:11 +0800 | [diff] [blame] | 161 | "iconloader_base", |
Winson Chung | bfe7f26 | 2023-09-12 20:29:22 +0000 | [diff] [blame] | 162 | "com_android_wm_shell_flags_lib", |
Winson Chung | c3c3e96 | 2023-11-30 22:43:38 +0000 | [diff] [blame] | 163 | "com.android.window.flags.window-aconfig-java", |
Winson Chung | eb1aa3d | 2020-08-25 19:02:29 -0700 | [diff] [blame] | 164 | "WindowManager-Shell-proto", |
Pablo Gamito | d19d991 | 2023-11-13 23:32:19 +0000 | [diff] [blame^] | 165 | "perfetto_trace_java_protos", |
Winson Chung | ca5598d | 2021-11-04 19:22:25 -0700 | [diff] [blame] | 166 | "dagger2", |
Sunny Goyal | dcdee33 | 2021-03-30 09:42:19 -0700 | [diff] [blame] | 167 | "jsr330", |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 168 | ], |
Colin Cross | 4a26fe8 | 2022-03-17 13:14:55 -0700 | [diff] [blame] | 169 | libs: [ |
| 170 | // Soong fails to automatically add this dependency because all the |
| 171 | // *.kt sources are inside a filegroup. |
| 172 | "kotlin-annotations", |
| 173 | ], |
Colin Cross | 6954ea7 | 2023-07-18 10:52:21 -0700 | [diff] [blame] | 174 | kotlincflags: ["-Xjvm-default=all"], |
Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 175 | manifest: "AndroidManifest.xml", |
Winson Chung | ca5598d | 2021-11-04 19:22:25 -0700 | [diff] [blame] | 176 | plugins: ["dagger2-compiler"], |
Colin Cross | 085e8c9 | 2023-10-03 16:28:21 -0700 | [diff] [blame] | 177 | use_resource_processor: true, |
Dave Mankoff | 9179b30 | 2020-12-02 11:15:27 -0500 | [diff] [blame] | 178 | } |
Liran Binyamin | 232a6987 | 2023-10-26 16:45:31 -0400 | [diff] [blame] | 179 | |
| 180 | android_app { |
| 181 | name: "WindowManagerShellRobolectric", |
| 182 | platform_apis: true, |
| 183 | static_libs: [ |
| 184 | "WindowManager-Shell", |
| 185 | ], |
| 186 | manifest: "multivalentTests/AndroidManifestRobolectric.xml", |
| 187 | use_resource_processor: true, |
| 188 | } |
| 189 | |
| 190 | android_robolectric_test { |
| 191 | name: "WMShellRobolectricTests", |
| 192 | instrumentation_for: "WindowManagerShellRobolectric", |
| 193 | upstream: true, |
| 194 | java_resource_dirs: [ |
| 195 | "multivalentTests/robolectric/config", |
| 196 | ], |
| 197 | srcs: [ |
| 198 | "multivalentTests/src/**/*.kt", |
| 199 | ], |
| 200 | static_libs: [ |
| 201 | "junit", |
| 202 | "androidx.test.runner", |
| 203 | "androidx.test.rules", |
| 204 | "androidx.test.ext.junit", |
| 205 | "mockito-robolectric-prebuilt", |
| 206 | "mockito-kotlin2", |
| 207 | "truth", |
| 208 | ], |
| 209 | } |
| 210 | |
| 211 | android_test { |
| 212 | name: "WMShellMultivalentTestsOnDevice", |
| 213 | srcs: [ |
| 214 | "multivalentTests/src/**/*.kt", |
| 215 | ], |
| 216 | static_libs: [ |
| 217 | "WindowManager-Shell", |
| 218 | "junit", |
| 219 | "androidx.test.runner", |
| 220 | "androidx.test.rules", |
| 221 | "androidx.test.ext.junit", |
| 222 | "frameworks-base-testutils", |
| 223 | "mockito-kotlin2", |
| 224 | "mockito-target-extended-minus-junit4", |
| 225 | "truth", |
| 226 | "platform-test-annotations", |
| 227 | "platform-test-rules", |
| 228 | ], |
| 229 | libs: [ |
| 230 | "android.test.base", |
| 231 | "android.test.runner", |
| 232 | ], |
| 233 | jni_libs: [ |
| 234 | "libdexmakerjvmtiagent", |
| 235 | "libstaticjvmtiagent", |
| 236 | ], |
| 237 | kotlincflags: ["-Xjvm-default=all"], |
| 238 | optimize: { |
| 239 | enabled: false, |
| 240 | }, |
| 241 | test_suites: ["device-tests"], |
| 242 | platform_apis: true, |
| 243 | certificate: "platform", |
| 244 | aaptflags: [ |
| 245 | "--extra-packages", |
| 246 | "com.android.wm.shell", |
| 247 | ], |
| 248 | manifest: "multivalentTests/AndroidManifest.xml", |
| 249 | } |