// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.1.2-3'
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        {% if cookiecutter.realm == "y" %}
        classpath "io.realm:realm-gradle-plugin:3.1.1"
        {% endif %}
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        mavenCentral()
    }
}

ext{

    buildToolsVersion = '25.0.2'
    compileSdkVersion = {{ cookiecutter.target_sdk }}
    targetSdkVersion = {{ cookiecutter.target_sdk }}
    minSdkVersion = {{ cookiecutter.min_sdk }}

    supportLibVersion = '25.3.1'
    rxJavaVersion = '2.0.1'
    rxKotlinVersion = '2.0.3'
    timberVersion = '4.5.1'
    daggerVersion = '2.+'
    retrofitVersion = '2.2.0'
    okHttpVersion = '3.6.0'
    greenDaoVersion = '3.2.2'
    picassoVersion = '2.5.2'
    crashlyticsVersion = '2.6.8'
    gsonVersion = '2.8.0'

    //supportLib
    supportLib = "com.android.support:support-v4:$supportLibVersion"
    supportLibAppCompat = "com.android.support:appcompat-v7:$supportLibVersion"
    supportLibDesign = "com.android.support:design:$supportLibVersion"
    supportLibRecyclerview = "com.android.support:recyclerview-v7:$supportLibVersion"
    supportLibCardview = "com.android.support:cardview-v7:$supportLibVersion"

    //rx
    rxJava = "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
    rxAndroid = "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"
    rxKotlin = "io.reactivex.rxjava2:rxkotlin:$rxKotlinVersion"

    //timber
    timber = "com.jakewharton.timber:timber:$timberVersion"

    //crashlytics
    crashlytics = "com.crashlytics.sdk.android:crashlytics:$crashlyticsVersion@aar"

    //dagger
    dagger = "com.google.dagger:dagger-android:$daggerVersion"
    daggerSupport = "com.google.dagger:dagger-android-support:$daggerVersion" // if you use the support libraries
    daggerAnnotation = "com.google.dagger:dagger-android-processor:$daggerVersion" //for annotationProcessor
    daggerApt = "com.google.dagger:dagger-compiler:$daggerVersion"

    //net
    retrofit = "com.squareup.retrofit2:retrofit:$retrofitVersion"
    okHttp = "com.squareup.okhttp3:okhttp:$okHttpVersion"
    gson = "com.google.code.gson:gson:$gsonVersion"
    rxJavaAdapter = "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion"
    gsonConverter = "com.squareup.retrofit2:converter-gson:$retrofitVersion"

    //greenDao
    greenDao = "org.greenrobot:greendao:$greenDaoVersion"

    //picasso
    picasso = "com.squareup.picasso:picasso:$picassoVersion"

    buildTime = new Date().format("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC"))
}


task clean(type: Delete) {
    delete rootProject.buildDir
}
