| 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 |
|
| 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 |
|
| 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", |
| 35 |
srcs: [ |
| 36 |
"src/**/*.java", |
| 37 |
], |
| 38 |
path: "src", |
| 39 |
} |
| 40 |
|
| 41 |
// Sources that have no dependencies that can be used directly downstream of this library |
| 42 |
filegroup { |
| 43 |
name: "wm_shell_util-sources", |
| 44 |
srcs: [ |
| 45 |
"src/com/android/wm/shell/util/**/*.java", |
| 46 |
"src/com/android/wm/shell/common/split/SplitScreenConstants.java", |
| 47 |
"src/com/android/wm/shell/sysui/ShellSharedConstants.java", |
| 48 |
"src/com/android/wm/shell/common/TransactionPool.java", |
| 49 |
"src/com/android/wm/shell/animation/Interpolators.java", |
| 50 |
"src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java", |
| 51 |
], |
| 52 |
path: "src", |
| 53 |
} |
| 54 |
|
| 55 |
// Aidls which can be used directly downstream of this library |
| 56 |
filegroup { |
| 57 |
name: "wm_shell-aidls", |
| 58 |
srcs: [ |
| 59 |
"src/**/*.aidl", |
| 60 |
], |
| 61 |
path: "src", |
| 62 |
} |
| 63 |
|
| 64 |
// TODO(b/168581922) protologtool do not support kotlin(*.kt) |
| 65 |
filegroup { |
| 66 |
name: "wm_shell-sources-kt", |
| 67 |
srcs: [ |
| 68 |
"src/**/*.kt", |
| 69 |
], |
| 70 |
path: "src", |
| 71 |
} |
| 72 |
|
| 73 |
genrule { |
| 74 |
name: "wm_shell_protolog_src", |
| 75 |
srcs: [ |
| 76 |
":wm_shell_protolog-groups", |
| 77 |
":wm_shell-sources", |
| 78 |
], |
| 79 |
tools: ["protologtool"], |
| 80 |
cmd: "$(location protologtool) transform-protolog-calls " + |
| 81 |
"--protolog-class com.android.internal.protolog.common.ProtoLog " + |
| 82 |
"--protolog-impl-class com.android.wm.shell.protolog.ShellProtoLogImpl " + |
| 83 |
"--protolog-cache-class com.android.wm.shell.protolog.ShellProtoLogCache " + |
| 84 |
"--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " + |
| 85 |
"--loggroups-jar $(location :wm_shell_protolog-groups) " + |
| 86 |
"--output-srcjar $(out) " + |
| 87 |
"$(locations :wm_shell-sources)", |
| 88 |
out: ["wm_shell_protolog.srcjar"], |
| 89 |
} |
| 90 |
|
| 91 |
genrule { |
| 92 |
name: "generate-wm_shell_protolog.json", |
| 93 |
srcs: [ |
| 94 |
":wm_shell_protolog-groups", |
| 95 |
":wm_shell-sources", |
| 96 |
], |
| 97 |
tools: ["protologtool"], |
| 98 |
cmd: "$(location protologtool) generate-viewer-config " + |
| 99 |
"--protolog-class com.android.internal.protolog.common.ProtoLog " + |
| 100 |
"--loggroups-class com.android.wm.shell.protolog.ShellProtoLogGroup " + |
| 101 |
"--loggroups-jar $(location :wm_shell_protolog-groups) " + |
| 102 |
"--viewer-conf $(out) " + |
| 103 |
"$(locations :wm_shell-sources)", |
| 104 |
out: ["wm_shell_protolog.json"], |
| 105 |
} |
| 106 |
|
| 107 |
genrule { |
| 108 |
name: "protolog.json.gz", |
| 109 |
srcs: [":generate-wm_shell_protolog.json"], |
| 110 |
out: ["wmshell.protolog.json.gz"], |
| 111 |
cmd: "$(location minigzip) -c < $(in) > $(out)", |
| 112 |
tools: ["minigzip"], |
| 113 |
} |
| 114 |
|
| 115 |
prebuilt_etc { |
| 116 |
name: "wmshell.protolog.json.gz", |
| 117 |
system_ext_specific: true, |
| 118 |
src: ":protolog.json.gz", |
| 119 |
filename_from_src: true, |
| 120 |
} |
| 121 |
|
| 122 |
// End ProtoLog |
| 123 |
|
| 124 |
java_library { |
| 125 |
name: "WindowManager-Shell-proto", |
| 126 |
|
| 127 |
srcs: ["proto/*.proto"], |
| 128 |
|
| 129 |
proto: { |
| 130 |
type: "nano", |
| 131 |
}, |
| 132 |
} |
| 133 |
|
| 134 |
android_library { |
| 135 |
name: "WindowManager-Shell", |
| 136 |
srcs: [ |
| 137 |
":wm_shell_protolog_src", |
| 138 |
// TODO(b/168581922) protologtool do not support kotlin(*.kt) |
| 139 |
":wm_shell-sources-kt", |
| 140 |
":wm_shell-aidls", |
| 141 |
], |
| 142 |
resource_dirs: [ |
| 143 |
"res", |
| 144 |
], |
| 145 |
static_libs: [ |
| 146 |
"androidx.appcompat_appcompat", |
| 147 |
"androidx.arch.core_core-runtime", |
| 148 |
"androidx-constraintlayout_constraintlayout", |
| 149 |
"androidx.dynamicanimation_dynamicanimation", |
| 150 |
"androidx.recyclerview_recyclerview", |
| 151 |
"kotlinx-coroutines-android", |
| 152 |
"kotlinx-coroutines-core", |
| 153 |
"iconloader_base", |
| 154 |
"protolog-lib", |
| 155 |
"WindowManager-Shell-proto", |
| 156 |
"dagger2", |
| 157 |
"jsr330", |
| 158 |
], |
| 159 |
libs: [ |
| 160 |
// Soong fails to automatically add this dependency because all the |
| 161 |
// *.kt sources are inside a filegroup. |
| 162 |
"kotlin-annotations", |
| 163 |
], |
| 164 |
kotlincflags: ["-Xjvm-default=enable"], |
| 165 |
manifest: "AndroidManifest.xml", |
| 166 |
plugins: ["dagger2-compiler"], |
| 167 |
} |