apply plugin: 'com.android.application'

def YOUTUBE_APIKEY = '"' + SIMPLEMVP_YOUTUBE_API_KEY + '"' ?: '"Error"'
def APOD_APIKEY = '"' + SIMPLEMVP_NASA_API_KEY + '"' ?: '"Error"'
def STRING = 'String'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    defaultConfig {
        applicationId "com.gaston.macbook.simplemvp"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        each {
            type ->
                type.buildConfigField STRING, 'APODApiKey', APOD_APIKEY
                type.buildConfigField STRING, 'YoutubeApiKey', YOUTUBE_APIKEY
        }

        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }

    buildTypes {

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

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "androidx.appcompat:appcompat:$rootProject.ext.appcompat"
    implementation "androidx.constraintlayout:constraintlayout:$rootProject.ext.constraintlayout"
    implementation "com.google.android.material:material:$rootProject.ext.material"
    implementation "com.github.bumptech.glide:glide:$rootProject.ext.glide"
    implementation "com.squareup.retrofit2:retrofit:$rootProject.ext.retrofit"
    implementation "com.squareup.retrofit2:converter-gson:$rootProject.ext.retrofit"
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation "com.jakewharton:butterknife:$rootProject.ext.butterknife"
    annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.ext.butterknife"
    implementation "com.github.chrisbanes:PhotoView:$rootProject.ext.photoview"

    // Dependencies for local unit tests
    testImplementation "junit:junit:$rootProject.ext.junitVersion"
    testImplementation "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
    testImplementation "org.hamcrest:hamcrest-all:$rootProject.ext.hamcrestVersion"
    testImplementation "org.powermock:powermock-module-junit4:$rootProject.ext.powerMockito"
    testImplementation "org.powermock:powermock-api-mockito:$rootProject.ext.powerMockito"

    // Android Testing Support Library's runner and rules
    androidTestImplementation "androidx.test:runner:$rootProject.ext.runnerVersion"
    androidTestImplementation "androidx.test:rules:$rootProject.ext.rulesVersion"

    // Espresso UI Testing dependencies.
    androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.ext.espressoVersion"
    androidTestImplementation "androidx.test.espresso:espresso-contrib:$rootProject.ext.espressoVersion"
    androidTestImplementation "androidx.test.espresso:espresso-intents:$rootProject.ext.espressoVersion"
}
