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
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19android_library {
20    name: "CarSettings-core",
21    platform_apis: true,
22    defaults: [
23        "SettingsLibDefaults",
24        "SettingsLib-search-defaults",
25    ],
26
27    srcs: ["src/**/*.java"],
28
29    static_libs: [
30        "androidx.lifecycle_lifecycle-common-java8",
31        "androidx.lifecycle_lifecycle-extensions",
32        "androidx.preference_preference",
33        "androidx-constraintlayout_constraintlayout",
34        "androidx.test.core",
35        "car-apps-common",
36        "car-setup-wizard-lib-utils",
37        "SettingsLib",
38        "SettingsLib-search",
39        "android.car.userlib",
40        "androidx-constraintlayout_constraintlayout-solver",
41        "jsr305",
42        "car-ui-lib",
43        "car-admin-ui-lib",
44        "car-qc-lib",
45    ],
46
47    libs: [
48        "android.car",
49    ],
50
51    manifest: "AndroidManifest.xml",
52    resource_dirs: ["res"],
53}
54
55android_app {
56    name: "CarSettings",
57    overrides: ["Settings"],
58    platform_apis: true,
59
60    static_libs: [
61        "CarSettings-core",
62    ],
63
64    certificate: "platform",
65
66    optimize: {
67        enabled: false,
68    },
69
70    privileged: true,
71
72    dex_preopt: {
73        enabled: false,
74    },
75
76    required: ["allowed_privapp_com.android.car.settings"],
77
78    dxflags: ["--multi-dex"],
79
80    product_variables: {
81        pdk: {
82            enabled: false,
83        },
84    },
85}
86
87// Duplicate of CarSettings which includes testing only resources for Robolectric
88android_app {
89    name: "CarSettingsForTesting",
90    platform_apis: true,
91    defaults: [
92        "SettingsLibDefaults",
93        "SettingsLib-search-defaults",
94    ],
95
96    srcs: ["src/**/*.java"],
97
98    libs: [
99        "android.car",
100    ],
101
102    static_libs: [
103        "androidx.lifecycle_lifecycle-common-java8",
104        "androidx.lifecycle_lifecycle-extensions",
105        "androidx.preference_preference",
106        "androidx-constraintlayout_constraintlayout",
107        "androidx.test.core",
108        "car-apps-common",
109        "car-setup-wizard-lib-utils",
110        "SettingsLib",
111        "SettingsLib-search",
112        "android.car.userlib",
113        "androidx-constraintlayout_constraintlayout-solver",
114        "jsr305",
115        "car-ui-lib-testing-support",
116        "car-admin-ui-lib",
117        "car-qc-lib",
118    ],
119
120    // Testing only resources must be applied last so they take precedence.
121    resource_dirs: [
122        "res",
123        "tests/robotests/res",
124    ],
125
126    certificate: "platform",
127
128    optimize: {
129        enabled: false,
130    },
131
132    privileged: true,
133
134    dex_preopt: {
135        enabled: false,
136    },
137
138    dxflags: ["--multi-dex"],
139
140    product_variables: {
141        pdk: {
142            enabled: false,
143        },
144    },
145}
146
147android_library {
148    name: "CarSettingsForUnitTesting",
149    platform_apis: true,
150    defaults: [
151        "SettingsLibDefaults",
152        "SettingsLib-search-defaults",
153    ],
154
155    manifest: "tests/unit/AndroidManifest.xml",
156
157    srcs: ["src/**/*.java"],
158
159    libs: [
160        "android.car",
161    ],
162
163    static_libs: [
164        "androidx.lifecycle_lifecycle-common-java8",
165        "androidx.lifecycle_lifecycle-extensions",
166        "androidx.preference_preference",
167        "androidx-constraintlayout_constraintlayout",
168        "car-apps-common",
169        "car-setup-wizard-lib-utils",
170        "SettingsLib",
171        "SettingsLib-search",
172        "android.car.userlib",
173        "androidx-constraintlayout_constraintlayout-solver",
174        "jsr305",
175        "car-ui-lib-testing-support",
176        "car-admin-ui-lib",
177        "car-qc-lib",
178    ],
179
180    // Testing only resources must be applied last so they take precedence.
181    resource_dirs: [
182        "res",
183        "tests/unit/res",
184    ],
185
186    optimize: {
187        enabled: false,
188    },
189
190    dex_preopt: {
191        enabled: false,
192    },
193
194    dxflags: ["--multi-dex"],
195
196    aaptflags: ["--extra-packages com.android.car.settings"],
197
198    product_variables: {
199        pdk: {
200            enabled: false,
201        },
202    },
203}
204