apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "co.aurasphere.bluepair"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 3
        versionName "1.0.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    def buildSecretPropertiesFile = rootProject.file('blue-pair-secret.properties')
    def buildSecretProperties = new Properties()
    buildSecretProperties.load(new FileInputStream(buildSecretPropertiesFile))

    signingConfigs {
        release {
            storeFile file(buildSecretProperties["release.store.file"])
            storePassword buildSecretProperties["release.store.password"]
            keyAlias buildSecretProperties["release.key.alias"]
            keyPassword buildSecretProperties["release.key.password"]

            // Optional, specify signing versions used
            v1SigningEnabled true
            v2SigningEnabled true
        }
    }

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

            resValue("string", "AD_APP_ID", buildSecretProperties["ad.app.id"])
            buildConfigField("String", "AD_UNIT_ID", buildSecretProperties["ad.unit.id"])
            signingConfig signingConfigs.release
        }
        debug {
            debuggable true
            resValue("string", "AD_APP_ID", "\"ca-app-pub-3940256099942544~3347511713\"")
            buildConfigField("String", "AD_UNIT_ID", "\"ca-app-pub-3940256099942544/6300978111\"")
        }
    }

    testOptions {
        unitTests.returnDefaultValues = true
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-all:1.10.19'
    testImplementation 'org.powermock:powermock-api-mockito:1.6.6'
    testImplementation 'org.powermock:powermock-module-junit4:1.6.6'
    implementation 'com.google.firebase:firebase-appindexing:18.0.0'

    implementation 'com.google.android.gms:play-services-ads:17.2.1'
}
