Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 1 | // 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 Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame^] | 15 | // Begin ProtoLog |
| 16 | java_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 | |
| 24 | filegroup { |
| 25 | name: "wm_shell-sources", |
| 26 | srcs: ["src/**/*.java"], |
| 27 | path: "src", |
| 28 | } |
| 29 | |
| 30 | genrule { |
| 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 | |
| 48 | genrule { |
| 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 | |
| 64 | filegroup { |
| 65 | name: "wm_shell_protolog.json", |
| 66 | srcs: ["res/raw/wm_shell_protolog.json"], |
| 67 | } |
| 68 | |
| 69 | genrule { |
| 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 Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 86 | android_library { |
| 87 | name: "WindowManager-Shell", |
| 88 | srcs: [ |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame^] | 89 | ":wm_shell_protolog_src", |
Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 90 | "src/**/I*.aidl", |
| 91 | ], |
| 92 | resource_dirs: [ |
| 93 | "res", |
| 94 | ], |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame^] | 95 | static_libs: [ |
| 96 | "protolog-lib", |
| 97 | ], |
Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 98 | manifest: "AndroidManifest.xml", |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame^] | 99 | } |