blob: 82573b2b9acc458e5d5ed5b4398cd9d1cd8002a7 [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"],
22}
23
Winson Chungb754f522020-08-03 22:17:08 -070024// Begin ProtoLog
25java_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
33filegroup {
34 name: "wm_shell-sources",
Bill Lin2b3bd572020-09-03 23:22:14 +080035 srcs: [
36 "src/**/*.java",
37 ],
38 path: "src",
39}
40
Winson Chung92a8e1a2021-10-16 21:44:25 -070041// Sources that have no dependencies that can be used directly downstream of this library
Winson Chung2b72add2021-02-02 23:27:07 -080042filegroup {
Evan Rosky14ea8c62021-09-30 17:28:35 -070043 name: "wm_shell_util-sources",
44 srcs: [
45 "src/com/android/wm/shell/util/**/*.java",
Ats Jenkf33f1da2021-12-14 14:10:20 -080046 "src/com/android/wm/shell/common/split/SplitScreenConstants.java",
Winson Chungc03010f2022-09-26 21:46:25 +000047 "src/com/android/wm/shell/sysui/ShellSharedConstants.java",
Evan Rosky14ea8c62021-09-30 17:28:35 -070048 ],
49 path: "src",
50}
51
Winson Chung92a8e1a2021-10-16 21:44:25 -070052// Aidls which can be used directly downstream of this library
Evan Rosky14ea8c62021-09-30 17:28:35 -070053filegroup {
Winson Chung2b72add2021-02-02 23:27:07 -080054 name: "wm_shell-aidls",
55 srcs: [
56 "src/**/*.aidl",
57 ],
58 path: "src",
59}
60
Bill Lin2b3bd572020-09-03 23:22:14 +080061// TODO(b/168581922) protologtool do not support kotlin(*.kt)
62filegroup {
63 name: "wm_shell-sources-kt",
64 srcs: [
65 "src/**/*.kt",
66 ],
Winson Chungb754f522020-08-03 22:17:08 -070067 path: "src",
68}
69
70genrule {
71 name: "wm_shell_protolog_src",
72 srcs: [
73 ":wm_shell_protolog-groups",
74 ":wm_shell-sources",
75 ],
76 tools: ["protologtool"],
77 cmd: "$(location protologtool) transform-protolog-calls " +
Ats Jenkf33f1da2021-12-14 14:10:20 -080078 "--protolog-class com.android.internal.protolog.common.ProtoLog " +
79 "--protolog-impl-class com.android.wm.shell.protolog.ShellProtoLogImpl " +
80 "--protolog-cache-class com.android.wm.shell.protolog.ShellProtoLogCache " +
81 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
82 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
83 "--output-srcjar $(out) " +
84 "$(locations :wm_shell-sources)",
Winson Chungb754f522020-08-03 22:17:08 -070085 out: ["wm_shell_protolog.srcjar"],
86}
87
88genrule {
89 name: "generate-wm_shell_protolog.json",
90 srcs: [
91 ":wm_shell_protolog-groups",
92 ":wm_shell-sources",
93 ],
94 tools: ["protologtool"],
95 cmd: "$(location protologtool) generate-viewer-config " +
Ats Jenkf33f1da2021-12-14 14:10:20 -080096 "--protolog-class com.android.internal.protolog.common.ProtoLog " +
97 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
98 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
99 "--viewer-conf $(out) " +
100 "$(locations :wm_shell-sources)",
Winson Chungb754f522020-08-03 22:17:08 -0700101 out: ["wm_shell_protolog.json"],
102}
Ats Jenkf33f1da2021-12-14 14:10:20 -0800103
Hongwei Wang2b227ee2022-08-19 09:38:18 -0700104genrule {
105 name: "protolog.json.gz",
106 srcs: [":generate-wm_shell_protolog.json"],
107 out: ["wmshell.protolog.json.gz"],
108 cmd: "$(location minigzip) -c < $(in) > $(out)",
109 tools: ["minigzip"],
110}
111
112prebuilt_etc {
113 name: "wmshell.protolog.json.gz",
114 system_ext_specific: true,
115 src: ":protolog.json.gz",
116 filename_from_src: true,
117}
118
Winson Chungb754f522020-08-03 22:17:08 -0700119// End ProtoLog
120
Winson Chungeb1aa3d2020-08-25 19:02:29 -0700121java_library {
122 name: "WindowManager-Shell-proto",
123
124 srcs: ["proto/*.proto"],
125
126 proto: {
127 type: "nano",
128 },
129}
130
Winson Chung10a9b4b2019-12-18 10:01:36 -0800131android_library {
132 name: "WindowManager-Shell",
133 srcs: [
Winson Chungb754f522020-08-03 22:17:08 -0700134 ":wm_shell_protolog_src",
Bill Lin2b3bd572020-09-03 23:22:14 +0800135 // TODO(b/168581922) protologtool do not support kotlin(*.kt)
136 ":wm_shell-sources-kt",
Winson Chung2b72add2021-02-02 23:27:07 -0800137 ":wm_shell-aidls",
Winson Chung10a9b4b2019-12-18 10:01:36 -0800138 ],
139 resource_dirs: [
140 "res",
141 ],
Winson Chungb754f522020-08-03 22:17:08 -0700142 static_libs: [
Tony Huangeb01a252020-10-27 11:37:11 +0800143 "androidx.appcompat_appcompat",
144 "androidx.arch.core_core-runtime",
Ats Jenkf33f1da2021-12-14 14:10:20 -0800145 "androidx-constraintlayout_constraintlayout",
Bill Lin2b3bd572020-09-03 23:22:14 +0800146 "androidx.dynamicanimation_dynamicanimation",
Sunny Goyaldcdee332021-03-30 09:42:19 -0700147 "androidx.recyclerview_recyclerview",
Bill Lin2b3bd572020-09-03 23:22:14 +0800148 "kotlinx-coroutines-android",
149 "kotlinx-coroutines-core",
Tony Huangeb01a252020-10-27 11:37:11 +0800150 "iconloader_base",
Winson Chungb754f522020-08-03 22:17:08 -0700151 "protolog-lib",
Winson Chungeb1aa3d2020-08-25 19:02:29 -0700152 "WindowManager-Shell-proto",
Winson Chungca5598d2021-11-04 19:22:25 -0700153 "dagger2",
Sunny Goyaldcdee332021-03-30 09:42:19 -0700154 "jsr330",
Winson Chungb754f522020-08-03 22:17:08 -0700155 ],
Colin Cross4a26fe82022-03-17 13:14:55 -0700156 libs: [
157 // Soong fails to automatically add this dependency because all the
158 // *.kt sources are inside a filegroup.
159 "kotlin-annotations",
160 ],
Bill Lin2b3bd572020-09-03 23:22:14 +0800161 kotlincflags: ["-Xjvm-default=enable"],
Winson Chung10a9b4b2019-12-18 10:01:36 -0800162 manifest: "AndroidManifest.xml",
Winson Chungca5598d2021-11-04 19:22:25 -0700163 plugins: ["dagger2-compiler"],
Dave Mankoff9179b302020-12-02 11:15:27 -0500164}