| /* |
| * Copyright (C) 2021 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| apply plugin: 'com.android.application' |
| apply plugin: 'jacoco' |
| |
| android { |
| compileSdkVersion gradle.ext.aaosLatestSDK |
| |
| defaultConfig { |
| applicationId 'com.android.car.dialer' |
| minSdkVersion 29 // Dialer requires apis that became public in Q. |
| targetSdkVersion gradle.ext.aaosTargetSDK |
| testInstrumentationRunnerArguments clearPackageData: 'true', coverage: 'true' |
| } |
| |
| flavorDimensions 'devMode' |
| productFlavors { |
| fake { |
| dimension 'devMode' |
| versionNameSuffix '-fake' |
| testInstrumentationRunner 'com.android.car.dialer.integration.DialerHiltTestRunner' |
| } |
| |
| emulator { |
| dimension 'devMode' |
| versionNameSuffix '-emulator' |
| testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' |
| } |
| |
| production { |
| dimension 'devMode' |
| } |
| } |
| |
| sourceSets { |
| main { |
| manifest.srcFile 'AndroidManifest.xml' |
| res.srcDirs = ['res'] |
| } |
| |
| production { |
| java.srcDirs = ['src'] |
| } |
| |
| emulator { |
| java.srcDirs = ['src', 'framework/emulator/src'] |
| java.excludes = ['com/android/car/dialer/inject/BluetoothSingleHfpModule.java', 'com/android/car/dialer/inject/HfpDataModules.java'] |
| } |
| |
| fake { |
| java.srcDirs = ['src'] |
| java.excludes = ['com/android/car/dialer/inject/BluetoothSingleHfpModule.java'] |
| } |
| |
| androidTestEmulator.setRoot('tests/unittests') |
| androidTestEmulator.java.srcDirs=['tests/unittests/src'] |
| androidTestFake.setRoot('tests/instrutests') |
| androidTestFake.java.srcDirs = ['tests/instrutests/src'] |
| } |
| |
| compileOptions { |
| sourceCompatibility JavaVersion.VERSION_1_8 |
| targetCompatibility JavaVersion.VERSION_1_8 |
| } |
| |
| testOptions { |
| animationsDisabled = true |
| } |
| |
| buildTypes { |
| debug { |
| testCoverageEnabled = true |
| } |
| } |
| |
| project.gradle.taskGraph.whenReady { |
| connectedEmulatorDebugAndroidTest { |
| ignoreFailures = true |
| } |
| connectedFakeDebugAndroidTest { |
| ignoreFailures = true |
| } |
| } |
| |
| // Disable release build for fake and emulator build |
| variantFilter { variant -> |
| def names = variant.flavors*.name |
| if (variant.buildType.name == 'release') { |
| if (names.contains('fake') || names.contains('emulator')) { |
| setIgnore(true) |
| } |
| } |
| } |
| |
| signingConfigs { |
| debug { |
| // storeFile file('../libs/certs/com_android_car_apps_test.jks') |
| // storePassword 'carapps' |
| // keyAlias 'carapps' |
| // keyPassword 'carapps' |
| // The following signs the apk with platform key. |
| storeFile file('../../../../vendor/google/certs/devkeys/platform.keystore') |
| storePassword 'android' |
| } |
| } |
| } |
| |
| dependencies { |
| runtimeOnly 'androidx.legacy:legacy-support-v4:1.0.0' |
| implementation files(gradle.ext.lib_car_system_stubs) |
| |
| implementation 'androidx.constraintlayout:constraintlayout:2.1.0' |
| implementation 'androidx.cardview:cardview:1.0.0' |
| implementation 'androidx.preference:preference:1.1.1' |
| implementation 'androidx.recyclerview:recyclerview:1.2.1' |
| |
| implementation 'com.google.dagger:hilt-android:2.38.1' |
| annotationProcessor 'com.google.dagger:hilt-android-compiler:2.38.1' |
| |
| def room_version = '2.3.0' |
| implementation "androidx.room:room-runtime:$room_version" |
| annotationProcessor "androidx.room:room-compiler:$room_version" |
| |
| def sqlite_version = '2.1.0' |
| implementation "androidx.sqlite:sqlite:$sqlite_version" |
| // Implementation of the AndroidX SQLite interfaces via the Android framework APIs. |
| implementation "androidx.sqlite:sqlite-framework:$sqlite_version" |
| |
| def lifecycle_version = '2.2.0' |
| implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version" |
| // Not available in 2.3+ |
| implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" |
| |
| implementation 'com.github.bumptech.glide:glide:4.12.0' |
| implementation 'com.google.guava:guava:30.1.1-android' |
| implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.31' |
| |
| implementation project(':car-ui-lib') |
| implementation project(':car-apps-common') |
| implementation project(':car-uxr-client-lib') |
| implementation project(':car-assist-lib') |
| implementation project(':car-messenger-common') |
| implementation project(':car-telephony-common') |
| implementation project(path: ':car-dialer-app:framework') |
| |
| androidTestImplementation 'androidx.test.ext:junit:1.1.3' |
| androidTestImplementation 'androidx.test:core:1.4.0' |
| androidTestImplementation 'androidx.test:runner:1.4.0' |
| androidTestImplementation 'androidx.test:rules:1.4.0' |
| androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' |
| androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0' |
| androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0' |
| androidTestImplementation 'com.google.truth:truth:1.1.3' |
| androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito-inline:2.28.1' |
| |
| emulatorImplementation project(path: ':car-dialer-app:testing') |
| androidTestEmulatorImplementation 'com.linkedin.dexmaker:dexmaker-mockito-inline-extended:2.28.1' |
| androidTestEmulatorImplementation 'org.hamcrest:hamcrest:2.2' |
| |
| fakeImplementation project(path: ':car-dialer-app:testing') |
| androidTestFakeImplementation 'com.google.dagger:hilt-android-testing:2.38.1' |
| androidTestFakeAnnotationProcessor 'com.google.dagger:hilt-android-compiler:2.38.1' |
| androidTestFakeImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' |
| } |