1plugins {
2    id 'com.android.application'
3    id 'com.google.gms.google-services'
4    id 'com.github.sherter.google-java-format' version '0.9'
5}
6
7android {
8    compileSdkVersion 30
9
10    defaultConfig {
11        applicationId "com.android.car.debuggingrestrictioncontroller"
12        minSdkVersion 30
13        targetSdkVersion 30
14        versionCode 1
15        versionName "1.0"
16        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17        def rootCACertFile = new File("${System.env.DRC_ROOT_CA_CERT}")
18        if (!rootCACertFile.isFile()) {
19            buildConfigField "boolean", "TOKEN_USES_SELF_SIGNED_CA", "false"
20            buildConfigField "String", "ROOT_CA_CERT", "\"\""
21        } else {
22            buildConfigField "boolean", "TOKEN_USES_SELF_SIGNED_CA", "true"
23            buildConfigField "String", "ROOT_CA_CERT",
24                    "\"${rootCACertFile.getText("UTF-8").replaceAll("\\R", "\\\\n")}\""
25        }
26        buildConfigField "String", "TOKEN_ISSUER_HOST_NAME",
27                "\"${System.env.DRC_API_HOSTNAME}\""
28        buildConfigField "String", "TOKEN_ISSUER_API_NAME",
29                "\"${System.env.DRC_API_NAME}\""
30    }
31
32    buildTypes {
33        debug {
34            buildConfigField "String", "DRC_TEST_EMAIL",
35                    "\"${System.env.DRC_TEST_EMAIL}\""
36            buildConfigField "String", "DRC_TEST_PASSWORD",
37                    "\"${System.env.DRC_TEST_PASSWORD}\""
38            testCoverageEnabled true
39        }
40        release {
41            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
42                    'proguard-rules.pro'
43            minifyEnabled true
44        }
45    }
46
47    compileOptions {
48        sourceCompatibility JavaVersion.VERSION_1_8
49        targetCompatibility JavaVersion.VERSION_1_8
50    }
51
52    testOptions {
53        animationsDisabled = true
54    }
55
56    packagingOptions {
57        exclude 'META-INF/DEPENDENCIES'
58    }
59}
60
61dependencies {
62    implementation 'androidx.appcompat:appcompat:1.2.0'
63    implementation 'com.google.android.material:material:1.2.1'
64    implementation 'androidx.annotation:annotation:1.1.0'
65    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
66    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
67    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
68    implementation 'com.google.api-client:google-api-client:1.30.10'
69    implementation platform('com.google.firebase:firebase-bom:26.2.0')
70    implementation 'com.google.firebase:firebase-auth'
71    implementation 'com.google.firebase:firebase-functions'
72    implementation 'androidx.test.espresso:espresso-idling-resource:3.3.0'
73    testImplementation 'junit:junit:4.+'
74    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
75    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
76    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
77    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.3.0'
78}