apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'shot'

def deps = rootProject.extensions.ext

android {
    compileSdkVersion deps.android.compileSdkVersion
    defaultConfig {
        applicationId deps.application.id
        minSdkVersion deps.android.minSdkVersion
        targetSdkVersion deps.android.targetSdkVersion
        versionCode deps.versionCode
        versionName deps.versionName
        testInstrumentationRunner "${deps.application.id}.helpers.ScreenshotTestRunner"
    }
    dexOptions {
        // Skip pre-dexing when running on CI or when disabled via -DpreDex=false.
        preDexLibraries !deps.building.runningOnCI && deps.building.preDexEnabled
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

shot {
    appId = deps.application.id
    runInstrumentation = false
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':counterfab')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$compiling.kotlinVersion"
    implementation "com.google.android.material:material:$ui.materialVersion"
    implementation "androidx.appcompat:appcompat:$aux.appCompatVersion"

    testImplementation "junit:junit:$testing.junitVersion"

    androidTestImplementation "androidx.test.espresso:espresso-core:$testing.espressoCoreVersion"
    androidTestImplementation "androidx.test:rules:$testing.rulesVersion"
    androidTestImplementation dependencies.create("com.facebook.testing.screenshot:core:$testing.screenshotTestingVersion") {
        exclude group: 'com.crittercism.dexmaker', module: 'dexmaker'
        exclude group: 'com.crittercism.dexmaker', module: 'dexmaker-dx'
    }
}