apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
androidExtensions {
    experimental = true
}

android {

    compileSdkVersion 26
    buildToolsVersion '26.0.2'

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 26
        applicationId 'io.armcha.ribble'
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        buildConfigField "String", "DRIBBBLE_CLIENT_ID", "\"${dribbble_client_id}\""
        buildConfigField "String", "DRIBBBLE_CLIENT_SECRET", "\"${dribbble_client_secret}\""
        buildConfigField "String", "DRIBBBLE_CLIENT_ACCESS_TOKEN", "\"${dribbble_client_access_token}\""
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

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

    sourceSets {
        main {
            java.srcDirs = ['src/main/kotlin']
        }
    }
}

kapt {
    generateStubs = true
}

ext.okhttpVersion = '3.8.1'
ext.rxJavaVersion = '2.1.2'
ext.rxAndroidVersion = '2.0.1'
ext.supportLibVersion = '26.1.0'
ext.rxBindingVersion = '2.0.0'
ext.retrofitVersion = '2.3.0'
ext.loggerVersion = '2.2.0'
ext.daggerVersion = '2.11'
ext.archVersion = '1.0.0-alpha8'
ext.glideVersion = '4.3.0'
dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])

    //Base MVP
    implementation project(':baseMVP')

    //Support
    implementation "com.android.support:support-v4:${supportLibVersion}"
    implementation "com.android.support:appcompat-v7:${supportLibVersion}"
    implementation "com.android.support:cardview-v7:${supportLibVersion}"
    implementation "com.android.support:design:${supportLibVersion}"
    implementation "com.android.support.constraint:constraint-layout:1.0.2"

    //Database
    implementation "android.arch.persistence.room:runtime:1.0.0"
    implementation "android.arch.persistence.room:rxjava2:1.0.0"
    kapt "android.arch.persistence.room:compiler:1.0.0"

    //RX
    implementation "io.reactivex.rxjava2:rxjava:${rxJavaVersion}"
    implementation "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}"
    implementation "com.jakewharton.rxbinding2:rxbinding-support-v4:${rxBindingVersion}"

    //DI
    implementation "com.google.dagger:dagger:${daggerVersion}"
    kapt "com.google.dagger:dagger-compiler:${daggerVersion}"

    //Network
    implementation "com.squareup.retrofit2:retrofit:${retrofitVersion}"
    implementation "com.squareup.retrofit2:converter-gson:${retrofitVersion}"
    implementation "com.squareup.retrofit2:adapter-rxjava2:${retrofitVersion}"
    implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
    implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"

    //Kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    //Logging
    implementation "com.github.armcha:Logger:${loggerVersion}"

    //Image loading
    implementation "com.github.bumptech.glide:glide:${glideVersion}"
    implementation "com.github.bumptech.glide:okhttp3-integration:${glideVersion}"
    kapt "com.github.bumptech.glide:compiler:${glideVersion}"

    //Leak canary
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4'

    //Testing
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.android.support', module: 'design'
        exclude group: 'com.android.support', module: 'recyclerview-v7'
    }
}
