plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'com.google.gms.google-services'
}

android {
    compileSdkVersion 31
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example.jetpoll"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        viewBinding true
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion compose_version
        kotlinCompilerVersion kotlin_version
    }
}

dependencies {

    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation "com.google.android.material:material:$android_material"

    implementation "androidx.core:core-ktx:1.8.0-alpha03"

    //Fundamental building blocks of Compose's programming model and state management, and core runtime for the Compose Compiler Plugin to target.
    implementation "androidx.compose.runtime:runtime:$compose_version"
    implementation "androidx.compose.runtime:runtime-livedata:$compose_version"

    //Fundamental components of compose UI needed to interact with the device, including layout, drawing, and input.
    implementation "androidx.compose.ui:ui:$compose_version"

    //Build Jetpack Compose UIs with ready to use Material Design Components. This is the higher level entry point of Compose, designed to provide components that match those described at www.material.io.
    implementation "androidx.compose.material:material:$compose_version"
    implementation "androidx.compose.material:material-icons-extended:$compose_version"

    //Write Jetpack Compose applications with ready to use building blocks and extend foundation to build your own design system pieces.
    implementation "androidx.compose.foundation:foundation:$compose_version"
    implementation "androidx.compose.foundation:foundation-layout:$compose_version"

    //Build animations in their Jetpack Compose applications to enrich the user experience.
    implementation "androidx.compose.animation:animation:$compose_version"

    //Allows to render composables with Preview
    implementation "androidx.compose.ui:ui-tooling:$compose_version"

    // Navigation Components to handle Navigation
    implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
    implementation "androidx.navigation:navigation-ui-ktx:$nav_version"

    // In charge of setContent
    implementation "androidx.activity:activity-compose:$activity_compose"


    // ktx LivaData
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0"

    //Coroutines with Firebase
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.5'

    //Firebase
    implementation 'com.google.firebase:firebase-auth:21.0.1'
    implementation 'com.google.firebase:firebase-firestore:24.0.1'

    implementation "androidx.activity:activity-ktx:1.4.0"

    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}