blob: 9d625c089fc2473e24057b192d828a586ae05070 [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",
Schneider Victor-tulias226f579f2021-11-24 13:30:15 -080046 "src/com/android/wm/shell/common/split/SplitScreenConstants.java"
Evan Rosky14ea8c62021-09-30 17:28:35 -070047 ],
48 path: "src",
49}
50
Winson Chung92a8e1a2021-10-16 21:44:25 -070051// Aidls which can be used directly downstream of this library
Evan Rosky14ea8c62021-09-30 17:28:35 -070052filegroup {
Winson Chung2b72add2021-02-02 23:27:07 -080053 name: "wm_shell-aidls",
54 srcs: [
55 "src/**/*.aidl",
56 ],
57 path: "src",
58}
59
Bill Lin2b3bd572020-09-03 23:22:14 +080060// TODO(b/168581922) protologtool do not support kotlin(*.kt)
61filegroup {
62 name: "wm_shell-sources-kt",
63 srcs: [
64 "src/**/*.kt",
65 ],
Winson Chungb754f522020-08-03 22:17:08 -070066 path: "src",
67}
68
69genrule {
70 name: "wm_shell_protolog_src",
71 srcs: [
72 ":wm_shell_protolog-groups",
73 ":wm_shell-sources",
74 ],
75 tools: ["protologtool"],
76 cmd: "$(location protologtool) transform-protolog-calls " +
Quang Luong0c3b94e2021-03-19 16:55:23 +000077 "--protolog-class com.android.internal.protolog.common.ProtoLog " +
78 "--protolog-impl-class com.android.wm.shell.protolog.ShellProtoLogImpl " +
79 "--protolog-cache-class com.android.wm.shell.protolog.ShellProtoLogCache " +
80 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
81 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
82 "--output-srcjar $(out) " +
83 "$(locations :wm_shell-sources)",
Winson Chungb754f522020-08-03 22:17:08 -070084 out: ["wm_shell_protolog.srcjar"],
85}
86
87genrule {
88 name: "generate-wm_shell_protolog.json",
89 srcs: [
90 ":wm_shell_protolog-groups",
91 ":wm_shell-sources",
92 ],
93 tools: ["protologtool"],
94 cmd: "$(location protologtool) generate-viewer-config " +
Quang Luong0c3b94e2021-03-19 16:55:23 +000095 "--protolog-class com.android.internal.protolog.common.ProtoLog " +
96 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
97 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
98 "--viewer-conf $(out) " +
99 "$(locations :wm_shell-sources)",
Winson Chungb754f522020-08-03 22:17:08 -0700100 out: ["wm_shell_protolog.json"],
101}
Winson Chungb754f522020-08-03 22:17:08 -0700102// End ProtoLog
103
Winson Chungeb1aa3d2020-08-25 19:02:29 -0700104java_library {
105 name: "WindowManager-Shell-proto",
106
107 srcs: ["proto/*.proto"],
108
109 proto: {
110 type: "nano",
111 },
112}
113
Winson Chung10a9b4b2019-12-18 10:01:36 -0800114android_library {
115 name: "WindowManager-Shell",
116 srcs: [
Winson Chungb754f522020-08-03 22:17:08 -0700117 ":wm_shell_protolog_src",
Bill Lin2b3bd572020-09-03 23:22:14 +0800118 // TODO(b/168581922) protologtool do not support kotlin(*.kt)
119 ":wm_shell-sources-kt",
Winson Chung2b72add2021-02-02 23:27:07 -0800120 ":wm_shell-aidls",
Winson Chung10a9b4b2019-12-18 10:01:36 -0800121 ],
122 resource_dirs: [
123 "res",
124 ],
Winson Chung9169b372021-02-12 00:29:24 -0800125 java_resources: [
Quang Luong0c3b94e2021-03-19 16:55:23 +0000126 ":generate-wm_shell_protolog.json"
Winson Chung9169b372021-02-12 00:29:24 -0800127 ],
Winson Chungb754f522020-08-03 22:17:08 -0700128 static_libs: [
Tony Huangeb01a252020-10-27 11:37:11 +0800129 "androidx.appcompat_appcompat",
130 "androidx.arch.core_core-runtime",
Bill Lin2b3bd572020-09-03 23:22:14 +0800131 "androidx.dynamicanimation_dynamicanimation",
Sunny Goyaldcdee332021-03-30 09:42:19 -0700132 "androidx.recyclerview_recyclerview",
Bill Lin2b3bd572020-09-03 23:22:14 +0800133 "kotlinx-coroutines-android",
134 "kotlinx-coroutines-core",
Tony Huangeb01a252020-10-27 11:37:11 +0800135 "iconloader_base",
Winson Chungb754f522020-08-03 22:17:08 -0700136 "protolog-lib",
Winson Chungeb1aa3d2020-08-25 19:02:29 -0700137 "WindowManager-Shell-proto",
Winson Chungca5598d2021-11-04 19:22:25 -0700138 "dagger2",
Sunny Goyaldcdee332021-03-30 09:42:19 -0700139 "jsr330",
Winson Chungb754f522020-08-03 22:17:08 -0700140 ],
Colin Cross4a26fe82022-03-17 13:14:55 -0700141 libs: [
142 // Soong fails to automatically add this dependency because all the
143 // *.kt sources are inside a filegroup.
144 "kotlin-annotations",
145 ],
Bill Lin2b3bd572020-09-03 23:22:14 +0800146 kotlincflags: ["-Xjvm-default=enable"],
Winson Chung10a9b4b2019-12-18 10:01:36 -0800147 manifest: "AndroidManifest.xml",
Winson Chungca5598d2021-11-04 19:22:25 -0700148 plugins: ["dagger2-compiler"],
Dave Mankoff9179b302020-12-02 11:15:27 -0500149}