apply plugin: 'com.android.library'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"

        consumerProguardFiles 'consumer-rules.pro'
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
        test.java.srcDirs += 'src/test/kotlin'
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }

}

dependencies {
    def dataDependencies = rootProject.ext.dataDependencies

    //Local libs
    api project(':domain')
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    //Dependency Injection
    implementation dataDependencies.kotlin
    api dataDependencies.retrofit
    api dataDependencies.moshiConverter
    api dataDependencies.loggingInterceptor
    implementation dataDependencies.coroutinesCore
    api dataDependencies.dagger2
    kapt dataDependencies.dagger2Processor

    //Room database
    implementation dataDependencies.roomRuntime
    kapt dataDependencies.roomCompiler
    implementation dataDependencies.roomRxjava2
    implementation dataDependencies.roomKtx
}