plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.jetbrainsKotlinAndroid)
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
}

android {
    namespace 'com.base.datarecovery'
    compileSdk 34

    defaultConfig {
        applicationId "com.base.datarecovery"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        setProperty("archivesBaseName", "FileRecovery-v${versionName}")
    }
    signingConfigs {
        realse {
            storeFile file('../smartcl.jks')
            storePassword '123456'
            keyAlias 'key0'
            keyPassword '123456'
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.realse
            // 设置是否要自动上传
            firebaseCrashlytics {
                mappingFileUploadEnabled true
            }
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        viewBinding true
        buildConfig true
        aidl true
    }
}
gradle.taskGraph.whenReady {
    tasks.each { task ->
        if (task.name.contains("uploadCrashlyticsMappingFile")) {
            task.enabled = false
        }
    }
}

dependencies {

    implementation libs.androidx.core.ktx
    implementation libs.androidx.appcompat
    implementation libs.material
    implementation libs.androidx.activity
    implementation libs.androidx.constraintlayout
    testImplementation libs.junit
    androidTestImplementation libs.androidx.junit
    androidTestImplementation libs.androidx.espresso.core

    def lifecycle_version = "2.7.0"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"

    //第三方UI
    implementation("com.airbnb.android:lottie:6.4.0")
    implementation("com.github.bumptech.glide:glide:4.16.0")
    implementation("com.github.pokercc:ExpandableRecyclerView:0.9.3")

    //网络
    implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'

    //facebook
    implementation("com.facebook.android:facebook-android-sdk:[8,9)")

    //广告
    implementation("com.google.android.gms:play-services-ads:23.1.0")
    implementation 'com.google.ads.mediation:applovin:12.4.3.0'
    implementation 'com.google.ads.mediation:facebook:6.17.0.0'
    implementation 'com.google.ads.mediation:mintegral:16.7.21.0'
    implementation 'com.google.ads.mediation:pangle:5.9.0.4.0'

    //Google UMP
    //https://docs.tradplusad.com/docs/tradplussdk_android_doc_v6/privacy_policy/google_ump/
    implementation 'com.google.android.ump:user-messaging-platform:2.1.0'

    //firebase
    implementation platform('com.google.firebase:firebase-bom:32.3.1')
    implementation 'com.google.firebase:firebase-analytics:21.6.2'
    implementation("com.google.firebase:firebase-messaging")
}