apply plugin: 'com.android.library'

android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    flavorDimensions "preview"
    productFlavors {
        previewEnabled {
            buildConfigField "boolean", "ASTRO_PREVIEW", "true"
            dimension "preview"
        }
        previewDisabled {
            buildConfigField "boolean", "ASTRO_PREVIEW", "false"
            dimension "preview"
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'LICENSE.txt'
    }
}

configurations {
    testArtifacts
}

task exposingAstroTestClassesInJar(type: Jar) {
    baseName = "${project.name}Test"
    from android.sourceSets.androidTest.java.srcDirs
}

artifacts {
    testArtifacts exposingAstroTestClassesInJar
}

dependencies {
    api fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.squareup:seismic:1.0.2'

    // Test Dependencies
    androidTestImplementation 'org.mockito:mockito-core:1.9.5'
    androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
    androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
    androidTestImplementation 'junit:junit:4.12'
    androidTestImplementation 'org.skyscreamer:jsonassert:1.2.3'

    // Android JUnit Runner
    androidTestImplementation 'com.android.support.test:runner:1.0.2'

    // JUnit4 Rules
    androidTestImplementation 'com.android.support.test:rules:1.0.2'

    // Espresso core
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
