/*
 * Copyright (C) 2018 Florian Dreier
 *
 * This file is part of MyTargets.
 *
 * MyTargets is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
 *
 * MyTargets is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

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

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

    compileSdkVersion compileSdkVersionCode

    defaultConfig {
        applicationId 'de.dreier.mytargets'
        minSdkVersion 23
        targetSdkVersion 28
        versionCode gitVersionCode
        versionName gitVersionName
    }

    dataBinding {
        enabled = true
    }

    androidExtensions {
        experimental = true
    }

    signingConfigs {
        debug {
        }
        release {
            storeFile file(KEYSTORE_NAME)
            storePassword KEYSTORE_PASSWORD
            keyAlias KEY_ALIAS
            keyPassword KEY_PASSWORD
        }
    }

    buildTypes {
        debug {
            applicationIdSuffix '.debug'
            signingConfig signingConfigs.debug
            minifyEnabled false
            testCoverageEnabled true
        }
        release {
            signingConfig signingConfigs.release
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), '../tools/rules-proguard.pro'
        }
    }
}

dependencies {
    Map<String, String> dependencies = rootProject.ext.dependencies

    implementation dependencies.androidxWearable
    compileOnly dependencies.wearable
    implementation dependencies.androidxCore
    implementation dependencies.androidxWear
    implementation dependencies.androidxCoreKtx

    implementation dependencies.androidState
    kapt dependencies.androidStateProcessor

    implementation dependencies.archLifecycleExtensions
    kapt dependencies.archLifecycleCompiler
    implementation dependencies.archRoomRuntime
    kapt dependencies.archRoomCompiler

    implementation project(':shared')
    implementation dependencies.kotlinStdlibJdk7
}