plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
}

android {
    compileSdkVersion 31
    buildToolsVersion "30.0.2"

    defaultConfig {
        applicationId "net.achris.mediumnothanks"
        minSdkVersion 23
        targetSdkVersion 31
        versionCode rootProject.file('app/build_number.txt').text.trim().toInteger()
        versionName "1.3.0"

        resValue("string", "version", "${versionName}")
    }

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

    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation "androidx.core:core-ktx:1.3.1"
    implementation "androidx.appcompat:appcompat:1.2.0"
    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
    implementation "com.google.android.material:material:1.2.1"
    implementation "androidx.constraintlayout:constraintlayout:1.1.3"
    implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"

    // To use Java8 Date features
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

    def koin_version = "2.1.5"
    implementation "org.koin:koin-core:$koin_version"
    implementation "org.koin:koin-androidx-scope:$koin_version"
    implementation "org.koin:koin-androidx-viewmodel:$koin_version"

    implementation "com.squareup.moshi:moshi-kotlin:1.9.3"
    implementation 'com.squareup.moshi:moshi-adapters:1.10.0'
}