/*
 *   Copyright 2016 Fabio Collini.
 *
 *  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.
 */

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
    }
}


apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "kotlin-allopen"

allOpen {
    annotation("it.cosenonjaviste.daggermock.realworldappkotlin.AllOpen")
}

android {
    compileSdkVersion 28

    defaultConfig {
        applicationId "it.cosenonjaviste.daggermock.realworldappkotlin"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }
}

dependencies {
    testImplementation "junit:junit:$JUNIT_VERSION"
    testImplementation "org.mockito:mockito-core:$MOCKITO_VERSION"
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'

    implementation "com.google.dagger:dagger:$DAGGER_VERSION"
    kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
    testAnnotationProcessor "com.google.dagger:dagger-compiler:$DAGGER_VERSION"

    testImplementation project(':daggermock')
    androidTestImplementation project(':daggermock')
    androidTestImplementation project(':daggermock-kotlin')

    testImplementation 'org.assertj:assertj-core:3.17.2'

    androidTestImplementation 'com.github.tmurakami:dexopener:2.0.5'
    testImplementation "org.robolectric:robolectric:$ROBOLECTRIC_VERSION"
    testImplementation "androidx.test:runner:$ANDROIDX_TEST_VERSION"
    testImplementation "androidx.test:rules:$ANDROIDX_TEST_VERSION"

    androidTestImplementation "org.mockito:mockito-android:$MOCKITO_VERSION"
    androidTestImplementation "androidx.test:runner:$ANDROIDX_TEST_VERSION"
    androidTestImplementation "androidx.test:rules:$ANDROIDX_TEST_VERSION"
    androidTestImplementation "androidx.test:core:$ANDROIDX_TEST_VERSION"

    androidTestImplementation "androidx.test.espresso:espresso-core:$ANDROIDX_ESPRESSO_VERSION"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
