1// 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 15package { 16 // See: http://go/android-license-faq 17 default_applicable_licenses: ["Android-Apache-2.0"], 18} 19 20min_launcher3_sdk_version = "30" 21 22// Common source files used to build launcher (java and kotlin) 23// All sources are split so they can be reused in many other libraries/apps in other folders 24 25// Main Launcher source, excluding the build config 26filegroup { 27 name: "launcher-src", 28 srcs: [ 29 "src/**/*.java", 30 "src/**/*.kt", 31 ], 32} 33 34// Source code for quickstep build, on top of launcher-src 35filegroup { 36 name: "launcher-quickstep-src", 37 srcs: [ 38 "quickstep/src/**/*.java", 39 "quickstep/src/**/*.kt", 40 ], 41} 42 43// Alternate source when quickstep is not included 44filegroup { 45 name: "launcher-src_no_quickstep", 46 srcs: [ 47 "src_no_quickstep/**/*.java", 48 "src_no_quickstep/**/*.kt", 49 ], 50} 51 52// Default build config for Launcher3 53filegroup { 54 name: "launcher-build-config", 55 srcs: [ 56 "src_build_config/**/*.java", 57 ], 58} 59 60// Proguard files for Launcher3 61filegroup { 62 name: "launcher-proguard-rules", 63 srcs: ["proguard.flags"], 64} 65 66android_library { 67 name: "launcher-aosp-tapl", 68 libs: [ 69 "framework-statsd", 70 ], 71 static_libs: [ 72 "androidx.annotation_annotation", 73 "androidx.test.runner", 74 "androidx.test.rules", 75 "androidx.test.uiautomator_uiautomator", 76 "androidx.preference_preference", 77 "SystemUISharedLib", 78 "//frameworks/libs/systemui:animationlib", 79 "launcher-testing-shared", 80 ], 81 srcs: [ 82 "tests/tapl/**/*.java", 83 "tests/tapl/**/*.kt", 84 ], 85 resource_dirs: [], 86 manifest: "tests/tapl/AndroidManifest.xml", 87 platform_apis: true, 88} 89 90java_library_static { 91 name: "launcher_log_protos_lite", 92 srcs: [ 93 "protos/*.proto", 94 "protos_overrides/*.proto", 95 ], 96 sdk_version: "current", 97 proto: { 98 type: "lite", 99 local_include_dirs: [ 100 "protos", 101 "protos_overrides", 102 ], 103 }, 104 static_libs: ["libprotobuf-java-lite"], 105} 106 107java_library_static { 108 name: "launcher_quickstep_log_protos_lite", 109 srcs: [ 110 "quickstep/protos_overrides/*.proto", 111 ], 112 sdk_version: "current", 113 proto: { 114 type: "lite", 115 local_include_dirs: [ 116 "quickstep/protos_overrides", 117 ], 118 }, 119 static_libs: [ 120 "libprotobuf-java-lite", 121 "launcher_log_protos_lite", 122 ], 123} 124 125java_library { 126 name: "LauncherPluginLib", 127 128 static_libs: ["PluginCoreLib"], 129 130 srcs: ["src_plugins/**/*.java"], 131 132 sdk_version: "current", 133 min_sdk_version: min_launcher3_sdk_version, 134} 135 136// Library with all the dependencies for building Launcher3 137android_library { 138 name: "Launcher3ResLib", 139 srcs: [], 140 resource_dirs: ["res"], 141 static_libs: [ 142 "LauncherPluginLib", 143 "launcher_quickstep_log_protos_lite", 144 "android.os.flags-aconfig-java", 145 "androidx-constraintlayout_constraintlayout", 146 "androidx.recyclerview_recyclerview", 147 "androidx.dynamicanimation_dynamicanimation", 148 "androidx.fragment_fragment", 149 "androidx.preference_preference", 150 "androidx.slice_slice-view", 151 "androidx.cardview_cardview", 152 "androidx.window_window", 153 "com.google.android.material_material", 154 "//frameworks/libs/systemui:iconloader_base", 155 "//frameworks/libs/systemui:view_capture", 156 "//frameworks/libs/systemui:animationlib", 157 "SystemUI-statsd", 158 "launcher-testing-shared", 159 "androidx.lifecycle_lifecycle-common-java8", 160 "androidx.lifecycle_lifecycle-extensions", 161 "androidx.lifecycle_lifecycle-runtime-ktx", 162 "kotlinx_coroutines_android", 163 "kotlinx_coroutines", 164 "com_android_launcher3_flags_lib", 165 "com_android_wm_shell_flags_lib", 166 "android.appwidget.flags-aconfig-java", 167 "com.android.window.flags.window-aconfig-java", 168 ], 169 manifest: "AndroidManifest-common.xml", 170 sdk_version: "current", 171 min_sdk_version: min_launcher3_sdk_version, 172 lint: { 173 baseline_filename: "lint-baseline.xml", 174 }, 175} 176 177// 178// Build rule for Launcher3 app. 179// 180android_app { 181 name: "Launcher3", 182 183 static_libs: [ 184 "Launcher3ResLib", 185 ], 186 srcs: [ 187 ":launcher-src", 188 ":launcher-src_no_quickstep", 189 ":launcher-build-config", 190 ], 191 192 optimize: { 193 proguard_flags_files: ["proguard.flags"], 194 // Proguard is disable for testing. Derivarive prjects to keep proguard enabled 195 enabled: false, 196 }, 197 198 sdk_version: "current", 199 min_sdk_version: min_launcher3_sdk_version, 200 target_sdk_version: "current", 201 privileged: true, 202 system_ext_specific: true, 203 204 overrides: [ 205 "Home", 206 "Launcher2", 207 ], 208 required: ["privapp_whitelist_com.android.launcher3"], 209 210 jacoco: { 211 include_filter: ["com.android.launcher3.**"], 212 }, 213 additional_manifests: [ 214 "AndroidManifest-common.xml", 215 ], 216 lint: { 217 baseline_filename: "lint-baseline.xml", 218 }, 219} 220 221// Library with all the dependencies for building quickstep 222android_library { 223 name: "QuickstepResLib", 224 srcs: [], 225 resource_dirs: [ 226 "quickstep/res", 227 ], 228 libs: [ 229 "framework-statsd", 230 ], 231 static_libs: [ 232 "Launcher3ResLib", 233 "lottie", 234 "SystemUISharedLib", 235 "SettingsLibSettingsTheme", 236 ], 237 manifest: "quickstep/AndroidManifest.xml", 238 min_sdk_version: "current", 239} 240 241// Library with all the source code and dependencies for building Launcher Go 242android_library { 243 name: "Launcher3GoLib", 244 srcs: [ 245 ":launcher-src", 246 ":launcher-quickstep-src", 247 "go/quickstep/src/**/*.java", 248 "go/quickstep/src/**/*.kt", 249 ], 250 resource_dirs: [ 251 "go/quickstep/res", 252 ], 253 // Note the ordering here is important when it comes to resource 254 // overriding. We want the most specific resource overrides defined 255 // in QuickstepResLib to take precendece, so it should be the final 256 // dependency. See b/205278434 for how this can go wrong. 257 static_libs: [ 258 "QuickstepResLib", 259 "androidx.room_room-runtime", 260 ], 261 plugins: ["androidx.room_room-compiler-plugin"], 262 manifest: "quickstep/AndroidManifest.xml", 263 additional_manifests: [ 264 "go/AndroidManifest.xml", 265 "AndroidManifest-common.xml", 266 ], 267 min_sdk_version: "current", 268 // TODO(b/319712088): re-enable use_resource_processor 269 use_resource_processor: false, 270} 271 272// Library with all the source code and dependencies for building Quickstep 273android_library { 274 name: "Launcher3QuickStepLib", 275 srcs: [ 276 ":launcher-src", 277 ":launcher-quickstep-src", 278 ":launcher-build-config", 279 ], 280 resource_dirs: [], 281 libs: [ 282 "framework-statsd", 283 ], 284 // Note the ordering here is important when it comes to resource 285 // overriding. We want the most specific resource overrides defined 286 // in QuickstepResLib to take precendece, so it should be the final 287 // dependency. See b/208647810 for how this can go wrong. 288 static_libs: [ 289 "SystemUI-statsd", 290 "QuickstepResLib", 291 ], 292 manifest: "quickstep/AndroidManifest.xml", 293 platform_apis: true, 294 min_sdk_version: "current", 295 // TODO(b/319712088): re-enable use_resource_processor 296 use_resource_processor: false, 297} 298 299// Build rule for Quickstep app. 300android_app { 301 name: "Launcher3QuickStep", 302 303 static_libs: ["Launcher3QuickStepLib"], 304 optimize: { 305 enabled: false, 306 }, 307 308 platform_apis: true, 309 min_sdk_version: "current", 310 target_sdk_version: "current", 311 312 privileged: true, 313 system_ext_specific: true, 314 overrides: [ 315 "Home", 316 "Launcher2", 317 "Launcher3", 318 ], 319 required: ["privapp_whitelist_com.android.launcher3"], 320 321 resource_dirs: ["quickstep/res"], 322 323 additional_manifests: [ 324 "quickstep/AndroidManifest-launcher.xml", 325 "AndroidManifest-common.xml", 326 ], 327 328 manifest: "quickstep/AndroidManifest.xml", 329 jacoco: { 330 include_filter: ["com.android.launcher3.*"], 331 }, 332 333} 334 335 336// Build rule for Launcher3 Go app with quickstep for Android Go devices. 337// Note that the following two rules are exactly same, and should 338// eventually be merged into a single target 339android_app { 340 name: "Launcher3Go", 341 342 static_libs: ["Launcher3GoLib"], 343 resource_dirs: [], 344 345 platform_apis: true, 346 min_sdk_version: "current", 347 target_sdk_version: "current", 348 349 optimize: { 350 proguard_flags_files: ["proguard.flags"], 351 enabled: true, 352 }, 353 354 privileged: true, 355 system_ext_specific: true, 356 overrides: [ 357 "Home", 358 "Launcher2", 359 "Launcher3", 360 "Launcher3QuickStep", 361 ], 362 required: ["privapp_whitelist_com.android.launcher3"], 363 364 additional_manifests: [ 365 "go/AndroidManifest.xml", 366 "go/AndroidManifest-launcher.xml", 367 "AndroidManifest-common.xml", 368 ], 369 370 manifest: "quickstep/AndroidManifest.xml", 371 jacoco: { 372 include_filter: ["com.android.launcher3.*"], 373 }, 374} 375android_app { 376 name: "Launcher3QuickStepGo", 377 378 static_libs: ["Launcher3GoLib"], 379 resource_dirs: [], 380 381 platform_apis: true, 382 min_sdk_version: "current", 383 target_sdk_version: "current", 384 385 optimize: { 386 proguard_flags_files: ["proguard.flags"], 387 enabled: true, 388 }, 389 390 privileged: true, 391 system_ext_specific: true, 392 overrides: [ 393 "Home", 394 "Launcher2", 395 "Launcher3", 396 "Launcher3QuickStep", 397 ], 398 required: ["privapp_whitelist_com.android.launcher3"], 399 400 additional_manifests: [ 401 "go/AndroidManifest.xml", 402 "go/AndroidManifest-launcher.xml", 403 "AndroidManifest-common.xml", 404 ], 405 406 manifest: "quickstep/AndroidManifest.xml", 407 jacoco: { 408 include_filter: ["com.android.launcher3.*"], 409 }, 410} 411