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 19genrule { 20 name: "statslog-carsettings-java-gen", 21 tools: ["stats-log-api-gen"], 22 cmd: "$(location stats-log-api-gen) --java $(out) --module carsettings" + 23 " --javaPackage com.android.car.settings --javaClass CarSettingsStatsLog", 24 out: ["com/android/car/settings/CarSettingsStatsLog.java"], 25} 26 27carsettings_srcs = [ 28 "src/**/*.kt", 29 "src/**/*.java", 30 ":statslog-carsettings-java-gen", 31] 32 33android_library { 34 name: "CarSettings-core", 35 platform_apis: true, 36 defaults: [ 37 "SettingsLibDefaults", 38 "SettingsLib-search-defaults", 39 ], 40 41 srcs: carsettings_srcs, 42 43 static_libs: [ 44 "androidx.lifecycle_lifecycle-common-java8", 45 "androidx.lifecycle_lifecycle-extensions", 46 "androidx.preference_preference", 47 "androidx.window_window", 48 "androidx-constraintlayout_constraintlayout", 49 "androidx.test.core", 50 "car-apps-common", 51 "car-setup-wizard-lib-utils", 52 "WifiTrackerLib", 53 "SettingsLib", 54 "SettingsLib-search", 55 "androidx-constraintlayout_constraintlayout-solver", 56 "jsr305", 57 "car-ui-lib", 58 "car-admin-ui-lib", 59 "car-helper-lib", 60 "car-qc-lib", 61 "com_android_car_settings_flags_lib", 62 "services.core", 63 "car-data-subscription-lib", 64 "oem-token-lib", 65 ], 66 67 libs: [ 68 "android.car", 69 "token-shared-lib-prebuilt", 70 ], 71 72 enforce_uses_libs: false, 73 74 manifest: "AndroidManifest.xml", 75 resource_dirs: ["res"], 76 // TODO(b/319708040): re-enable use_resource_processor 77 use_resource_processor: false, 78 lint: { 79 warning_checks: [ 80 "FlaggedApi", 81 ], 82 }, 83} 84 85android_app { 86 name: "CarSettings", 87 overrides: ["Settings"], 88 platform_apis: true, 89 90 static_libs: [ 91 "CarSettings-core", 92 ], 93 94 libs: [ 95 "android.car", 96 "token-shared-lib-prebuilt", 97 ], 98 99 enforce_uses_libs: false, 100 101 certificate: "platform", 102 103 optimize: { 104 keep_runtime_invisible_annotations: true, 105 proguard_flags_files: ["proguard.flags"], 106 }, 107 108 privileged: true, 109 110 dex_preopt: { 111 enabled: false, 112 }, 113 114 required: ["allowed_privapp_com.android.car.settings"], 115 116 dxflags: ["--multi-dex"], 117 // TODO(b/319708040): re-enable use_resource_processor 118 use_resource_processor: false, 119} 120 121// Testing app (not lib) is required for deviceless testing (Robolectric) to 122// include testing only resources.This is an app and not a library due to 123// resource processing differences. 124android_app { 125 name: "CarSettingsAppForTesting", 126 platform_apis: true, 127 defaults: [ 128 "SettingsLibDefaults", 129 "SettingsLib-search-defaults", 130 ], 131 132 srcs: carsettings_srcs, 133 134 libs: [ 135 "android.car", 136 "token-shared-lib-prebuilt", 137 ], 138 139 static_libs: [ 140 "CarSettings-core", 141 ], 142 143 enforce_uses_libs: false, 144 145 // Testing only resources must be applied last so they take precedence. 146 resource_dirs: [ 147 "res", 148 "tests/deviceless/res", 149 ], 150 151 certificate: "platform", 152 153 optimize: { 154 enabled: false, 155 }, 156 157 privileged: true, 158 159 dex_preopt: { 160 enabled: false, 161 }, 162 163 dxflags: ["--multi-dex"], 164 // TODO(b/319708040): re-enable use_resource_processor 165 use_resource_processor: false, 166 lint: { 167 warning_checks: [ 168 "FlaggedApi", 169 ], 170 }, 171} 172 173// Testing app (not lib) is required for deviceless testing (Robolectric). 174// This is an app and not a library due to resource processing differences. 175android_app { 176 name: "CarSettingsAppForMultivalentTesting", 177 platform_apis: true, 178 defaults: [ 179 "SettingsLibDefaults", 180 "SettingsLib-search-defaults", 181 ], 182 183 srcs: [ 184 "src/**/*.kt", 185 "src/**/*.java", 186 ], 187 188 libs: [ 189 "android.car", 190 "token-shared-lib-prebuilt", 191 ], 192 193 enforce_uses_libs: false, 194 195 static_libs: [ 196 "CarSettings-core", 197 ], 198 199 // Testing only resources must be applied last so they take precedence. 200 resource_dirs: [ 201 "res", 202 "tests/multivalent/res", 203 ], 204 205 certificate: "platform", 206 207 optimize: { 208 enabled: false, 209 }, 210 211 privileged: true, 212 213 dex_preopt: { 214 enabled: false, 215 }, 216 217 dxflags: ["--multi-dex"], 218 // TODO(b/319708040): re-enable use_resource_processor 219 use_resource_processor: false, 220 lint: { 221 warning_checks: [ 222 "FlaggedApi", 223 ], 224 }, 225} 226 227android_library { 228 name: "CarSettingsLibForDeviceTesting", 229 platform_apis: true, 230 defaults: [ 231 "SettingsLibDefaults", 232 "SettingsLib-search-defaults", 233 ], 234 235 manifest: "tests/multivalent/AndroidManifest.xml", 236 srcs: carsettings_srcs, 237 238 libs: [ 239 "android.car", 240 "token-shared-lib-prebuilt", 241 ], 242 243 static_libs: [ 244 "androidx.lifecycle_lifecycle-common-java8", 245 "androidx.lifecycle_lifecycle-extensions", 246 "androidx.preference_preference", 247 "androidx-constraintlayout_constraintlayout", 248 "car-apps-common", 249 "car-setup-wizard-lib-utils", 250 "WifiTrackerLib", 251 "SettingsLib", 252 "SettingsLib-search", 253 "androidx-constraintlayout_constraintlayout-solver", 254 "jsr305", 255 "car-admin-ui-lib", 256 "car-helper-lib", 257 "car-qc-lib", 258 "com_android_car_settings_flags_lib", 259 "car-data-subscription-lib", 260 "oem-token-lib", 261 ], 262 263 enforce_uses_libs: false, 264 265 // Testing only resources must be applied last so they take precedence. 266 resource_dirs: [ 267 "res", 268 "tests/multivalent/res", 269 ], 270 271 optimize: { 272 enabled: false, 273 }, 274 275 dex_preopt: { 276 enabled: false, 277 }, 278 279 dxflags: ["--multi-dex"], 280 281 aaptflags: ["--extra-packages com.android.car.settings"], 282 // TODO(b/319708040): re-enable use_resource_processor 283 use_resource_processor: false, 284 lint: { 285 warning_checks: [ 286 "FlaggedApi", 287 ], 288 }, 289} 290 291filegroup { 292 name: "CarSettings_proguard_flags", 293 srcs: ["proguard.flags"], 294} 295 296filegroup { 297 name: "CarSettingsShadows-srcs", 298 srcs: ["tests/helpers/src/com/android/car/settings/testutils/Shadow*.java"], 299} 300