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 | |
Bob Badour | 8a6a2bc | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 15 | package { |
| 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 Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 24 | // Begin ProtoLog |
| 25 | java_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 | |
| 33 | filegroup { |
| 34 | name: "wm_shell-sources", |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 35 | srcs: [ |
| 36 | "src/**/*.java", |
| 37 | ], |
| 38 | path: "src", |
| 39 | } |
| 40 | |
Winson Chung | 92a8e1a | 2021-10-16 21:44:25 -0700 | [diff] [blame] | 41 | // Sources that have no dependencies that can be used directly downstream of this library |
Winson Chung | 2b72add | 2021-02-02 23:27:07 -0800 | [diff] [blame] | 42 | filegroup { |
Evan Rosky | 14ea8c6 | 2021-09-30 17:28:35 -0700 | [diff] [blame] | 43 | name: "wm_shell_util-sources", |
| 44 | srcs: [ |
| 45 | "src/com/android/wm/shell/util/**/*.java", |
Schneider Victor-tulias | 226f579f | 2021-11-24 13:30:15 -0800 | [diff] [blame] | 46 | "src/com/android/wm/shell/common/split/SplitScreenConstants.java" |
Evan Rosky | 14ea8c6 | 2021-09-30 17:28:35 -0700 | [diff] [blame] | 47 | ], |
| 48 | path: "src", |
| 49 | } |
| 50 | |
Winson Chung | 92a8e1a | 2021-10-16 21:44:25 -0700 | [diff] [blame] | 51 | // Aidls which can be used directly downstream of this library |
Evan Rosky | 14ea8c6 | 2021-09-30 17:28:35 -0700 | [diff] [blame] | 52 | filegroup { |
Winson Chung | 2b72add | 2021-02-02 23:27:07 -0800 | [diff] [blame] | 53 | name: "wm_shell-aidls", |
| 54 | srcs: [ |
| 55 | "src/**/*.aidl", |
| 56 | ], |
| 57 | path: "src", |
| 58 | } |
| 59 | |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 60 | // TODO(b/168581922) protologtool do not support kotlin(*.kt) |
| 61 | filegroup { |
| 62 | name: "wm_shell-sources-kt", |
| 63 | srcs: [ |
| 64 | "src/**/*.kt", |
| 65 | ], |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 66 | path: "src", |
| 67 | } |
| 68 | |
| 69 | genrule { |
| 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 Luong | 0c3b94e | 2021-03-19 16:55:23 +0000 | [diff] [blame] | 77 | "--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 Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 84 | out: ["wm_shell_protolog.srcjar"], |
| 85 | } |
| 86 | |
| 87 | genrule { |
| 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 Luong | 0c3b94e | 2021-03-19 16:55:23 +0000 | [diff] [blame] | 95 | "--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 Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 100 | out: ["wm_shell_protolog.json"], |
| 101 | } |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 102 | // End ProtoLog |
| 103 | |
Winson Chung | eb1aa3d | 2020-08-25 19:02:29 -0700 | [diff] [blame] | 104 | java_library { |
| 105 | name: "WindowManager-Shell-proto", |
| 106 | |
| 107 | srcs: ["proto/*.proto"], |
| 108 | |
| 109 | proto: { |
| 110 | type: "nano", |
| 111 | }, |
| 112 | } |
| 113 | |
Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 114 | android_library { |
| 115 | name: "WindowManager-Shell", |
| 116 | srcs: [ |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 117 | ":wm_shell_protolog_src", |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 118 | // TODO(b/168581922) protologtool do not support kotlin(*.kt) |
| 119 | ":wm_shell-sources-kt", |
Winson Chung | 2b72add | 2021-02-02 23:27:07 -0800 | [diff] [blame] | 120 | ":wm_shell-aidls", |
Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 121 | ], |
| 122 | resource_dirs: [ |
| 123 | "res", |
| 124 | ], |
Winson Chung | 9169b37 | 2021-02-12 00:29:24 -0800 | [diff] [blame] | 125 | java_resources: [ |
Quang Luong | 0c3b94e | 2021-03-19 16:55:23 +0000 | [diff] [blame] | 126 | ":generate-wm_shell_protolog.json" |
Winson Chung | 9169b37 | 2021-02-12 00:29:24 -0800 | [diff] [blame] | 127 | ], |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 128 | static_libs: [ |
Tony Huang | eb01a25 | 2020-10-27 11:37:11 +0800 | [diff] [blame] | 129 | "androidx.appcompat_appcompat", |
| 130 | "androidx.arch.core_core-runtime", |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 131 | "androidx.dynamicanimation_dynamicanimation", |
Sunny Goyal | dcdee33 | 2021-03-30 09:42:19 -0700 | [diff] [blame] | 132 | "androidx.recyclerview_recyclerview", |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 133 | "kotlinx-coroutines-android", |
| 134 | "kotlinx-coroutines-core", |
Tony Huang | eb01a25 | 2020-10-27 11:37:11 +0800 | [diff] [blame] | 135 | "iconloader_base", |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 136 | "protolog-lib", |
Winson Chung | eb1aa3d | 2020-08-25 19:02:29 -0700 | [diff] [blame] | 137 | "WindowManager-Shell-proto", |
Winson Chung | ca5598d | 2021-11-04 19:22:25 -0700 | [diff] [blame] | 138 | "dagger2", |
Sunny Goyal | dcdee33 | 2021-03-30 09:42:19 -0700 | [diff] [blame] | 139 | "jsr330", |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 140 | ], |
Colin Cross | 4a26fe8 | 2022-03-17 13:14:55 -0700 | [diff] [blame] | 141 | libs: [ |
| 142 | // Soong fails to automatically add this dependency because all the |
| 143 | // *.kt sources are inside a filegroup. |
| 144 | "kotlin-annotations", |
| 145 | ], |
Bill Lin | 2b3bd57 | 2020-09-03 23:22:14 +0800 | [diff] [blame] | 146 | kotlincflags: ["-Xjvm-default=enable"], |
Winson Chung | 10a9b4b | 2019-12-18 10:01:36 -0800 | [diff] [blame] | 147 | manifest: "AndroidManifest.xml", |
Winson Chung | ca5598d | 2021-11-04 19:22:25 -0700 | [diff] [blame] | 148 | plugins: ["dagger2-compiler"], |
Dave Mankoff | 9179b30 | 2020-12-02 11:15:27 -0500 | [diff] [blame] | 149 | } |