plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.jetbrainsKotlinAndroid)
    id 'kotlin-kapt'
    id 'com.google.dagger.hilt.android'
    id 'org.jetbrains.kotlin.plugin.serialization'
}

android {
    namespace 'com.example.modifier'
    compileSdk 34
    useLibrary 'org.apache.http.legacy'
    buildFeatures {
        buildConfig = true
        compose = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.14"
    }
    dataBinding {
        enabled = true
    }
    defaultConfig {
        applicationId "com.example.modifier"
        minSdk 31
        targetSdk 34
        versionCode 167
        versionName "1.0.1"
        archivesBaseName = "modifier-${versionCode}"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                arguments["room.schemaLocation"] =
                        "$projectDir/schemas"
            }
        }
        ndk {
            abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
        }
    }

    signingConfigs {
        release {
            storeFile file('../release.keystore')
            storePassword '123456'
            keyAlias 'key'
            keyPassword '123456'
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
        debug {
            signingConfig signingConfigs.release
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    kapt {
        correctErrorTypes = true
    }
    packagingOptions {
        jniLibs {
            useLegacyPackaging = true
        }
    }
}
configurations {
    configureEach {
        exclude module: 'httpclient'
        exclude module: 'commons-logging'
    }
}
dependencies {

    testImplementation libs.junit
    androidTestImplementation libs.ext.junit
    androidTestImplementation libs.espresso.core

    implementation libs.appcompat
    implementation libs.material
    implementation libs.activity
    implementation libs.constraintlayout
    implementation libs.navigation.fragment
    implementation libs.navigation.fragment.ktx
    implementation libs.navigation.ui
    implementation libs.annotation
    implementation libs.datastore.preferences

    implementation libs.core.ktx
    implementation libs.lifecycle.livedata.ktx
    implementation libs.lifecycle.viewmodel.ktx
    implementation libs.lifecycle.runtime.ktx
    implementation libs.coroutines.core
    implementation libs.coroutines.android

    implementation libs.gson
    implementation libs.commons.lang3
    implementation libs.commons.collections4
    implementation libs.commons.io
    implementation libs.commons.validator

    implementation(libs.socket.io.client) {
        exclude group: 'org.json', module: 'json'
    }

    implementation libs.hilt.android
    kapt libs.hilt.android.compiler

    implementation libs.kotlin.stdlib.jdk8
    implementation libs.ktor.client.core
    implementation libs.ktor.client.cio
    implementation libs.ktor.client.okhttp
    implementation libs.ktor.client.content.negotiation
    implementation libs.ktor.client.resources
    implementation libs.ktor.client.logging
    implementation libs.ktor.serialization.kotlinx.json
    implementation libs.kotlinx.serialization.json
    implementation(libs.room.runtime)
    kapt(libs.room.compiler)
    implementation(libs.room.ktx)
    implementation(libs.fragment.ktx)
    implementation libs.savedstate

    def composeBom = libs.androidx.compose.bom
    implementation composeBom
    androidTestImplementation composeBom
    implementation libs.material3
    implementation libs.ui.tooling.preview
    debugImplementation libs.ui.tooling
    implementation libs.androidx.material.icons.core
    implementation libs.androidx.material.icons.extended
    implementation libs.androidx.material3.window.size
    implementation libs.androidx.activity.compose
    implementation libs.lifecycle.viewmodel.compose
    implementation libs.androidx.runtime.livedata
    implementation(libs.navigation.compose)

    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01"
    implementation 'com.google.android.gms:play-services-code-scanner:16.1.0'
    implementation("com.github.leandroborgesferreira:loading-button-android:2.3.0")
    implementation 'com.google.code.gson:gson:2.10.1'
    implementation 'org.apache.commons:commons-lang3:3.14.0'
    implementation 'commons-io:commons-io:2.16.1'
    implementation 'org.slf4j:slf4j-android:1.7.36'

    implementation("io.coil-kt.coil3:coil-compose:3.0.2")
    implementation("io.coil-kt.coil3:coil-network-ktor2:3.0.2")

}