blob: 1a3aa8eec5ec8e9e9f8d162cdeab61eb34ee340f [file] [log] [blame]
Winson Chung10a9b4b2019-12-18 10:01:36 -08001// 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 Badour8a6a2bc2021-02-12 17:07:05 -080015package {
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"],
Liran Binyamin9ded80b2024-02-13 10:18:45 -050022 default_team: "trendy_team_multitasking_windowing",
Bob Badour8a6a2bc2021-02-12 17:07:05 -080023}
24
Winson Chungb754f522020-08-03 22:17:08 -070025// Begin ProtoLog
26java_library {
27 name: "wm_shell_protolog-groups",
28 srcs: [
29 "src/com/android/wm/shell/protolog/ShellProtoLogGroup.java",
30 ":protolog-common-src",
31 ],
32}
33
34filegroup {
35 name: "wm_shell-sources",
Bill Lin2b3bd572020-09-03 23:22:14 +080036 srcs: [
37 "src/**/*.java",
38 ],
39 path: "src",
40}
41
Winson Chung92a8e1a2021-10-16 21:44:25 -070042// Sources that have no dependencies that can be used directly downstream of this library
Luca Zuccarinid6073dc2024-01-22 17:06:41 +000043// TODO(b/322791067): move these sources to WindowManager-Shell-shared
Winson Chung2b72add2021-02-02 23:27:07 -080044filegroup {
Evan Rosky14ea8c62021-09-30 17:28:35 -070045 name: "wm_shell_util-sources",
46 srcs: [
Ivan Tkachenko1ef7e182023-06-13 18:17:00 +010047 "src/com/android/wm/shell/common/bubbles/*.kt",
48 "src/com/android/wm/shell/common/bubbles/*.java",
Alina Zaidife70f5f2024-05-22 13:24:52 +000049 "src/com/android/wm/shell/common/desktopmode/*.kt",
Hongwei Wangbe31a562023-01-26 13:10:28 -080050 "src/com/android/wm/shell/pip/PipContentOverlay.java",
Ivan Tkachenko1ef7e182023-06-13 18:17:00 +010051 "src/com/android/wm/shell/util/**/*.java",
Evan Rosky14ea8c62021-09-30 17:28:35 -070052 ],
53 path: "src",
54}
55
Winson Chung92a8e1a2021-10-16 21:44:25 -070056// Aidls which can be used directly downstream of this library
Evan Rosky14ea8c62021-09-30 17:28:35 -070057filegroup {
Winson Chung2b72add2021-02-02 23:27:07 -080058 name: "wm_shell-aidls",
59 srcs: [
60 "src/**/*.aidl",
61 ],
62 path: "src",
63}
64
Bill Lin2b3bd572020-09-03 23:22:14 +080065// TODO(b/168581922) protologtool do not support kotlin(*.kt)
66filegroup {
67 name: "wm_shell-sources-kt",
68 srcs: [
69 "src/**/*.kt",
70 ],
Winson Chungb754f522020-08-03 22:17:08 -070071 path: "src",
72}
73
74genrule {
75 name: "wm_shell_protolog_src",
76 srcs: [
Pablo Gamito5fe2c802024-02-12 12:48:48 +000077 ":protolog-impl",
Winson Chungb754f522020-08-03 22:17:08 -070078 ":wm_shell_protolog-groups",
79 ":wm_shell-sources",
80 ],
81 tools: ["protologtool"],
82 cmd: "$(location protologtool) transform-protolog-calls " +
Pablo Gamitof89a94d2024-06-28 10:40:42 +000083 "--protolog-class com.android.internal.protolog.ProtoLog " +
Ats Jenkf33f1da2021-12-14 14:10:20 -080084 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
85 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
Pablo Gamito5fe2c802024-02-12 12:48:48 +000086 "--viewer-config-file-path /system_ext/etc/wmshell.protolog.pb " +
87 "--legacy-viewer-config-file-path /system_ext/etc/wmshell.protolog.json.gz " +
88 "--legacy-output-file-path /data/misc/wmtrace/shell_log.winscope " +
Ats Jenkf33f1da2021-12-14 14:10:20 -080089 "--output-srcjar $(out) " +
90 "$(locations :wm_shell-sources)",
Winson Chungb754f522020-08-03 22:17:08 -070091 out: ["wm_shell_protolog.srcjar"],
92}
93
94genrule {
95 name: "generate-wm_shell_protolog.json",
96 srcs: [
97 ":wm_shell_protolog-groups",
98 ":wm_shell-sources",
99 ],
100 tools: ["protologtool"],
101 cmd: "$(location protologtool) generate-viewer-config " +
Pablo Gamitof89a94d2024-06-28 10:40:42 +0000102 "--protolog-class com.android.internal.protolog.ProtoLog " +
Ats Jenkf33f1da2021-12-14 14:10:20 -0800103 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
104 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
Pablo Gamito5fe2c802024-02-12 12:48:48 +0000105 "--viewer-config-type json " +
106 "--viewer-config $(out) " +
Ats Jenkf33f1da2021-12-14 14:10:20 -0800107 "$(locations :wm_shell-sources)",
Winson Chungb754f522020-08-03 22:17:08 -0700108 out: ["wm_shell_protolog.json"],
109}
Ats Jenkf33f1da2021-12-14 14:10:20 -0800110
Hongwei Wang2b227ee2022-08-19 09:38:18 -0700111genrule {
Pablo Gamito5fe2c802024-02-12 12:48:48 +0000112 name: "gen-wmshell.protolog.pb",
113 srcs: [
114 ":wm_shell_protolog-groups",
115 ":wm_shell-sources",
116 ],
117 tools: ["protologtool"],
118 cmd: "$(location protologtool) generate-viewer-config " +
Pablo Gamitof89a94d2024-06-28 10:40:42 +0000119 "--protolog-class com.android.internal.protolog.ProtoLog " +
Pablo Gamito5fe2c802024-02-12 12:48:48 +0000120 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
121 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
122 "--viewer-config-type proto " +
123 "--viewer-config $(out) " +
124 "$(locations :wm_shell-sources)",
125 out: ["wmshell.protolog.pb"],
126}
127
128genrule {
Hongwei Wang2b227ee2022-08-19 09:38:18 -0700129 name: "protolog.json.gz",
130 srcs: [":generate-wm_shell_protolog.json"],
131 out: ["wmshell.protolog.json.gz"],
Elliott Hughese135c402023-06-20 16:44:50 -0700132 cmd: "gzip -c < $(in) > $(out)",
Hongwei Wang2b227ee2022-08-19 09:38:18 -0700133}
134
135prebuilt_etc {
136 name: "wmshell.protolog.json.gz",
137 system_ext_specific: true,
138 src: ":protolog.json.gz",
139 filename_from_src: true,
140}
141
Pablo Gamito5fe2c802024-02-12 12:48:48 +0000142prebuilt_etc {
143 name: "wmshell.protolog.pb",
144 system_ext_specific: true,
145 src: ":gen-wmshell.protolog.pb",
146 filename_from_src: true,
147}
148
Winson Chungb754f522020-08-03 22:17:08 -0700149// End ProtoLog
150
Winson Chungeb1aa3d2020-08-25 19:02:29 -0700151java_library {
152 name: "WindowManager-Shell-proto",
153
154 srcs: ["proto/*.proto"],
155
156 proto: {
157 type: "nano",
158 },
159}
160
Shivangi Dubeya131137c2024-07-10 11:14:25 +0000161java_library {
162 name: "WindowManager-Shell-lite-proto",
163
164 srcs: ["src/com/android/wm/shell/desktopmode/education/data/proto/**/*.proto"],
165
166 proto: {
167 type: "lite",
168 },
169}
170
Luca Zuccarinia8aca21fc2024-03-15 13:12:50 +0000171filegroup {
172 name: "wm_shell-shared-aidls",
173
174 srcs: [
175 "shared/**/*.aidl",
176 ],
177
178 path: "shared/src",
179}
180
Luca Zuccarinid6073dc2024-01-22 17:06:41 +0000181java_library {
182 name: "WindowManager-Shell-shared",
183
Liran Binyamin4180ef02024-03-26 09:56:38 -0400184 srcs: [
185 "shared/**/*.java",
186 "shared/**/*.kt",
Luca Zuccarinia8aca21fc2024-03-15 13:12:50 +0000187 ":wm_shell-shared-aidls",
Liran Binyamin4180ef02024-03-26 09:56:38 -0400188 ],
189 static_libs: [
190 "androidx.dynamicanimation_dynamicanimation",
Luca Zuccarini42e79692024-03-14 15:57:46 +0000191 "jsr330",
Liran Binyamin4180ef02024-03-26 09:56:38 -0400192 ],
Luca Zuccarinid6073dc2024-01-22 17:06:41 +0000193}
194
Alina Zaidia4bd41d2024-07-05 15:07:26 +0000195java_library {
196 name: "WindowManager-Shell-shared-desktopMode",
197
198 srcs: [
199 "shared/**/desktopmode/*.java",
200 "shared/**/desktopmode/*.kt",
201 ],
202}
203
Winson Chung10a9b4b2019-12-18 10:01:36 -0800204android_library {
205 name: "WindowManager-Shell",
206 srcs: [
Winson Chungb754f522020-08-03 22:17:08 -0700207 ":wm_shell_protolog_src",
Bill Lin2b3bd572020-09-03 23:22:14 +0800208 // TODO(b/168581922) protologtool do not support kotlin(*.kt)
209 ":wm_shell-sources-kt",
Winson Chung2b72add2021-02-02 23:27:07 -0800210 ":wm_shell-aidls",
Winson Chung10a9b4b2019-12-18 10:01:36 -0800211 ],
212 resource_dirs: [
213 "res",
214 ],
Winson Chungb754f522020-08-03 22:17:08 -0700215 static_libs: [
Tony Huangeb01a252020-10-27 11:37:11 +0800216 "androidx.appcompat_appcompat",
Jeff DeCew86e318e2023-07-27 11:00:36 -0400217 "androidx.core_core-animation",
Jorge Gil4a0c2082023-09-05 16:18:24 +0000218 "androidx.core_core-ktx",
Tony Huangeb01a252020-10-27 11:37:11 +0800219 "androidx.arch.core_core-runtime",
Shivangi Dubeya131137c2024-07-10 11:14:25 +0000220 "androidx.datastore_datastore",
Jorge Gild45c35d2024-06-03 17:33:20 +0000221 "androidx.compose.material3_material3",
Ats Jenkf33f1da2021-12-14 14:10:20 -0800222 "androidx-constraintlayout_constraintlayout",
Bill Lin2b3bd572020-09-03 23:22:14 +0800223 "androidx.dynamicanimation_dynamicanimation",
Sunny Goyaldcdee332021-03-30 09:42:19 -0700224 "androidx.recyclerview_recyclerview",
Bill Lin2b3bd572020-09-03 23:22:14 +0800225 "kotlinx-coroutines-android",
226 "kotlinx-coroutines-core",
Luca Zuccarini1b8ed952024-04-24 10:17:48 +0000227 "//frameworks/libs/systemui:com_android_systemui_shared_flags_lib",
Peter Kalauskascd50f532024-04-02 15:41:14 -0700228 "//frameworks/libs/systemui:iconloader_base",
Winson Chungbfe7f262023-09-12 20:29:22 +0000229 "com_android_wm_shell_flags_lib",
Winson Chungeb1aa3d2020-08-25 19:02:29 -0700230 "WindowManager-Shell-proto",
Shivangi Dubeya131137c2024-07-10 11:14:25 +0000231 "WindowManager-Shell-lite-proto",
Luca Zuccarinid6073dc2024-01-22 17:06:41 +0000232 "WindowManager-Shell-shared",
Pablo Gamitod19d9912023-11-13 23:32:19 +0000233 "perfetto_trace_java_protos",
Winson Chungca5598d2021-11-04 19:22:25 -0700234 "dagger2",
Sunny Goyaldcdee332021-03-30 09:42:19 -0700235 "jsr330",
Winson Chungb754f522020-08-03 22:17:08 -0700236 ],
Colin Cross4a26fe82022-03-17 13:14:55 -0700237 libs: [
238 // Soong fails to automatically add this dependency because all the
239 // *.kt sources are inside a filegroup.
240 "kotlin-annotations",
241 ],
Pablo Gamito27506912024-07-16 15:33:10 +0000242 required: [
243 "wmshell.protolog.json.gz",
244 "wmshell.protolog.pb",
245 ],
Ats Jenka4027032024-06-14 13:03:25 -0700246 flags_packages: [
247 "com_android_wm_shell_flags",
248 ],
Colin Cross6954ea72023-07-18 10:52:21 -0700249 kotlincflags: ["-Xjvm-default=all"],
Winson Chung10a9b4b2019-12-18 10:01:36 -0800250 manifest: "AndroidManifest.xml",
Winson Chungca5598d2021-11-04 19:22:25 -0700251 plugins: ["dagger2-compiler"],
Colin Cross085e8c92023-10-03 16:28:21 -0700252 use_resource_processor: true,
Dave Mankoff9179b302020-12-02 11:15:27 -0500253}