apply plugin: 'com.android.application'

android {
    compileSdkVersion COMPILE_SDK_VERSION as int

    defaultConfig {
        applicationId "com.bumptech.glide.samples.imgur"
        minSdkVersion MIN_SDK_VERSION as int
        targetSdkVersion TARGET_SDK_VERSION as int
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    buildTypes {
        release {
            minifyEnabled false
        }
    }
}

dependencies {
    implementation project(':library')
    annotationProcessor project(':annotation:compiler')

    implementation "com.google.dagger:dagger:${DAGGER_VERSION}"
    annotationProcessor "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"
    implementation "com.google.dagger:dagger-android:${DAGGER_VERSION}"
    implementation ("com.google.dagger:dagger-android-support:${DAGGER_VERSION}") {
        exclude group: "com.android.support"
    }
    annotationProcessor "com.google.dagger:dagger-android-processor:${DAGGER_VERSION}"

    implementation "com.squareup.okhttp3:okhttp:${OK_HTTP_VERSION}"
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'

    implementation 'io.reactivex:rxandroid:1.2.1'
    implementation 'io.reactivex:rxjava:1.3.4'

    implementation "com.android.support:appcompat-v7:${ANDROID_SUPPORT_VERSION}"
    implementation "androidx.cardview:cardview:${ANDROID_X_VERSION}"
    implementation "com.android.support:recyclerview-v7:${ANDROID_SUPPORT_VERSION}"

    // Fixes a compilation warning related to dagger, see
    // https://github.com/google/guava/issues/2721.
    compileOnly "com.google.errorprone:error_prone_annotations:${ERROR_PRONE_VERSION}"
}

task run(type: Exec, dependsOn: 'installDebug') {
    description 'Installs the APK and runs the main activity: "gradlew :samples:???:run"'
    commandLine "${android.sdkDirectory}/platform-tools/adb", 'shell', 'am', 'start', '-n', 'com.bumptech.glide.samples.card/.MainActivity'
}
