plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'org.jetbrains.kotlin.kapt'
    id 'org.jetbrains.kotlin.plugin.serialization'
}

android {
    namespace "com.sirekanian.spacetime"
    compileSdk 33
    defaultConfig {
        applicationId "com.sirekanian.spacetime"
        minSdk 21
        targetSdk 33
        versionCode appVersionCode as int
        versionName appVersionName
        archivesBaseName = "$applicationId-$versionName-$versionCode"
        vectorDrawables {
            useSupportLibrary true
        }
        javaCompileOptions {
            annotationProcessorOptions {
                arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }
    buildTypes {
        debug {
            applicationIdSuffix '.debug'
        }
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion composeCompilerVersion
    }
    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
    kotlinOptions {
        allWarningsAsErrors = true
    }
    lint {
        warningsAsErrors = true
    }
}

dependencies {

    // compose
    implementation "androidx.compose.material:material:$composeLibraryVersion"
    implementation "androidx.activity:activity-compose:1.6.0"
    implementation "com.google.accompanist:accompanist-pager:0.25.1"

    // room
    implementation "androidx.room:room-ktx:2.4.3"
    kapt "androidx.room:room-compiler:2.4.3"

    // coil
    implementation "io.coil-kt:coil-compose:2.2.2"

    // datetime
    implementation 'org.jetbrains.kotlinx:kotlinx-datetime:0.4.0'

    // ktor
    implementation 'io.ktor:ktor-client-android:2.1.2'
    implementation 'io.ktor:ktor-client-content-negotiation:2.1.2'
    implementation 'io.ktor:ktor-serialization-kotlinx-json:2.1.2'

}
