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: "WallpaperPicker2Lib",
26    platform_apis: true,
27
28    static_libs: [
29        "androidx.activity_activity-ktx",
30        "androidx.appcompat_appcompat",
31        "androidx.cardview_cardview",
32        "androidx-constraintlayout_constraintlayout",
33        "androidx.exifinterface_exifinterface",
34        "androidx.lifecycle_lifecycle-livedata-ktx",
35        "androidx.lifecycle_lifecycle-runtime-ktx",
36        "androidx.recyclerview_recyclerview",
37        "androidx.slice_slice-view",
38        "androidx.transition_transition-ktx",
39        "androidx.viewpager2_viewpager2",
40        "androidx.navigation_navigation-ui-ktx",
41        "androidx.navigation_navigation-fragment-ktx",
42        "com.google.android.material_material",
43        "com_android_wallpaper_flags_lib",
44        "glide-prebuilt",
45        "glide-gifdecoder-prebuilt",
46        "glide-disklrucache-prebuilt",
47        "kotlinx-coroutines-android",
48        "kotlinx-coroutines-core",
49        "libbackup",
50        "SettingsLibCollapsingToolbarBaseActivity",
51	      "SettingsLibSettingsTheme",
52        "subsampling-scale-image-view",
53        "SystemUISharedLib",
54        "SystemUICustomizationLib",
55        "volley",
56        "SettingsLibActivityEmbedding",
57        "monet",
58        "android-support-v7-recyclerview",
59        "flexbox",
60        "hilt_android",
61        "accessibility_settings_flags_lib",
62    ],
63
64    resource_dirs: ["res"],
65
66    srcs: [
67        "src/**/*.java",
68        "src/**/*.kt",
69    ],
70
71    optimize: {
72        enabled: false,
73    },
74
75    kotlincflags: ["-Xjvm-default=all"],
76
77    manifest: "AndroidManifest-empty.xml",
78
79    visibility: [
80        ":__subpackages__",
81        "//packages/apps/ThemePicker:__subpackages__",
82        "//vendor:__subpackages__",
83    ],
84}
85
86// Production-only files that should be excluded in tests.
87filegroup {
88    name: "WallpaperPicker2_src_prod",
89    visibility: [":__subpackages__"],
90    srcs: ["src_override/com/android/wallpaper/picker/WallpapersApplication.java"],
91}
92
93java_library {
94    name: "WallpaperPicker2OverridesLib",
95    srcs: [
96        "src_override/**/*.java",
97        "src_override/**/*.kt",
98    ],
99    exclude_srcs: [
100        ":WallpaperPicker2_src_prod",
101    ],
102    libs: [
103        "WallpaperPicker2Lib",
104        "hilt_android",
105    ],
106}
107
108java_library {
109    name: "WallpaperPicker2ApplicationLib",
110    srcs: [":WallpaperPicker2_src_prod"],
111    libs: [
112        "WallpaperPicker2Lib",
113        "WallpaperPicker2OverridesLib",
114        "hilt_android",
115    ],
116}
117
118filegroup {
119    name: "WallpaperPicker2_Manifest",
120    srcs: [
121        "AndroidManifest.xml",
122    ],
123}
124
125java_defaults {
126    name: "WallpaperPicker2_defaults",
127
128    certificate: "",
129
130    optimize: {
131        enabled: false,
132    },
133
134    kotlincflags: ["-Xjvm-default=all"],
135    privileged: true,
136    system_ext_specific: true,
137
138    use_embedded_native_libs: true,
139
140    static_libs: [
141        "WallpaperPicker2Lib",
142        "hilt_android",
143    ],
144}
145
146java_defaults {
147    name: "WallpaperPicker2_defaults_with_overrides",
148    defaults: ["WallpaperPicker2_defaults"],
149
150    static_libs: [
151        "WallpaperPicker2OverridesLib",
152    ],
153}
154
155//
156// Build app code.
157//
158android_app {
159    name: "WallpaperPicker2",
160    package_name: "com.android.wallpaper",
161
162    defaults: ["WallpaperPicker2_defaults_with_overrides"],
163    manifest: ":WallpaperPicker2_Manifest",
164
165    platform_apis: true,
166    overrides: ["WallpaperPicker"],
167    static_libs: ["WallpaperPicker2ApplicationLib"],
168}
169