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
17// Library-level build file
18
19apply plugin: 'com.android.library'
20apply plugin: 'jacoco'
21
22android {
23    compileSdkVersion 30
24
25    defaultConfig {
26        minSdkVersion 28
27        targetSdkVersion 30
28        versionCode 1
29        versionName "1.0"
30        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
31        testApplicationId "com.android.car.rotary.test"
32    }
33
34    compileOptions {
35        sourceCompatibility JavaVersion.VERSION_1_8
36        targetCompatibility JavaVersion.VERSION_1_8
37    }
38
39    testOptions {
40        unitTests {
41            includeAndroidResources = true
42        }
43        animationsDisabled = true
44    }
45
46    buildTypes {
47        debug {
48            testCoverageEnabled = true
49        }
50    }
51
52    project.gradle.taskGraph.whenReady {
53        connectedDebugAndroidTest {
54            ignoreFailures = true
55        }
56    }
57
58    buildFeatures {
59        buildConfig = false
60    }
61
62    // This is the gradle equivalent of the libs: ["android.car"] in the Android.bp
63    useLibrary 'android.car'
64
65    useLibrary 'android.test.runner'
66    useLibrary 'android.test.base'
67    useLibrary 'android.test.mock'
68}
69
70dependencies {
71    api 'androidx.annotation:annotation:1.2.0'
72    api 'androidx.constraintlayout:constraintlayout:2.0.4'
73    api 'androidx.recyclerview:recyclerview:1.2.1'
74
75    // The tests use a CarUiRecyclerView
76    androidTestImplementation project(':car-ui-lib')
77    androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
78    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
79    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
80    androidTestImplementation 'com.google.truth:truth:1.1.3'
81    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
82    androidTestImplementation "org.mockito:mockito-core:2.19.0"
83    androidTestImplementation 'androidx.test:runner:1.4.0'
84    androidTestImplementation 'androidx.test:rules:1.4.0'
85    // This is needed to be able to spy certain classes with Mockito
86    // It's major/minor version must match Mockito's.
87    androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito-inline:2.28.1'
88    // Required for instrumented tests
89    androidTestImplementation 'com.android.support:support-annotations:28.0.0'
90}
91