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'
        }
    }
}


buildscript {
    repositories {
        jcenter()
    }
}


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'
    }
    compile rootProject.ext.dependencies["annotations"]

    //view
    compile(rootProject.ext.dependencies["autolayout"]) {
        exclude group: 'com.android.support'
    }
    compile(rootProject.ext.dependencies["butterknife"]) {
        exclude module: 'support-annotations'
    }

    //rx
    compile rootProject.ext.dependencies["rxjava2"]
    compile(rootProject.ext.dependencies["rxandroid2"]) {
        exclude module: 'rxjava'
    }
    compile(rootProject.ext.dependencies["rxcache2"]) {
        exclude module: 'rxjava'
        exclude module: 'dagger'
    }
    compile(rootProject.ext.dependencies["rxcache-jolyglot-gson"]) {
        exclude module: 'gson'
    }
    compile(rootProject.ext.dependencies["rxlifecycle2"]) {
        exclude module: 'rxjava'
        exclude module: 'jsr305'
    }
    compile(rootProject.ext.dependencies["rxlifecycle2-android"]) {
        exclude module: 'support-annotations'
        exclude module: 'rxjava'
        exclude module: 'rxandroid'
        exclude module: 'rxlifecycle'
    }
    compile(rootProject.ext.dependencies["rxpermissions2"]) {
        exclude module: 'rxjava'
        exclude module: 'support-annotations'
    }
    compile rootProject.ext.dependencies['rxerrorhandler2']

    //network
    compile(rootProject.ext.dependencies["retrofit"]) {
        exclude module: 'okhttp'
        exclude module: 'okio'
    }
    compile(rootProject.ext.dependencies["retrofit-converter-gson"]) {
        exclude module: 'gson'
        exclude module: 'okhttp'
        exclude module: 'okio'
        exclude module: 'retrofit'
    }
    compile(rootProject.ext.dependencies["retrofit-adapter-rxjava2"]) {
        exclude module: 'rxjava'
        exclude module: 'okhttp'
        exclude module: 'retrofit'
        exclude module: 'okio'
    }
    compile rootProject.ext.dependencies["okhttp3"]
    compile(rootProject.ext.dependencies["glide"]) {
        exclude module: 'support-v4'
    }
    annotationProcessor(rootProject.ext.dependencies["glide-compiler"]) {
        exclude module: 'jsr305'
    }

    //tools
    provided rootProject.ext.dependencies["javax.annotation"]
    compile rootProject.ext.dependencies["dagger2"]
    annotationProcessor(rootProject.ext.dependencies["dagger2-compiler"]) {
        exclude module: 'dagger'
    }
    compile rootProject.ext.dependencies["androideventbus"]
    compile rootProject.ext.dependencies["gson"]

    //test
    compile rootProject.ext.dependencies["timber"]
    testCompile rootProject.ext.dependencies["junit"]
}


apply from: 'bintray.gradle'