blob: 307b82e6950676c1e02a76a98d19ddbd43d2d852 [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
Winson Chungb754f522020-08-03 22:17:08 -070015// Begin ProtoLog
16java_library {
17 name: "wm_shell_protolog-groups",
18 srcs: [
19 "src/com/android/wm/shell/protolog/ShellProtoLogGroup.java",
20 ":protolog-common-src",
21 ],
22}
23
24filegroup {
25 name: "wm_shell-sources",
26 srcs: ["src/**/*.java"],
27 path: "src",
28}
29
30genrule {
31 name: "wm_shell_protolog_src",
32 srcs: [
33 ":wm_shell_protolog-groups",
34 ":wm_shell-sources",
35 ],
36 tools: ["protologtool"],
37 cmd: "$(location protologtool) transform-protolog-calls " +
38 "--protolog-class com.android.internal.protolog.common.ProtoLog " +
39 "--protolog-impl-class com.android.wm.shell.protolog.ShellProtoLogImpl " +
40 "--protolog-cache-class com.android.wm.shell.protolog.ShellProtoLogCache " +
41 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
42 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
43 "--output-srcjar $(out) " +
44 "$(locations :wm_shell-sources)",
45 out: ["wm_shell_protolog.srcjar"],
46}
47
48genrule {
49 name: "generate-wm_shell_protolog.json",
50 srcs: [
51 ":wm_shell_protolog-groups",
52 ":wm_shell-sources",
53 ],
54 tools: ["protologtool"],
55 cmd: "$(location protologtool) generate-viewer-config " +
56 "--protolog-class com.android.internal.protolog.common.ProtoLog " +
57 "--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " +
58 "--loggroups-jar $(location :wm_shell_protolog-groups) " +
59 "--viewer-conf $(out) " +
60 "$(locations :wm_shell-sources)",
61 out: ["wm_shell_protolog.json"],
62}
63
64filegroup {
65 name: "wm_shell_protolog.json",
66 srcs: ["res/raw/wm_shell_protolog.json"],
67}
68
69genrule {
70 name: "checked-wm_shell_protolog.json",
71 srcs: [
72 ":generate-wm_shell_protolog.json",
73 ":wm_shell_protolog.json",
74 ],
75 cmd: "cp $(location :generate-wm_shell_protolog.json) $(out) && " +
76 "{ ! (diff $(out) $(location :wm_shell_protolog.json) | grep -q '^<') || " +
77 "{ echo -e '\\n\\n################################################################\\n#\\n" +
78 "# ERROR: ProtoLog viewer config is stale. To update it, run:\\n#\\n" +
79 "# cp $(location :generate-wm_shell_protolog.json) " +
80 "$(location :wm_shell_protolog.json)\\n#\\n" +
81 "################################################################\\n\\n' >&2 && false; } }",
82 out: ["wm_shell_protolog.json"],
83}
84// End ProtoLog
85
Winson Chung10a9b4b2019-12-18 10:01:36 -080086android_library {
87 name: "WindowManager-Shell",
88 srcs: [
Winson Chungb754f522020-08-03 22:17:08 -070089 ":wm_shell_protolog_src",
Winson Chung10a9b4b2019-12-18 10:01:36 -080090 "src/**/I*.aidl",
91 ],
92 resource_dirs: [
93 "res",
94 ],
Winson Chungb754f522020-08-03 22:17:08 -070095 static_libs: [
96 "protolog-lib",
97 ],
Winson Chung10a9b4b2019-12-18 10:01:36 -080098 manifest: "AndroidManifest.xml",
Winson Chungb754f522020-08-03 22:17:08 -070099}