buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'org.jacoco:org.jacoco.core:0.7.9'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'jacoco'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    defaultConfig {
        applicationId "com.emmasuzuki.cucumberespressodemo"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testApplicationId "com.emmasuzuki.cucumberespressodemo.test"
        testInstrumentationRunner "com.emmasuzuki.cucumberespressodemo.test.Instrumentation"
    }

    sourceSets {
        androidTest {
            assets.srcDirs = ['src/androidTest/assets']
        }
    }

    buildTypes {
        debug {
            testCoverageEnabled true
            buildConfigField "String", "TEST_TAGS", "\"${getTestTags()}\""
        }

        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'LICENSE.txt'
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    implementation 'com.android.support:appcompat-v7:28.0.0'

    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    androidTestImplementation 'com.android.support:support-annotations:28.0.0'
    androidTestImplementation 'info.cukes:cucumber-android:1.2.5@jar'
    androidTestImplementation 'info.cukes:cucumber-picocontainer:1.2.4'
}

def getTestTags() {
    return project.hasProperty("tags") ? project.getProperties().get("tags") : ""
}
