plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'androidx.navigation.safeargs.kotlin'
    id 'kotlin-parcelize'
    id 'com.google.gms.google-services' // Google Services Gradle plugin
    id 'com.google.firebase.crashlytics'
}
android {
    compileSdk 34
    namespace = "live.hms.app2"

    defaultConfig {
        applicationId "live.hms.app2"
        minSdkVersion 21
        targetSdk 34
        versionCode project.findProperty('100MS_APP_VERSION_CODE') as int
        versionName project.findProperty('100MS_APP_VERSION_NAME')

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        buildConfigField "boolean", "INTERNAL", project.findProperty('INTERNAL') ? INTERNAL : "false"
        buildConfigField "String", "BUG_REPORT_EMAIL_TO", project.findProperty('BUG_REPORT_EMAIL_TO') ? BUG_REPORT_EMAIL_TO : "\"\""
        buildConfigField "String", "BUG_REPORT_EMAIL_CC", project.findProperty('BUG_REPORT_EMAIL_CC') ? BUG_REPORT_EMAIL_CC : "\"\""
        buildConfigField "String", "RTMP_INJEST_URL", project.findProperty('RTMP_INJEST_URL') ? RTMP_INJEST_URL : "\"\""
    }

    buildTypes {
        debug {
            minifyEnabled false
        }

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

            firebaseCrashlytics {
                mappingFileUploadEnabled true
            }
        }
    }

    buildFeatures {
        viewBinding = true
        buildConfig = true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.10.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

    //100ms.live prebuilt lib
    implementation "live.100ms:room-kit:$HMS_ROOM_KIT_VERSION"

    implementation "live.100ms:virtual-background:$HMS_SDK_VERSION"
    //100ms noise cancellation dep
    implementation "live.100ms:hms-noise-cancellation-android:$HMS_SDK_VERSION"

    // Navigation
    implementation "androidx.navigation:navigation-fragment-ktx:2.4.0"
    implementation "androidx.navigation:navigation-ui-ktx:2.4.0"

    // Life Cycle
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0"
    implementation "androidx.lifecycle:lifecycle-common-java8:2.4.0"
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'

    // Retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'

    // Coroutines
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0'

    // Get Permissions easily
    implementation 'pub.devrel:easypermissions:3.0.0'

    // Firebase Crashlytics
    // Import the BoM for the Firebase platform
    implementation platform('com.google.firebase:firebase-bom:26.2.0')

    // Declare the dependencies for the Crashlytics and Analytics libraries
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'

    // debugImplementation because LeakCanary should only run in debug builds.
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    testImplementation 'org.hamcrest:hamcrest:2.2'
    implementation 'com.journeyapps:zxing-android-embedded:4.3.0'

}
