/*
 * Copyright (C) 2019 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.
 */

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
}

android {
    compileSdkVersion 32
    defaultConfig {
        applicationId "com.example.android.dagger"
        minSdkVersion 14
        targetSdkVersion 32
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "com.example.android.dagger.MyCustomTestRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        String sharedTestDir = 'src/sharedTest/java'
        test {
            java.srcDir sharedTestDir
        }
        androidTest {
            java.srcDir sharedTestDir
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

dependencies {
    def dagger_version = "2.40.5"

    implementation "androidx.appcompat:appcompat:1.4.1"
    implementation "androidx.core:core-ktx:1.7.0"
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'

    implementation "com.google.dagger:dagger:$dagger_version"
    kapt "com.google.dagger:dagger-compiler:$dagger_version"

    testImplementation 'junit:junit:4.13.2'
    testImplementation 'org.mockito:mockito-core:3.4.6'
    testImplementation 'android.arch.core:core-testing:1.1.1'

    def androidx_test_version = "1.4.0"
    androidTestImplementation "androidx.test:runner:$androidx_test_version"
    androidTestImplementation "androidx.test:core-ktx:$androidx_test_version"
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    kaptAndroidTest "com.google.dagger:dagger-compiler:$dagger_version"
}
