apply plugin: 'com.android.library'
apply plugin: 'me.tatarka.retrolambda'

android {
    compileSdkVersion rootProject.ext.android["compileSdkVersion"]
    buildToolsVersion rootProject.ext.android["buildToolsVersion"]
    useLibrary 'org.apache.http.legacy'

    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion rootProject.ext.android["minSdkVersion"]
        targetSdkVersion rootProject.ext.android["targetSdkVersion"]
        versionCode rootProject.ext.android["versionCode"]
        versionName rootProject.ext.android["versionName"]
    }

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    //support
    compile(rootProject.ext.dependencies["support-v4"]) {
        exclude module: 'support-annotations'
    }
    compile(rootProject.ext.dependencies["appcompat-v7"]) {
        exclude module: 'support-annotations'
        exclude module: 'support-v4'
    }
    compile(rootProject.ext.dependencies["design"]) {
        exclude module: 'support-annotations'
        exclude module: 'appcompat-v7'
        exclude module: 'support-v4'
    }

    //Architecture Components ILifecycle
    compile rootProject.ext.dependencies["lifecycle-runtime"]
    compile rootProject.ext.dependencies["lifecycle-extensions"]
    annotationProcessor rootProject.ext.dependencies["lifecycle-compiler"]

    //tools
    provided rootProject.ext.dependencies["javax.annotation"]
    compile rootProject.ext.dependencies["dagger2"]
    annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
    compile(rootProject.ext.dependencies["dagger2-android"]) {
        exclude module: 'jsr305'
    }
    compile(rootProject.ext.dependencies["dagger2-android-support"]) {
        exclude module: 'jsr305'
        exclude module: 'appcompat-v7'
    }
    annotationProcessor(rootProject.ext.dependencies["dagger2-android-processor"]) {
        exclude module: 'jsr305'
    }
    compile rootProject.ext.dependencies["timber"]
    compile rootProject.ext.dependencies["androideventbus"]

    //test
    testCompile rootProject.ext.dependencies["junit"]
    androidTestCompile(rootProject.ext.dependencies["espresso-core"]) {
        exclude module: 'support-annotations'
    }
}
