blob: b338a2ae2b79bff45a1f5aebb2a44e21c7328245 [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",
Evan Rosky14ea8c62021-09-30 17:28:35 -070049 ],
50 path: "src",
51}
52
Winson Chung92a8e1a2021-10-16 21:44:25 -070053// Aidls which can be used directly downstream of this library
Evan Rosky14ea8c62021-09-30 17:28:35 -070054filegroup {
Winson Chung2b72add2021-02-02 23:27:07 -080055 name: "wm_shell-aidls",
56 srcs: [
57 "src/**/*.aidl",
58 ],
59 path: "src",
60}
61
Bill Lin2b3bd572020-09-03 23:22:14 +080062// TODO(b/168581922) protologtool do not support kotlin(*.kt)
63filegroup {
64 name: "wm_shell-sources-kt",
65 srcs: [
66 "src/**/*.kt",
67 ],
Winson Chungb754f522020-08-03 22:17:08 -070068 path: "src",
69}
70
71genrule {
72 name: "wm_shell_protolog_src",
73 srcs: [
Pablo Gamito5fe2c802024-02-12 12:48:48 +000074 ":protolog-impl",
Winson Chungb754f522020-08-03 22:17:08 -070075 ":wm_shell_protolog-groups",
76 ":wm_shell-sources",
77 ],
78 tools: ["protologtool"],
79 cmd: "$(location protologtool) transform-protolog-calls " +
Pablo Gamitof89a94d2024-06-28 10:40:42 +000080 "--protolog-class com.android.internal.protolog.ProtoLog " +
Ats Jenkf33f1da2021-12-14 14:10:20 -080081 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
82 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
Pablo Gamito5fe2c802024-02-12 12:48:48 +000083 "--viewer-config-file-path /system_ext/etc/wmshell.protolog.pb " +
84 "--legacy-viewer-config-file-path /system_ext/etc/wmshell.protolog.json.gz " +
85 "--legacy-output-file-path /data/misc/wmtrace/shell_log.winscope " +
Ats Jenkf33f1da2021-12-14 14:10:20 -080086 "--output-srcjar $(out) " +
87 "$(locations :wm_shell-sources)",
Winson Chungb754f522020-08-03 22:17:08 -070088 out: ["wm_shell_protolog.srcjar"],
89}
90
91genrule {
92 name: "generate-wm_shell_protolog.json",
93 srcs: [
94 ":wm_shell_protolog-groups",
95 ":wm_shell-sources",
96 ],
97 tools: ["protologtool"],
98 cmd: "$(location protologtool) generate-viewer-config " +
Pablo Gamitof89a94d2024-06-28 10:40:42 +000099 "--protolog-class com.android.internal.protolog.ProtoLog " +
Ats Jenkf33f1da2021-12-14 14:10:20 -0800100 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
101 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
Pablo Gamito5fe2c802024-02-12 12:48:48 +0000102 "--viewer-config-type json " +
103 "--viewer-config $(out) " +
Ats Jenkf33f1da2021-12-14 14:10:20 -0800104 "$(locations :wm_shell-sources)",
Winson Chungb754f522020-08-03 22:17:08 -0700105 out: ["wm_shell_protolog.json"],
106}
Ats Jenkf33f1da2021-12-14 14:10:20 -0800107
Hongwei Wang2b227ee2022-08-19 09:38:18 -0700108genrule {
Pablo Gamito5fe2c802024-02-12 12:48:48 +0000109 name: "gen-wmshell.protolog.pb",
110 srcs: [
111 ":wm_shell_protolog-groups",
112 ":wm_shell-sources",
113 ],
114 tools: ["protologtool"],
115 cmd: "$(location protologtool) generate-viewer-config " +
Pablo Gamitof89a94d2024-06-28 10:40:42 +0000116 "--protolog-class com.android.internal.protolog.ProtoLog " +
Pablo Gamito5fe2c802024-02-12 12:48:48 +0000117 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
118 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
119 "--viewer-config-type proto " +
120 "--viewer-config $(out) " +
121 "$(locations :wm_shell-sources)",
122 out: ["wmshell.protolog.pb"],
123}
124
125genrule {
Hongwei Wang2b227ee2022-08-19 09:38:18 -0700126 name: "protolog.json.gz",
127 srcs: [":generate-wm_shell_protolog.json"],
128 out: ["wmshell.protolog.json.gz"],
Elliott Hughese135c402023-06-20 16:44:50 -0700129 cmd: "gzip -c < $(in) > $(out)",
Hongwei Wang2b227ee2022-08-19 09:38:18 -0700130}
131
132prebuilt_etc {
133 name: "wmshell.protolog.json.gz",
134 system_ext_specific: true,
135 src: ":protolog.json.gz",
136 filename_from_src: true,
137}
138
Pablo Gamito5fe2c802024-02-12 12:48:48 +0000139prebuilt_etc {
140 name: "wmshell.protolog.pb",
141 system_ext_specific: true,
142 src: ":gen-wmshell.protolog.pb",
143 filename_from_src: true,
144}
145
Winson Chungb754f522020-08-03 22:17:08 -0700146// End ProtoLog
147
Winson Chungeb1aa3d2020-08-25 19:02:29 -0700148java_library {
149 name: "WindowManager-Shell-proto",
150
151 srcs: ["proto/*.proto"],
152
153 proto: {
154 type: "nano",
155 },
156}
157
Shivangi Dubeya131137c2024-07-10 11:14:25 +0000158java_library {
159 name: "WindowManager-Shell-lite-proto",
160
161 srcs: ["src/com/android/wm/shell/desktopmode/education/data/proto/**/*.proto"],
162
163 proto: {
164 type: "lite",
165 },
166}
167
Luca Zuccarinia8aca21fc2024-03-15 13:12:50 +0000168filegroup {
169 name: "wm_shell-shared-aidls",
170
171 srcs: [
172 "shared/**/*.aidl",
173 ],
174
175 path: "shared/src",
176}
177
Luca Zuccarinid6073dc2024-01-22 17:06:41 +0000178java_library {
179 name: "WindowManager-Shell-shared",
180
Liran Binyamin4180ef02024-03-26 09:56:38 -0400181 srcs: [
182 "shared/**/*.java",
183 "shared/**/*.kt",
Luca Zuccarinia8aca21fc2024-03-15 13:12:50 +0000184 ":wm_shell-shared-aidls",
Liran Binyamin4180ef02024-03-26 09:56:38 -0400185 ],
186 static_libs: [
187 "androidx.dynamicanimation_dynamicanimation",
Luca Zuccarini42e79692024-03-14 15:57:46 +0000188 "jsr330",
Liran Binyamin4180ef02024-03-26 09:56:38 -0400189 ],
Luca Zuccarinid6073dc2024-01-22 17:06:41 +0000190}
191
Alina Zaidia4bd41d2024-07-05 15:07:26 +0000192java_library {
193 name: "WindowManager-Shell-shared-desktopMode",
194
195 srcs: [
196 "shared/**/desktopmode/*.java",
197 "shared/**/desktopmode/*.kt",
198 ],
199}
200
Winson Chung10a9b4b2019-12-18 10:01:36 -0800201android_library {
202 name: "WindowManager-Shell",
203 srcs: [
Winson Chungb754f522020-08-03 22:17:08 -0700204 ":wm_shell_protolog_src",
Bill Lin2b3bd572020-09-03 23:22:14 +0800205 // TODO(b/168581922) protologtool do not support kotlin(*.kt)
206 ":wm_shell-sources-kt",
Winson Chung2b72add2021-02-02 23:27:07 -0800207 ":wm_shell-aidls",
Luca Zuccarinia8091db2024-08-19 14:44:56 +0000208 ":wm_shell-shared-aidls",
Winson Chung10a9b4b2019-12-18 10:01:36 -0800209 ],
210 resource_dirs: [
211 "res",
212 ],
Winson Chungb754f522020-08-03 22:17:08 -0700213 static_libs: [
Tony Huangeb01a252020-10-27 11:37:11 +0800214 "androidx.appcompat_appcompat",
Jeff DeCew86e318e2023-07-27 11:00:36 -0400215 "androidx.core_core-animation",
Jorge Gil4a0c2082023-09-05 16:18:24 +0000216 "androidx.core_core-ktx",
Tony Huangeb01a252020-10-27 11:37:11 +0800217 "androidx.arch.core_core-runtime",
Shivangi Dubeya131137c2024-07-10 11:14:25 +0000218 "androidx.datastore_datastore",
Jorge Gild45c35d2024-06-03 17:33:20 +0000219 "androidx.compose.material3_material3",
Ats Jenkf33f1da2021-12-14 14:10:20 -0800220 "androidx-constraintlayout_constraintlayout",
Bill Lin2b3bd572020-09-03 23:22:14 +0800221 "androidx.dynamicanimation_dynamicanimation",
Sunny Goyaldcdee332021-03-30 09:42:19 -0700222 "androidx.recyclerview_recyclerview",
Bill Lin2b3bd572020-09-03 23:22:14 +0800223 "kotlinx-coroutines-android",
224 "kotlinx-coroutines-core",
Luca Zuccarini1b8ed952024-04-24 10:17:48 +0000225 "//frameworks/libs/systemui:com_android_systemui_shared_flags_lib",
Peter Kalauskascd50f532024-04-02 15:41:14 -0700226 "//frameworks/libs/systemui:iconloader_base",
Winson Chungbfe7f262023-09-12 20:29:22 +0000227 "com_android_wm_shell_flags_lib",
Winson Chungeb1aa3d2020-08-25 19:02:29 -0700228 "WindowManager-Shell-proto",
Shivangi Dubeya131137c2024-07-10 11:14:25 +0000229 "WindowManager-Shell-lite-proto",
Luca Zuccarinid6073dc2024-01-22 17:06:41 +0000230 "WindowManager-Shell-shared",
Pablo Gamitod19d9912023-11-13 23:32:19 +0000231 "perfetto_trace_java_protos",
Winson Chungca5598d2021-11-04 19:22:25 -0700232 "dagger2",
Sunny Goyaldcdee332021-03-30 09:42:19 -0700233 "jsr330",
Winson Chungb754f522020-08-03 22:17:08 -0700234 ],
Colin Cross4a26fe82022-03-17 13:14:55 -0700235 libs: [
236 // Soong fails to automatically add this dependency because all the
237 // *.kt sources are inside a filegroup.
238 "kotlin-annotations",
239 ],
Pablo Gamito27506912024-07-16 15:33:10 +0000240 required: [
241 "wmshell.protolog.json.gz",
242 "wmshell.protolog.pb",
243 ],
Ats Jenka4027032024-06-14 13:03:25 -0700244 flags_packages: [
245 "com_android_wm_shell_flags",
246 ],
Colin Cross6954ea72023-07-18 10:52:21 -0700247 kotlincflags: ["-Xjvm-default=all"],
Winson Chung10a9b4b2019-12-18 10:01:36 -0800248 manifest: "AndroidManifest.xml",
Winson Chungca5598d2021-11-04 19:22:25 -0700249 plugins: ["dagger2-compiler"],
Colin Cross085e8c92023-10-03 16:28:21 -0700250 use_resource_processor: true,
Dave Mankoff9179b302020-12-02 11:15:27 -0500251}