apply plugin: 'com.android.application'
apply from: "$project.rootDir/config/quality.gradle"

project.ext {
    supportLibraryVersion = "25.4.0"
    daggerVersion = "2.11"
    butterKnifeVersion = "8.7.0"
    rxJavaVersion = "2.1.0"
    rxAndroidVersion = "2.0.1"
    timberVersion = "4.5.1"
    lifecycleVersion = "1.0.0-alpha4"
    priorityJobQueueVersion = "2.0.1"
    playServicesVersion = "11.4.2"
    retrofitVersion = "2.1.0"
    okHttpVersion = "3.4.1"
    rxRelayVersion = "2.0.0"
    rxLintVersion = "1.6"
}

android {
    compileSdkVersion 25
    defaultConfig {
        applicationId "<%= appPackage %>"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }

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

    buildTypes.each {
        it.buildConfigField 'String', 'API_BASE_URL', "\"http://jsonplaceholder.typicode.com\""
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    implementation "com.android.support:appcompat-v7:$project.supportLibraryVersion"

    // Dagger core
    annotationProcessor "com.google.dagger:dagger-compiler:$project.daggerVersion"
    implementation "com.google.dagger:dagger:$project.daggerVersion"

    // Dagger Android
    annotationProcessor "com.google.dagger:dagger-android-processor:$project.daggerVersion"
    implementation "com.google.dagger:dagger-android-support:$project.daggerVersion"
    // if you are not using support library, include this instead
    implementation "com.google.dagger:dagger-android:$project.daggerVersion"

    // ButterKnife
    implementation "com.jakewharton:butterknife:$project.butterKnifeVersion"
    annotationProcessor "com.jakewharton:butterknife-compiler:$project.butterKnifeVersion"

    // ReactiveX
    implementation "io.reactivex.rxjava2:rxjava:$project.rxJavaVersion"
    implementation "io.reactivex.rxjava2:rxandroid:$project.rxAndroidVersion"

    // Timber
    implementation "com.jakewharton.timber:timber:$project.timberVersion"

    // Priority Job Queue
    implementation "com.birbit:android-priority-jobqueue:$project.priorityJobQueueVersion"

    //GCM Network Manager
    implementation "com.google.android.gms:play-services-gcm:$project.playServicesVersion"

    // RecyclerView
    implementation "com.android.support:recyclerview-v7:$project.supportLibraryVersion"

    // Retrofit
    implementation "com.squareup.retrofit2:retrofit:$project.retrofitVersion"

    // GSON Converter
    implementation "com.squareup.retrofit2:converter-gson:$project.retrofitVersion"

    // OkHttp Logging Interceptor
    implementation "com.squareup.okhttp3:okhttp:$project.okHttpVersion"
    implementation "com.squareup.okhttp3:logging-interceptor:$project.okHttpVersion"

    // Room Database
    implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
    implementation "android.arch.persistence.room:rxjava2:$rootProject.roomVersion"
    annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"

    // Lifecycle
    implementation "android.arch.lifecycle:runtime:$project.lifecycleVersion"
    implementation "android.arch.lifecycle:extensions:$project.lifecycleVersion"
    annotationProcessor "android.arch.lifecycle:compiler:$project.lifecycleVersion"

    // RxRelay
    implementation "com.jakewharton.rxrelay2:rxrelay:$project.rxRelayVersion"

    // RxLint
    implementation "nl.littlerobots.rxlint:rxlint:$project.rxLintVersion"
}
