blob: 626610d55c30a551b8649450ff3ba2f2b3719906 [file] [log] [blame]
Hyunyoung Songda4fcfe2018-09-05 09:57:59 -07001// Copyright (C) 2018 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 Badour4bdf3802021-02-12 17:08:17 -080015package {
Bob Badoura7548b52022-01-27 22:04:48 -080016 // See: http://go/android-license-faq
17 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour4bdf3802021-02-12 17:08:17 -080018}
19
Sunny Goyal9d2ece12024-03-22 13:52:19 -070020min_launcher3_sdk_version = "30"
Sunny Goyal1fb271f2021-05-20 10:43:23 -070021
Jared Duke1222dd72024-07-12 00:01:11 +000022// Targets that don't inherit framework aconfig libs (i.e., those that don't set
23// `platform_apis: true`) must manually link them.
24java_defaults {
25 name: "launcher-non-platform-apis-defaults",
26 static_libs: [
27 "android.os.flags-aconfig-java",
28 "android.appwidget.flags-aconfig-java",
29 "com.android.window.flags.window-aconfig-java",
30 ]
31}
32
Thales Lima2c54bbf2022-07-12 15:45:10 +000033// Common source files used to build launcher (java and kotlin)
34// All sources are split so they can be reused in many other libraries/apps in other folders
Sunny Goyal77954ba2024-03-25 11:53:17 -070035
36// Main Launcher source, excluding the build config
Thales Lima2c54bbf2022-07-12 15:45:10 +000037filegroup {
38 name: "launcher-src",
Cole Faustbad33e62023-12-20 11:57:04 -080039 srcs: [
40 "src/**/*.java",
41 "src/**/*.kt",
42 ],
Thales Lima2c54bbf2022-07-12 15:45:10 +000043}
44
Sunny Goyal77954ba2024-03-25 11:53:17 -070045// Source code for quickstep build, on top of launcher-src
Thales Lima2c54bbf2022-07-12 15:45:10 +000046filegroup {
47 name: "launcher-quickstep-src",
Cole Faustbad33e62023-12-20 11:57:04 -080048 srcs: [
49 "quickstep/src/**/*.java",
50 "quickstep/src/**/*.kt",
51 ],
Thales Lima2c54bbf2022-07-12 15:45:10 +000052}
53
Sunny Goyal77954ba2024-03-25 11:53:17 -070054// Alternate source when quickstep is not included
Thales Lima2c54bbf2022-07-12 15:45:10 +000055filegroup {
Sunny Goyal77954ba2024-03-25 11:53:17 -070056 name: "launcher-src_no_quickstep",
Cole Faustbad33e62023-12-20 11:57:04 -080057 srcs: [
Sunny Goyal77954ba2024-03-25 11:53:17 -070058 "src_no_quickstep/**/*.java",
59 "src_no_quickstep/**/*.kt",
Cole Faustbad33e62023-12-20 11:57:04 -080060 ],
Thales Lima2c54bbf2022-07-12 15:45:10 +000061}
62
Sunny Goyal77954ba2024-03-25 11:53:17 -070063// Default build config for Launcher3
Thales Lima2c54bbf2022-07-12 15:45:10 +000064filegroup {
Sunny Goyal77954ba2024-03-25 11:53:17 -070065 name: "launcher-build-config",
Cole Faustbad33e62023-12-20 11:57:04 -080066 srcs: [
Sunny Goyal77954ba2024-03-25 11:53:17 -070067 "src_build_config/**/*.java",
Cole Faustbad33e62023-12-20 11:57:04 -080068 ],
Thales Lima2c54bbf2022-07-12 15:45:10 +000069}
70
Thales Lima2c54bbf2022-07-12 15:45:10 +000071// Proguard files for Launcher3
72filegroup {
73 name: "launcher-proguard-rules",
74 srcs: ["proguard.flags"],
75}
76
vadimt09df0832019-03-07 14:59:30 -080077android_library {
Hyunyoung Songda4fcfe2018-09-05 09:57:59 -070078 name: "launcher-aosp-tapl",
Thiru Ramasamyd495e8c2021-08-26 10:37:17 -070079 libs: [
80 "framework-statsd",
81 ],
Hyunyoung Songda4fcfe2018-09-05 09:57:59 -070082 static_libs: [
83 "androidx.annotation_annotation",
Brett Chabotd7d692c2018-10-23 21:17:58 -070084 "androidx.test.runner",
85 "androidx.test.rules",
Hyunyoung Songda4fcfe2018-09-05 09:57:59 -070086 "androidx.test.uiautomator_uiautomator",
Hyunyoung Songbb715822020-08-04 10:45:53 -070087 "androidx.preference_preference",
Hyunyoung Songda4fcfe2018-09-05 09:57:59 -070088 "SystemUISharedLib",
Peter Kalauskas9bdb1da2024-04-02 15:38:57 -070089 "//frameworks/libs/systemui:animationlib",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +000090 "launcher-testing-shared",
Hyunyoung Songda4fcfe2018-09-05 09:57:59 -070091 ],
92 srcs: [
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000093 "tests/tapl/**/*.java",
94 "tests/tapl/**/*.kt",
Hyunyoung Songda4fcfe2018-09-05 09:57:59 -070095 ],
Cole Faustbad33e62023-12-20 11:57:04 -080096 resource_dirs: [],
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000097 manifest: "tests/tapl/AndroidManifest.xml",
Hyunyoung Songda4fcfe2018-09-05 09:57:59 -070098 platform_apis: true,
99}
thiruram5e1ecf62019-11-13 17:49:35 -0800100
101java_library_static {
thiruramc1c2bfa2020-02-04 18:56:40 -0800102 name: "launcher_log_protos_lite",
thiruram5e1ecf62019-11-13 17:49:35 -0800103 srcs: [
104 "protos/*.proto",
thiruramcbeb13d2021-01-27 14:45:58 -0800105 "protos_overrides/*.proto",
thiruram5e1ecf62019-11-13 17:49:35 -0800106 ],
107 sdk_version: "current",
108 proto: {
109 type: "lite",
Cole Faustbad33e62023-12-20 11:57:04 -0800110 local_include_dirs: [
thiruram5e1ecf62019-11-13 17:49:35 -0800111 "protos",
thiruramcbeb13d2021-01-27 14:45:58 -0800112 "protos_overrides",
thiruram5e1ecf62019-11-13 17:49:35 -0800113 ],
114 },
thiruramc1c2bfa2020-02-04 18:56:40 -0800115 static_libs: ["libprotobuf-java-lite"],
thiruram5e1ecf62019-11-13 17:49:35 -0800116}
Hyunyoung Song8605be32020-02-21 14:52:25 -0800117
thiruramcbeb13d2021-01-27 14:45:58 -0800118java_library_static {
119 name: "launcher_quickstep_log_protos_lite",
120 srcs: [
121 "quickstep/protos_overrides/*.proto",
122 ],
123 sdk_version: "current",
124 proto: {
125 type: "lite",
Cole Faustbad33e62023-12-20 11:57:04 -0800126 local_include_dirs: [
thiruramcbeb13d2021-01-27 14:45:58 -0800127 "quickstep/protos_overrides",
128 ],
129 },
130 static_libs: [
Cole Faustbad33e62023-12-20 11:57:04 -0800131 "libprotobuf-java-lite",
132 "launcher_log_protos_lite",
133 ],
thiruramcbeb13d2021-01-27 14:45:58 -0800134}
135
Hyunyoung Song8605be32020-02-21 14:52:25 -0800136java_library {
137 name: "LauncherPluginLib",
138
139 static_libs: ["PluginCoreLib"],
140
141 srcs: ["src_plugins/**/*.java"],
142
143 sdk_version: "current",
Sunny Goyal1fb271f2021-05-20 10:43:23 -0700144 min_sdk_version: min_launcher3_sdk_version,
Hyunyoung Song8605be32020-02-21 14:52:25 -0800145}
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800146
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800147// Library with all the dependencies for building Launcher3
148android_library {
149 name: "Launcher3ResLib",
Cole Faustbad33e62023-12-20 11:57:04 -0800150 srcs: [],
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800151 resource_dirs: ["res"],
152 static_libs: [
153 "LauncherPluginLib",
154 "launcher_quickstep_log_protos_lite",
155 "androidx-constraintlayout_constraintlayout",
156 "androidx.recyclerview_recyclerview",
157 "androidx.dynamicanimation_dynamicanimation",
158 "androidx.fragment_fragment",
159 "androidx.preference_preference",
160 "androidx.slice_slice-view",
161 "androidx.cardview_cardview",
Sebastian Franco9ae40322023-10-10 10:50:28 -0700162 "androidx.window_window",
Brian Isganitis93031bc2021-06-09 16:34:45 -0400163 "com.google.android.material_material",
Peter Kalauskas9bdb1da2024-04-02 15:38:57 -0700164 "//frameworks/libs/systemui:iconloader_base",
165 "//frameworks/libs/systemui:view_capture",
166 "//frameworks/libs/systemui:animationlib",
Anna Zhuravleva9c203812023-11-20 18:30:35 +0000167 "SystemUI-statsd",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000168 "launcher-testing-shared",
Uwais Ashraf6e9927e2024-03-25 10:53:06 +0000169 "androidx.lifecycle_lifecycle-common-java8",
170 "androidx.lifecycle_lifecycle-extensions",
171 "androidx.lifecycle_lifecycle-runtime-ktx",
172 "kotlinx_coroutines_android",
173 "kotlinx_coroutines",
Anushree Ganjam2a14b972023-08-30 13:31:10 -0700174 "com_android_launcher3_flags_lib",
Jeremy Sim9e44e372023-10-10 14:54:39 -0700175 "com_android_wm_shell_flags_lib",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000176 ],
Sunny Goyal77954ba2024-03-25 11:53:17 -0700177 manifest: "AndroidManifest-common.xml",
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800178 sdk_version: "current",
Sunny Goyal1fb271f2021-05-20 10:43:23 -0700179 min_sdk_version: min_launcher3_sdk_version,
Pedro Loureiro1e296c12021-03-09 18:35:52 +0000180 lint: {
Sunny Goyal9d2ece12024-03-22 13:52:19 -0700181 baseline_filename: "lint-baseline.xml",
Pedro Loureiro1e296c12021-03-09 18:35:52 +0000182 },
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800183}
184
185//
186// Build rule for Launcher3 app.
187//
188android_app {
189 name: "Launcher3",
Jared Duke1222dd72024-07-12 00:01:11 +0000190 defaults: ["launcher-non-platform-apis-defaults"],
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800191
192 static_libs: [
Sunny Goyal77954ba2024-03-25 11:53:17 -0700193 "Launcher3ResLib",
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800194 ],
195 srcs: [
Thales Lima2c54bbf2022-07-12 15:45:10 +0000196 ":launcher-src",
Sunny Goyal77954ba2024-03-25 11:53:17 -0700197 ":launcher-src_no_quickstep",
198 ":launcher-build-config",
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800199 ],
Sunny Goyal9d2ece12024-03-22 13:52:19 -0700200
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800201 optimize: {
202 proguard_flags_files: ["proguard.flags"],
203 // Proguard is disable for testing. Derivarive prjects to keep proguard enabled
204 enabled: false,
205 },
206
207 sdk_version: "current",
Sunny Goyal1fb271f2021-05-20 10:43:23 -0700208 min_sdk_version: min_launcher3_sdk_version,
209 target_sdk_version: "current",
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800210 privileged: true,
211 system_ext_specific: true,
212
213 overrides: [
214 "Home",
215 "Launcher2",
216 ],
217 required: ["privapp_whitelist_com.android.launcher3"],
218
219 jacoco: {
220 include_filter: ["com.android.launcher3.**"],
221 },
222 additional_manifests: [
223 "AndroidManifest-common.xml",
224 ],
Pedro Loureiro1e296c12021-03-09 18:35:52 +0000225 lint: {
Cole Faustc778a672024-01-10 12:30:39 -0800226 baseline_filename: "lint-baseline.xml",
Pedro Loureiro1e296c12021-03-09 18:35:52 +0000227 },
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800228}
229
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800230// Library with all the dependencies for building quickstep
231android_library {
232 name: "QuickstepResLib",
Cole Faustbad33e62023-12-20 11:57:04 -0800233 srcs: [],
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800234 resource_dirs: [
235 "quickstep/res",
Hyunyoung Song5a007fe2021-02-25 00:58:05 -0800236 ],
Thiru Ramasamyd495e8c2021-08-26 10:37:17 -0700237 libs: [
238 "framework-statsd",
239 ],
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800240 static_libs: [
241 "Launcher3ResLib",
Schneider Victor-tuliasd0865f82021-11-09 13:19:21 -0800242 "lottie",
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800243 "SystemUISharedLib",
Jagrut Desaifae321c2023-10-30 20:30:39 +0000244 "SettingsLibSettingsTheme",
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800245 ],
246 manifest: "quickstep/AndroidManifest.xml",
Sunny Goyal1fb271f2021-05-20 10:43:23 -0700247 min_sdk_version: "current",
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800248}
249
Sunny Goyal77954ba2024-03-25 11:53:17 -0700250// Library with all the source code and dependencies for building Launcher Go
Jon Spivacka65d68b2021-04-07 10:22:25 -0700251android_library {
Sunny Goyal77954ba2024-03-25 11:53:17 -0700252 name: "Launcher3GoLib",
Jon Spivacka65d68b2021-04-07 10:22:25 -0700253 srcs: [
Thales Lima2c54bbf2022-07-12 15:45:10 +0000254 ":launcher-src",
255 ":launcher-quickstep-src",
Sunny Goyal77954ba2024-03-25 11:53:17 -0700256 "go/quickstep/src/**/*.java",
257 "go/quickstep/src/**/*.kt",
Jon Spivacka65d68b2021-04-07 10:22:25 -0700258 ],
259 resource_dirs: [
Jon Spivacka65d68b2021-04-07 10:22:25 -0700260 "go/quickstep/res",
261 ],
Ben Murdochfabc8732021-12-02 18:22:17 +0000262 // Note the ordering here is important when it comes to resource
263 // overriding. We want the most specific resource overrides defined
264 // in QuickstepResLib to take precendece, so it should be the final
265 // dependency. See b/205278434 for how this can go wrong.
Jon Spivacka65d68b2021-04-07 10:22:25 -0700266 static_libs: [
Jon Spivacka65d68b2021-04-07 10:22:25 -0700267 "QuickstepResLib",
Jon Spivack89c21c72021-08-13 13:18:24 -0700268 "androidx.room_room-runtime",
Jon Spivacka65d68b2021-04-07 10:22:25 -0700269 ],
Jon Spivack89c21c72021-08-13 13:18:24 -0700270 plugins: ["androidx.room_room-compiler-plugin"],
Arvind Kumar384a0ed2023-07-07 09:41:29 +0530271 manifest: "quickstep/AndroidManifest.xml",
Jon Spivacka65d68b2021-04-07 10:22:25 -0700272 additional_manifests: [
273 "go/AndroidManifest.xml",
274 "AndroidManifest-common.xml",
275 ],
Sunny Goyal1fb271f2021-05-20 10:43:23 -0700276 min_sdk_version: "current",
Colin Crossf156b6b2024-01-11 14:03:12 -0800277 // TODO(b/319712088): re-enable use_resource_processor
278 use_resource_processor: false,
Jon Spivacka65d68b2021-04-07 10:22:25 -0700279}
280
Sunny Goyal77954ba2024-03-25 11:53:17 -0700281// Library with all the source code and dependencies for building Quickstep
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700282android_library {
283 name: "Launcher3QuickStepLib",
284 srcs: [
Thales Lima2c54bbf2022-07-12 15:45:10 +0000285 ":launcher-src",
286 ":launcher-quickstep-src",
Sunny Goyal77954ba2024-03-25 11:53:17 -0700287 ":launcher-build-config",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700288 ],
Thales Limac335ad22021-11-08 15:31:49 +0000289 resource_dirs: [],
Thiru Ramasamyd495e8c2021-08-26 10:37:17 -0700290 libs: [
291 "framework-statsd",
292 ],
Ben Murdochfabc8732021-12-02 18:22:17 +0000293 // Note the ordering here is important when it comes to resource
294 // overriding. We want the most specific resource overrides defined
295 // in QuickstepResLib to take precendece, so it should be the final
296 // dependency. See b/208647810 for how this can go wrong.
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700297 static_libs: [
298 "SystemUI-statsd",
Ben Murdochfabc8732021-12-02 18:22:17 +0000299 "QuickstepResLib",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700300 ],
301 manifest: "quickstep/AndroidManifest.xml",
302 platform_apis: true,
303 min_sdk_version: "current",
Colin Crossf156b6b2024-01-11 14:03:12 -0800304 // TODO(b/319712088): re-enable use_resource_processor
305 use_resource_processor: false,
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700306}
Thales Lima813834a2022-05-18 15:29:59 +0000307
Thales Lima813834a2022-05-18 15:29:59 +0000308// Build rule for Quickstep app.
309android_app {
310 name: "Launcher3QuickStep",
311
312 static_libs: ["Launcher3QuickStepLib"],
313 optimize: {
314 enabled: false,
315 },
316
317 platform_apis: true,
318 min_sdk_version: "current",
319 target_sdk_version: "current",
320
321 privileged: true,
322 system_ext_specific: true,
323 overrides: [
324 "Home",
325 "Launcher2",
326 "Launcher3",
327 ],
328 required: ["privapp_whitelist_com.android.launcher3"],
329
330 resource_dirs: ["quickstep/res"],
331
332 additional_manifests: [
333 "quickstep/AndroidManifest-launcher.xml",
334 "AndroidManifest-common.xml",
335 ],
336
337 manifest: "quickstep/AndroidManifest.xml",
338 jacoco: {
339 include_filter: ["com.android.launcher3.*"],
Cole Faustbad33e62023-12-20 11:57:04 -0800340 },
Thales Lima813834a2022-05-18 15:29:59 +0000341
342}
343
Thales Lima813834a2022-05-18 15:29:59 +0000344
Sunny Goyal77954ba2024-03-25 11:53:17 -0700345// Build rule for Launcher3 Go app with quickstep for Android Go devices.
346// Note that the following two rules are exactly same, and should
347// eventually be merged into a single target
348android_app {
349 name: "Launcher3Go",
350
351 static_libs: ["Launcher3GoLib"],
Sunny Goyal3b452f52024-04-12 19:16:19 +0000352 resource_dirs: [],
Thales Lima813834a2022-05-18 15:29:59 +0000353
354 platform_apis: true,
355 min_sdk_version: "current",
356 target_sdk_version: "current",
357
Thales Lima813834a2022-05-18 15:29:59 +0000358 optimize: {
359 proguard_flags_files: ["proguard.flags"],
360 enabled: true,
361 },
362
363 privileged: true,
364 system_ext_specific: true,
365 overrides: [
366 "Home",
367 "Launcher2",
368 "Launcher3",
369 "Launcher3QuickStep",
370 ],
371 required: ["privapp_whitelist_com.android.launcher3"],
372
373 additional_manifests: [
374 "go/AndroidManifest.xml",
375 "go/AndroidManifest-launcher.xml",
376 "AndroidManifest-common.xml",
377 ],
378
379 manifest: "quickstep/AndroidManifest.xml",
380 jacoco: {
381 include_filter: ["com.android.launcher3.*"],
Cole Faustbad33e62023-12-20 11:57:04 -0800382 },
Sunny Goyal77954ba2024-03-25 11:53:17 -0700383}
384android_app {
385 name: "Launcher3QuickStepGo",
Thales Lima813834a2022-05-18 15:29:59 +0000386
Sunny Goyal77954ba2024-03-25 11:53:17 -0700387 static_libs: ["Launcher3GoLib"],
Sunny Goyal3b452f52024-04-12 19:16:19 +0000388 resource_dirs: [],
Sunny Goyal77954ba2024-03-25 11:53:17 -0700389
390 platform_apis: true,
391 min_sdk_version: "current",
392 target_sdk_version: "current",
393
394 optimize: {
395 proguard_flags_files: ["proguard.flags"],
396 enabled: true,
397 },
398
399 privileged: true,
400 system_ext_specific: true,
401 overrides: [
402 "Home",
403 "Launcher2",
404 "Launcher3",
405 "Launcher3QuickStep",
406 ],
407 required: ["privapp_whitelist_com.android.launcher3"],
408
409 additional_manifests: [
410 "go/AndroidManifest.xml",
411 "go/AndroidManifest-launcher.xml",
412 "AndroidManifest-common.xml",
413 ],
414
415 manifest: "quickstep/AndroidManifest.xml",
416 jacoco: {
417 include_filter: ["com.android.launcher3.*"],
418 },
Thales Lima813834a2022-05-18 15:29:59 +0000419}