plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'kotlin-kapt'
    id 'dagger.hilt.android.plugin'
    id 'androidx.navigation.safeargs'
    id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
}

android {
    compileSdk 34
    defaultConfig {
        applicationId "com.marwatsoft.speedtestmaster"
        minSdk 21
        targetSdk 34
        versionCode 5
        versionName "1.2.2"
        buildConfigField "String","SERVER_API",SERVER_API
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        debug {
            buildConfigField("boolean", "DEBUGMODE", "true")
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        release {
            buildConfigField("boolean", "DEBUGMODE", "false")
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    buildFeatures {
        viewBinding true
    }
    namespace 'com.marwatsoft.speedtestmaster'
}
kapt {
    correctErrorTypes true
}
dependencies {

    implementation 'androidx.core:core-ktx:1.13.1'
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'com.google.android.material:material:1.12.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
    implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation project(path: ':speedtest')
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.2.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'

    //Firebase
    implementation platform('com.google.firebase:firebase-bom:33.1.2')
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'

    //Coroutines
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")

    //ViewModel
    def lifecycle_version = "2.8.3"
    def arch_version = "2.2.0"
    implementation "androidx.activity:activity-ktx:1.9.0"
    implementation "androidx.fragment:fragment-ktx:1.8.1"

    // ViewModel
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version")
    // LiveData
    implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version")
    implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version")
    // Annotation processor
    implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycle_version")
    // optional - helpers for implementing LifecycleOwner in a Service
    implementation("androidx.lifecycle:lifecycle-service:$lifecycle_version")
    // optional - ProcessLifecycleOwner provides a lifecycle for the whole application process
    implementation("androidx.lifecycle:lifecycle-process:$lifecycle_version")
    // optional - Test helpers for LiveData
    testImplementation("androidx.arch.core:core-testing:$arch_version")
    implementation("androidx.datastore:datastore-preferences:1.1.1")
//    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
//    implementation 'com.github.anrwatchdog:anrwatchdog:1.4.0'

    //Room database
    def roomVersion = "2.6.1"
    implementation "androidx.paging:paging-runtime:3.3.0"
    implementation("androidx.room:room-runtime:$roomVersion")
    annotationProcessor("androidx.room:room-compiler:$roomVersion")
    kapt("androidx.room:room-compiler:$roomVersion")
    implementation("androidx.room:room-paging:$roomVersion")
    // optional - Test helpers
    testImplementation("androidx.room:room-testing:$roomVersion")
    // optional - Kotlin Extensions and Coroutines support for Room
    implementation("androidx.room:room-ktx:$roomVersion")

    //Dagger Hilt
    implementation("com.google.dagger:hilt-android:$dagger_hilt")
    kapt("com.google.dagger:hilt-android-compiler:$dagger_hilt")

    implementation 'com.jakewharton.timber:timber:5.0.1'
    implementation("androidx.startup:startup-runtime:1.1.1")
    implementation("io.github.thanosfisherman.wifiutils:wifiutils:1.6.6")
    implementation 'com.github.bumptech.glide:glide:4.13.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
    implementation("io.coil-kt:coil-compose:2.1.0")
    //Location
    implementation 'com.google.android.gms:play-services-maps:19.0.0'
    implementation 'com.google.android.gms:play-services-location:21.3.0'
    implementation 'com.google.android.libraries.places:places:3.5.0'
    implementation 'com.google.android.gms:play-services-ads:23.2.0'

    //Retrofit
    def retrofit_version = "2.9.0"
    implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
    implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"

    def lottieVersion = "5.0.3"
    implementation "com.airbnb.android:lottie:$lottieVersion"
    implementation 'org.jsoup:jsoup:1.14.3'

    implementation 'com.google.maps.android:android-maps-utils:2.3.0'
    implementation 'com.dinuscxj:circleprogressbar:1.3.0'
    implementation 'com.github.farimarwat:Super-Gauge-View:1.2'
    implementation 'com.daimajia.androidanimations:library:2.4@aar'
    implementation 'com.github.farimarwat:Modern-Admob:1.2'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
    implementation project(path:':speedtest')
}