/*
 * Copyright (C) 2017 MINDORKS NEXTGEN PRIVATE LIMITED
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://mindorks.com/license/apache-v2
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'
apply from: '../config/quality/quality.gradle'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion
    defaultConfig {
        applicationId "<%= appPackage %>"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        debug {
            buildConfigField("String", "BASE_URL", "\"http://www.mocky.io/v2\"")
            buildConfigField("String", "API_KEY", "\"ABCXYZ123TEST\"")
        }
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField("String", "BASE_URL", "\"http://www.mocky.io/v2\"")
            buildConfigField("String", "API_KEY", "\"ABCXYZ123TEST\"")
        }
    }
}

greendao {
    schemaVersion 1
}

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

    // android support libraries
    compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
    compile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
    compile "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
    compile "com.android.support:design:$rootProject.supportLibraryVersion"
    compile "com.android.support:support-vector-drawable:$rootProject.supportLibraryVersion"
    compile "com.android.support:animated-vector-drawable:$rootProject.supportLibraryVersion"

    // font
    compile "uk.co.chrisjenx:calligraphy:$rootProject.calligraphyVersion"

    // network
    compile "com.amitshekhar.android:rx2-android-networking:$rootProject.rx2FastAndroidNetworking"

    // image
    compile "com.github.bumptech.glide:glide:$rootProject.glideVersion"

    // parser
    compile "com.google.code.gson:gson:$rootProject.gsonVersion"

    // database
    compile "org.greenrobot:greendao:$rootProject.greenDaoVersion"

    // debug database
    debugCompile "com.amitshekhar.android:debug-db:$rootProject.debugDBVersion"

    // dependency injection
    compile "com.google.dagger:dagger:$rootProject.dagger2Version"
    annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
    provided 'javax.annotation:jsr250-api:1.0'
    compile 'javax.inject:javax.inject:1'

    // reactive
    compile "io.reactivex.rxjava2:rxjava:$rootProject.rxjava2Version"
    compile "io.reactivex.rxjava2:rxandroid:$rootProject.rxandroidVersion"

    // code generator for view
    compile "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
    annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterKnifeVersion"

    // swipe view
    compile "com.mindorks:placeholderview:$rootProject.placeholderviewVersion"

    // logger
    compile "com.jakewharton.timber:timber:$rootProject.timberVersion"

    // dependencies for local unit tests
    testCompile "junit:junit:$rootProject.ext.junitVersion"
    testCompile "org.mockito:mockito-core:$rootProject.mockitoVersion"
    testAnnotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"

    // UI Testing
    androidTestCompile "com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion"
    androidTestCompile "com.android.support.test.espresso:espresso-intents:$rootProject.espressoVersion"
    androidTestCompile "org.mockito:mockito-core:$rootProject.mockitoVersion"
    androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
}

configurations.all {
    resolutionStrategy.force "com.android.support:support-annotations:$supportLibraryVersion"
}
