buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
        classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.3'
    }
}

repositories {
    maven { url "https://jitpack.io" }
    flatDir {
        dirs 'libs'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "28.0.1"
    defaultConfig {
        applicationId "com.gabilheri.moviestmdb"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude '.readme'
        exclude 'LICENSE.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/README.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/maven/com.squareup.okhttp/okhttp/pom.xml'
        exclude 'META-INF/maven/com.squareup.okhttp/okhttp/pom.properties'
        exclude 'META-INF/maven/com.squareup/otto/pom.xml'
        exclude 'META-INF/maven/com.squareup/otto/pom.properties'
        exclude 'META-INF/services/javax.annotation.processing.Processor'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

tasks.whenTaskAdded { task ->
    if (task.name.equals("lint")) {
        task.enabled = false
    }
}

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

    String supportLibVersion = "27.1.1"
    String retrofitVersion = "2.1.0"
    String okHttpVersion = "3.4.1"

    // Google Support Libraries
    implementation "com.android.support:appcompat-v7:${supportLibVersion}"
    implementation "com.android.support:cardview-v7:${supportLibVersion}"
    implementation "com.android.support:support-annotations:${supportLibVersion}"
    implementation "com.android.support:support-v13:${supportLibVersion}"
    implementation "com.android.support:support-v4:${supportLibVersion}"
    implementation "com.android.support:palette-v7:${supportLibVersion}"
    implementation "com.android.support:design:${supportLibVersion}"
    implementation "com.android.support:recyclerview-v7:${supportLibVersion}"
    implementation "com.android.support:customtabs:${supportLibVersion}"
    implementation "com.android.support:leanback-v17:${supportLibVersion}"

    // Base stuff
    implementation 'io.reactivex:rxandroid:1.2.1'
    implementation 'io.reactivex:rxjava:1.2.7'
    implementation 'com.squareup.sqlbrite:sqlbrite:0.7.0'

    // Network
    implementation "com.squareup.retrofit2:retrofit:${retrofitVersion}"
    implementation "com.squareup.retrofit2:converter-moshi:${retrofitVersion}"
    implementation "com.squareup.retrofit2:adapter-rxjava:${retrofitVersion}"
    implementation "com.squareup.okhttp3:okhttp:${okHttpVersion}"
    implementation "com.squareup.okhttp3:logging-interceptor:${okHttpVersion}"
    implementation 'com.github.bumptech.glide:glide:3.7.0'

    // Logging
    implementation 'com.jakewharton.timber:timber:4.5.1'

    // Dependency Injection
    annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
    implementation 'com.google.dagger:dagger:2.11'
    compileOnly 'javax.annotation:jsr250-api:1.0'

    implementation 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    implementation('com.mikepenz:aboutlibraries:5.5.9@aar') {
        transitive = true
    }
}
