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