plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
    id("com.google.gms.google-services")
    id("com.google.firebase.crashlytics")
}

android {
    namespace = "com.base.pdfreaderallpdfreader"
    compileSdk = 34

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

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

        signingConfigs {
            create("release") {
                //E6:A2:DD:0A:E6:73:22:32:4E:98:08:78:73:29:01:C4:8D:A0:38:DB:D8:B2:DD:B9:AC:55:69:B2:6B:DF:B0:B4
                storeFile = file("../smartcl.jks")
                storePassword = "123456"
                keyAlias = "key0"
                keyPassword = "123456"
            }

        }
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
            // 设置是否要自动上传
            firebaseCrashlytics {
                mappingFileUploadEnabled = true
            }
            signingConfig = signingConfigs.getByName("release")
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }

    buildFeatures {
        viewBinding = true
        buildConfig = true
    }
}

gradle.taskGraph.whenReady {
    tasks.forEach { 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)
    implementation(libs.androidx.lifecycle.livedata.ktx)
    implementation(libs.androidx.lifecycle.viewmodel.ktx)
    implementation(libs.androidx.navigation.fragment.ktx)
    implementation(libs.androidx.navigation.ui.ktx)
    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)


    //第三方UI
    implementation("io.github.cymchad:BaseRecyclerViewAdapterHelper4:4.1.4")
    implementation("com.github.angcyo.DslTablayout:TabLayout:3.5.5")
    implementation("com.github.angcyo.DslTablayout:ViewPager2Delegate:3.5.5")
    implementation("com.airbnb.android:lottie:6.4.0")
    implementation("com.github.pokercc:ExpandableRecyclerView:0.9.3")


    //mlkit
    implementation("com.google.android.gms:play-services-mlkit-document-scanner:16.0.0-beta1")

    //Pdf库
    implementation("com.tom-roush:pdfbox-android:2.0.27.0")
    api(project(":pdflibrary"))
//

    //Word库
    //PPT库
    //Excel库
    api(project(":library"))

    //广告
    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")

    //ump
    implementation("com.google.android.ump:user-messaging-platform:3.0.0")

    //firebase
    implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
    implementation("com.google.firebase:firebase-messaging")
    implementation("com.google.firebase:firebase-analytics-ktx")
    implementation("com.google.firebase:firebase-crashlytics")
//    implementation("com.google.firebase:firebase-database-ktx")
//    implementation("com.google.firebase:firebase-config-ktx")


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

    //网络请求和解析
    implementation("com.google.code.gson:gson:2.11.0")
    // define a BOM and its version
    implementation(platform("com.squareup.okhttp3:okhttp-bom:4.12.0"))
    // define any required OkHttp artifacts without version
    implementation("com.squareup.okhttp3:okhttp")
    implementation("com.squareup.okhttp3:logging-interceptor")

    //mintegral
    implementation("com.reyun.solar.engine.oversea:solar-engine-core:1.2.8.3")
}