apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'



def STRING = 'String'
def BUILD_TIME = 'BUILD_TIME'
android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion "25.0.3"

    defaultConfig {
        applicationId "com.generalmobile.app.gmnotes"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        buildConfigField STRING, BUILD_TIME, "\"${rootProject.ext.buildTime}\""
    }
    buildTypes {
        release {
            minifyEnabled true
            zipAlignEnabled true
            shrinkResources true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    packagingOptions {
        exclude 'META-INF/rxjava.properties'
    }
    dataBinding {
        enabled = true
    }

    lintOptions {
        abortOnError false
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }
}

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

    //supportLib
    compile rootProject.ext.supportLib
    compile rootProject.ext.supportLibAppCompat
    compile rootProject.ext.supportLibDesign
    compile rootProject.ext.supportLibRecyclerview
    compile rootProject.ext.supportLibCardview

    //arch-comp Lifecycles, LiveData, and ViewModel
    compile "android.arch.lifecycle:runtime:1.0.0-alpha5"
    compile "android.arch.lifecycle:extensions:1.0.0-alpha5"
    kapt "android.arch.lifecycle:compiler:1.0.0-alpha5"
    //arch-comp Room
    compile "android.arch.persistence.room:runtime:1.0.0-alpha5"
    kapt "android.arch.persistence.room:compiler:1.0.0-alpha5"

    //di
    compile rootProject.ext.dagger
    kapt rootProject.ext.daggerApt
    //compile rootProject.ext.daggerSupport
    //annotationProcessor rootProject.ext.daggerAnnotation


    kapt "com.android.databinding:compiler:2.3.2"

    //test
    testCompile 'junit:junit:4.12'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.google.code.findbugs'
    })
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
repositories {
    mavenCentral()
}

kapt {
    generateStubs = true
}
