apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion

    defaultConfig {
        targetSdkVersion rootProject.compileSdkVersion
        minSdkVersion rootProject.minSdkVersion
        versionName version

        testInstrumentationRunner "io.qameta.allure.espresso.AllureAndroidRunner"
    }

    lintOptions {
        htmlReport false
        abortOnError false
        warningsAsErrors false
        lintConfig file("${project.name}-lint.xml")
    }

    packagingOptions {
        exclude 'LICENSE.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
        espresso.java.srcDirs += 'src/espresso/kotlin'
        androidTest.java.srcDirs += 'src/androidTest/kotlin'
    }

    testBuildType 'espresso'
    buildTypes {
        espresso {
            initWith debug
        }
    }
}

dependencies {
    implementation project(':allure-android-model')
    implementation project(':allure-android-commons')
    implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
    implementation "androidx.annotation:annotation:${androidXVersion}"
    implementation "androidx.test:runner:${androidXTestVersion}"
    implementation "androidx.test:rules:${androidXTestVersion}"
    implementation "androidx.multidex:multidex:${multidexVersion}"
    implementation "androidx.test.uiautomator:uiautomator:${uiAutomatorVersion}"
    implementation "junit:junit:${jUnitVersion}"

    androidTestImplementation "org.jetbrains.kotlin:kotlin-test-junit:${kotlinVersion}"
    androidTestImplementation "androidx.test.espresso:espresso-core:${espressoVersion}"

    espressoImplementation "androidx.appcompat:appcompat:${androidXVersion}"
    espressoImplementation "androidx.constraintlayout:constraintlayout:1.1.3"
    espressoImplementation "io.reactivex:rxjava:1.3.8"
}

task copyLibs(type: Copy) {
    from configurations.compile
    from configurations.testCompile
    into 'libs'
}