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 17apply plugin: 'com.android.application' 18apply plugin: 'jacoco' 19 20android { 21 compileSdkVersion gradle.ext.aaosLatestSDK 22 23 defaultConfig { 24 applicationId 'com.android.car.dialer' 25 minSdkVersion 29 // Dialer requires apis that became public in Q. 26 targetSdkVersion gradle.ext.aaosTargetSDK 27 testInstrumentationRunnerArguments clearPackageData: 'true', coverage: 'true' 28 } 29 30 flavorDimensions 'devMode' 31 productFlavors { 32 fake { 33 dimension 'devMode' 34 versionNameSuffix '-fake' 35 testInstrumentationRunner 'com.android.car.dialer.integration.DialerHiltTestRunner' 36 } 37 38 emulator { 39 dimension 'devMode' 40 versionNameSuffix '-emulator' 41 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 42 } 43 44 production { 45 dimension 'devMode' 46 } 47 } 48 49 sourceSets { 50 main { 51 manifest.srcFile 'AndroidManifest.xml' 52 res.srcDirs = ['res'] 53 } 54 55 production { 56 java.srcDirs = ['src'] 57 } 58 59 emulator { 60 java.srcDirs = ['src', 'framework/emulator/src'] 61 java.excludes = ['com/android/car/dialer/inject/BluetoothSingleHfpModule.java', 'com/android/car/dialer/inject/HfpDataModules.java'] 62 } 63 64 fake { 65 java.srcDirs = ['src'] 66 java.excludes = ['com/android/car/dialer/inject/BluetoothSingleHfpModule.java'] 67 } 68 69 androidTestEmulator.setRoot('tests/unittests') 70 androidTestEmulator.java.srcDirs=['tests/unittests/src'] 71 androidTestFake.setRoot('tests/instrutests') 72 androidTestFake.java.srcDirs = ['tests/instrutests/src'] 73 } 74 75 compileOptions { 76 sourceCompatibility JavaVersion.VERSION_1_8 77 targetCompatibility JavaVersion.VERSION_1_8 78 } 79 80 testOptions { 81 animationsDisabled = true 82 } 83 84 buildTypes { 85 debug { 86 testCoverageEnabled = true 87 } 88 } 89 90 project.gradle.taskGraph.whenReady { 91 connectedEmulatorDebugAndroidTest { 92 ignoreFailures = true 93 } 94 connectedFakeDebugAndroidTest { 95 ignoreFailures = true 96 } 97 } 98 99 // Disable release build for fake and emulator build 100 variantFilter { variant -> 101 def names = variant.flavors*.name 102 if (variant.buildType.name == 'release') { 103 if (names.contains('fake') || names.contains('emulator')) { 104 setIgnore(true) 105 } 106 } 107 } 108 109 signingConfigs { 110 debug { 111 // storeFile file('../libs/certs/com_android_car_apps_test.jks') 112 // storePassword 'carapps' 113 // keyAlias 'carapps' 114 // keyPassword 'carapps' 115 // The following signs the apk with platform key. 116 storeFile file('../../../../vendor/google/certs/devkeys/platform.keystore') 117 storePassword 'android' 118 } 119 } 120} 121 122dependencies { 123 runtimeOnly 'androidx.legacy:legacy-support-v4:1.0.0' 124 implementation files(gradle.ext.lib_car_system_stubs) 125 126 implementation 'androidx.constraintlayout:constraintlayout:2.1.0' 127 implementation 'androidx.cardview:cardview:1.0.0' 128 implementation 'androidx.preference:preference:1.1.1' 129 implementation 'androidx.recyclerview:recyclerview:1.2.1' 130 131 implementation 'com.google.dagger:hilt-android:2.38.1' 132 annotationProcessor 'com.google.dagger:hilt-android-compiler:2.38.1' 133 134 def room_version = '2.3.0' 135 implementation "androidx.room:room-runtime:$room_version" 136 annotationProcessor "androidx.room:room-compiler:$room_version" 137 138 def sqlite_version = '2.1.0' 139 implementation "androidx.sqlite:sqlite:$sqlite_version" 140 // Implementation of the AndroidX SQLite interfaces via the Android framework APIs. 141 implementation "androidx.sqlite:sqlite-framework:$sqlite_version" 142 143 def lifecycle_version = '2.2.0' 144 implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version" 145 // Not available in 2.3+ 146 implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" 147 148 implementation 'com.github.bumptech.glide:glide:4.12.0' 149 implementation 'com.google.guava:guava:30.1.1-android' 150 implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.31' 151 152 implementation project(':car-ui-lib') 153 implementation project(':car-apps-common') 154 implementation project(':car-uxr-client-lib') 155 implementation project(':car-assist-lib') 156 implementation project(':car-messenger-common') 157 implementation project(':car-telephony-common') 158 implementation project(path: ':car-dialer-app:framework') 159 160 androidTestImplementation 'androidx.test.ext:junit:1.1.3' 161 androidTestImplementation 'androidx.test:core:1.4.0' 162 androidTestImplementation 'androidx.test:runner:1.4.0' 163 androidTestImplementation 'androidx.test:rules:1.4.0' 164 androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 165 androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0' 166 androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0' 167 androidTestImplementation 'com.google.truth:truth:1.1.3' 168 androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito-inline:2.28.1' 169 170 emulatorImplementation project(path: ':car-dialer-app:testing') 171 androidTestEmulatorImplementation 'com.linkedin.dexmaker:dexmaker-mockito-inline-extended:2.28.1' 172 androidTestEmulatorImplementation 'org.hamcrest:hamcrest:2.2' 173 174 fakeImplementation project(path: ':car-dialer-app:testing') 175 androidTestFakeImplementation 'com.google.dagger:hilt-android-testing:2.38.1' 176 androidTestFakeAnnotationProcessor 'com.google.dagger:hilt-android-compiler:2.38.1' 177 androidTestFakeImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' 178} 179