apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

android {
    compileSdkVersion 31
    defaultConfig {
        applicationId "cafe.adriel.chroma"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 15
        versionName "1.1.5"
        resConfigs 'en', 'pt'
    }
    buildTypes {
        debug {
            buildConfigField 'Boolean', 'RELEASE', 'false'
        }
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            buildConfigField 'Boolean', 'RELEASE', 'true'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin/'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion "1.1.0-alpha03"
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_11
        useIR = true
    }
    dexOptions {
        preDexLibraries true
        maxProcessCount 8
    }
    packagingOptions {
        exclude 'META-INF/*'
    }
}

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

    // Kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1"

    // Android
    implementation "androidx.core:core-ktx:1.6.0"
    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
    implementation "androidx.appcompat:appcompat:1.3.1"

    // Compose
    implementation 'androidx.activity:activity-compose:1.3.1'
    implementation 'androidx.constraintlayout:constraintlayout-compose:1.0.0-beta02'
    implementation "androidx.compose.compiler:compiler:$compose_version"
    implementation "androidx.compose.ui:ui:$compose_version"
    implementation "androidx.compose.foundation:foundation:$compose_version"
    implementation "androidx.compose.material:material:$compose_version"
    implementation "androidx.compose.material:material-icons-core:$compose_version"
    implementation "androidx.compose.material:material-icons-extended:$compose_version"

    // Firebase
    implementation "com.google.firebase:firebase-core:19.0.1"
    implementation 'com.google.firebase:firebase-crashlytics-ktx:18.2.1'

    // DI
    implementation "io.insert-koin:koin-androidx-scope:$koin_version"
    implementation "io.insert-koin:koin-androidx-viewmodel:$koin_version"

    // Others
    implementation "com.github.adrielcafe.satchel:satchel-core:1.0.3"
    implementation "com.github.adrielcafe:KinApp:fad52f3f83"
    implementation "com.markodevcic:peko:2.1.3"
}
