1// 2// Copyright (C) 2021 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17// 18// Build rule for WallpaperPicker2 dependencies lib. 19// 20package { 21 default_applicable_licenses: ["Android-Apache-2.0"], 22} 23 24android_library { 25 name: "wallpaper-common-deps", 26 27 static_libs: [ 28 "androidx.activity_activity-ktx", 29 "androidx.appcompat_appcompat", 30 "androidx.cardview_cardview", 31 "androidx-constraintlayout_constraintlayout", 32 "androidx.exifinterface_exifinterface", 33 "androidx.lifecycle_lifecycle-livedata-ktx", 34 "androidx.lifecycle_lifecycle-runtime-ktx", 35 "androidx.recyclerview_recyclerview", 36 "androidx.slice_slice-view", 37 "androidx.transition_transition-ktx-nodeps", 38 "androidx.viewpager2_viewpager2", 39 "androidx.navigation_navigation-ui-ktx", 40 "androidx.navigation_navigation-fragment-ktx", 41 "com.google.android.material_material", 42 "glide-prebuilt", 43 "glide-gifdecoder-prebuilt", 44 "glide-disklrucache-prebuilt", 45 "kotlinx-coroutines-android", 46 "kotlinx-coroutines-core", 47 "libbackup", 48 "SettingsLibCollapsingToolbarBaseActivity", 49 "subsampling-scale-image-view", 50 "SystemUISharedLib", 51 "SystemUICustomizationLib", 52 "volley", 53 "SettingsLibActivityEmbedding", 54 ], 55 56 resource_dirs: ["res"], 57 58 optimize: { 59 enabled: false, 60 }, 61 62 kotlincflags: ["-Xjvm-default=enable"], 63 64 sdk_version: "current", 65 66 manifest: "AndroidManifest-empty.xml", 67 68 visibility: [ 69 ":__subpackages__", 70 "//packages/apps/ThemePicker:__subpackages__", 71 "//vendor:__subpackages__", 72 ], 73} 74 75filegroup { 76 name: "WallpaperPicker2_srcs", 77 srcs: [ 78 "src/**/*.java", 79 "src/**/*.kt", 80 ], 81} 82 83// If these targets are included in WallpaperPicker2_defaults directly instead of in a filegroup, 84// the tests can't find them. 85filegroup { 86 name: "WallpaperPicker2_src_overrides", 87 srcs: [ 88 "src_override/**/*.java", 89 "src_override/**/*.kt", 90 ], 91} 92 93genrule { 94 name: "WallpaperPicker2_res", 95 tools: ["soong_zip"], 96 srcs: [ 97 "res/**/*" 98 ], 99 out: ["wallpaperpicker2_res.zip"], 100 cmd: "INPUTS=($(in)) && " 101 + "RES_DIR=$$(dirname $$(dirname $${INPUTS[0]})) && " 102 + "$(location soong_zip) -o $(out) -C $$RES_DIR -D $$RES_DIR" 103} 104 105filegroup { 106 name: "WallpaperPicker2_Manifest", 107 srcs: [ 108 "AndroidManifest.xml", 109 ], 110} 111 112// Common defaults that doesn't have WallpaperPicker2 specifics. 113java_defaults { 114 name: "WallpaperPicker2_common_defaults", 115 116 static_libs: [ 117 "wallpaper-common-deps", 118 "monet", 119 "hilt_android", 120 ], 121 122 srcs: [ 123 ":WallpaperPicker2_srcs", 124 ], 125 resource_zips: [":WallpaperPicker2_res"], 126 127 certificate: "", 128 129 optimize: { 130 enabled: false, 131 }, 132 133 kotlincflags: ["-Xjvm-default=enable"], 134 privileged: true, 135 system_ext_specific: true, 136 137 use_embedded_native_libs: true, 138} 139 140java_defaults { 141 name: "WallpaperPicker2_defaults", 142 143 static_libs: [ 144 "wallpaper-common-deps", 145 "monet", 146 "hilt_android", 147 ], 148 149 srcs: [ 150 ":WallpaperPicker2_srcs", 151 ":WallpaperPicker2_src_overrides", 152 ], 153 resource_zips: [":WallpaperPicker2_res"], 154 155 certificate: "", 156 157 optimize: { 158 enabled: false, 159 }, 160 161 kotlincflags: ["-Xjvm-default=enable"], 162 privileged: true, 163 system_ext_specific: true, 164 165 use_embedded_native_libs: true, 166} 167 168// 169// Build app code. 170// 171android_app { 172 name: "WallpaperPicker2", 173 174 defaults: ["WallpaperPicker2_defaults"], 175 manifest: ":WallpaperPicker2_Manifest", 176 177 platform_apis: true, 178 overrides: ["WallpaperPicker"], 179} 180