plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
    alias(libs.plugins.kotlin.compose)
    alias(libs.plugins.kotlin.serialization)
    alias(libs.plugins.firebase)
    alias(libs.plugins.crashlytics)
}

android {

    namespace 'com.demo.ada.deployment'
    compileSdk 35

    defaultConfig {
        applicationId "com.demo.ada.deployment"
        minSdk 30
        targetSdk 35
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        release {
            if (!System.getenv("CI")) {
                def propsFile = rootProject.file('keystore.properties')
                def props = new Properties()
                if (propsFile.exists()) {
                    props.load(new FileInputStream(propsFile))
                }
                storeFile rootProject.file('uploadKey.jks')
                storePassword props['storePassword']
                keyAlias props['keyAlias']
                keyPassword props['keyPassword']
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            if (!System.getenv("CI")) {
                signingConfig signingConfigs.release
            }
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = '11'
    }
    buildFeatures {
        compose true
    }
}

dependencies {

    //Firebase
    implementation platform(libs.firebase.bom)

    implementation libs.koin.android
    implementation libs.koin.androidx.compose
    implementation libs.ktor.client.core
    implementation libs.ktor.client.cio
    implementation libs.ktor.content.negotiation
    implementation libs.ktor.serialization.kotlinx.json
    implementation libs.kotlinx.serialization.json
    implementation libs.coil.compose
    implementation(libs.firebase.crashlytics)
    implementation(libs.firebase.analytics)


    implementation libs.androidx.core.ktx
    implementation libs.androidx.lifecycle.runtime.ktx
    implementation libs.androidx.activity.compose
    implementation platform(libs.androidx.compose.bom)
    implementation libs.androidx.ui
    implementation libs.androidx.ui.graphics
    implementation libs.androidx.ui.tooling.preview
    implementation libs.androidx.material3
    testImplementation libs.junit
    androidTestImplementation libs.androidx.junit
    androidTestImplementation libs.androidx.espresso.core
    androidTestImplementation platform(libs.androidx.compose.bom)
    androidTestImplementation libs.androidx.ui.test.junit4
    debugImplementation libs.androidx.ui.tooling
    debugImplementation libs.androidx.ui.test.manifest
}