plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'com.google.gms.google-services'
    id 'com.google.android.gms.oss-licenses-plugin'

    id 'kotlin-kapt'
    id 'kotlin-parcelize'
    id 'org.jlleitschuh.gradle.ktlint'

    id 'io.objectbox'
    id("com.google.firebase.crashlytics")
}

android {
    namespace 'kr.co.vividnext.sodalive'
    compileSdk 33

    viewBinding {
        enabled true
    }

    buildFeatures {
        dataBinding true
    }

    lintOptions {
        checkDependencies true
    }

    dependenciesInfo {
        // Disables dependency metadata when building APKs.
        includeInApk = false
        // Disables dependency metadata when building Android App Bundles.
        includeInBundle = false
    }

    defaultConfig {
        applicationId "kr.co.vividnext.sodalive"
        minSdk 23
        targetSdk 33
        versionCode 1
        versionName "1.0.0"
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

            buildConfigField 'String', 'BASE_URL', '"https://api.sodalive.net"'
            buildConfigField 'String', 'BOOTPAY_APP_ID', '"64c35be1d25985001dc50c87"'
            buildConfigField 'String', 'AGORA_APP_ID', '"e34e40046e9847baba3adfe2b8ffb4f6"'
            buildConfigField 'String', 'AGORA_APP_CERTIFICATE', '"15cadeea4ba94ff7b091c9a10f4bf4a6"'
        }

        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            applicationIdSuffix '.debug'

            buildConfigField 'String', 'BASE_URL', '"https://test-api.sodalive.net"'
            buildConfigField 'String', 'BOOTPAY_APP_ID', '"6242a7772701800023f68b2e"'
            buildConfigField 'String', 'AGORA_APP_ID', '"b96574e191a9430fa54c605528aa3ef7"'
            buildConfigField 'String', 'AGORA_APP_CERTIFICATE', '"ae18ade3afcf4086bd4397726eb0654c"'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_17.toString()
    }
}

dependencies {
    implementation "androidx.media:media:1.6.0"
    implementation 'androidx.core:core-ktx:1.10.1'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.9.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
    implementation 'androidx.webkit:webkit:1.7.0'

    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'

    // Logger
    implementation("com.orhanobut:logger:2.2.0") {
        exclude group: 'com.android.support', module: 'support-annotations'
    }

    // image library
    implementation "io.coil-kt:coil:1.4.0"

    // Koin DI
    implementation "io.insert-koin:koin-android:3.1.3"

    // Preference
    implementation("androidx.preference:preference-ktx:1.2.0") {
        exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
        exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
    }

    // Gson
    implementation "com.google.code.gson:gson:2.9.1"

    // Network
    implementation "com.squareup.retrofit2:retrofit:2.9.0"
    implementation "com.squareup.retrofit2:converter-gson:2.9.0"
    implementation "com.squareup.retrofit2:adapter-rxjava3:2.9.0"
    implementation "com.squareup.okhttp3:logging-interceptor:4.9.3"

    // RxJava3
    implementation "io.reactivex.rxjava3:rxjava:3.1.3"
    implementation "io.reactivex.rxjava3:rxandroid:3.0.0"
    implementation "com.jakewharton.rxbinding4:rxbinding:4.0.0"

    // permission
    implementation "io.github.ParkSangGwon:tedpermission-normal:3.3.0"

    implementation 'com.github.dhaval2404:imagepicker:2.1'
    implementation 'com.github.zhpanvip:bannerviewpager:3.5.7'

    implementation 'com.google.android.gms:play-services-oss-licenses:17.0.1'

    // Firebase
    implementation platform('com.google.firebase:firebase-bom:32.2.0')
    implementation 'com.google.firebase:firebase-dynamic-links-ktx'
    implementation 'com.google.firebase:firebase-crashlytics-ktx'
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-messaging-ktx'
    implementation 'com.google.firebase:firebase-config-ktx'

    // bootpay
    implementation "io.github.bootpay:android:4.3.4"

    // agora
    implementation "io.agora.rtc:voice-sdk:4.1.0-1"
    implementation 'io.agora.rtm:rtm-sdk:1.5.3'

    // sound visualizer
    implementation "com.gauravk.audiovisualizer:audiovisualizer:0.9.2"

    // Glide
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'

    implementation "com.michalsvec:single-row-calednar:1.0.0"
}
