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

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    dataBinding {
        enabled = true
    }
    defaultConfig {
        applicationId "com.andremion.heroes"
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 9
        versionName "1.3.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        debug {
            testCoverageEnabled true
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
    }
}

def MARVEL_PRIVATE_KEY = System.getenv("MARVEL_PRIVATE_KEY") ?: marvelPrivateKey
def MARVEL_PUBLIC_KEY = System.getenv("MARVEL_PUBLIC_KEY") ?: marvelPublicKey

android.buildTypes.each { type ->
    type.buildConfigField "String", "MARVEL_PRIVATE_KEY", "\"$MARVEL_PRIVATE_KEY\""
    type.buildConfigField "String", "MARVEL_PUBLIC_KEY", "\"$MARVEL_PUBLIC_KEY\""
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "com.android.support:support-fragment:$supportLibraryVersion"
    compile "com.android.support:design:$supportLibraryVersion"
    compile "com.android.support:recyclerview-v7:$supportLibraryVersion"
    compile "com.squareup.retrofit2:retrofit:$retrofitVersion"
    compile "com.squareup.retrofit2:converter-gson:$retrofitVersion"
    compile "com.squareup.okhttp3:logging-interceptor:$okhttpVersion"
    compile "com.github.bumptech.glide:glide:$glideVersion"

    testCompile "junit:junit:$junitVersion"
    testCompile "org.mockito:mockito-core:$mockitoVersion"
    testCompile "org.powermock:powermock-module-junit4:$powermockVersion"
    testCompile "org.powermock:powermock-api-mockito2:$powermockVersion"

    androidTestCompile "com.android.support:support-annotations:$supportLibraryVersion"
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile("com.android.support.test.espresso:espresso-contrib:$espressoVersion") {
        exclude group: 'com.android.support'
    }
}
