import java.util.Date
import java.text.SimpleDateFormat
plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
    id("io.objectbox")
    id("com.google.gms.google-services")
    id("com.google.firebase.crashlytics")
    id("applovin-quality-service")
}

applovin{
    apiKey = "Ln9ZBkOoNWDdTK3a4iHGH4XW1scCVDW14WRkncTTQHC1AIOkNRUT8OUAkEQOSHFrWp5Mn3eRrrnmT3dWmw41zD"
}

val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android {
    namespace = "com.prank.sound.funnyapp"
    compileSdk = 35

    defaultConfig {
        //com.prank.sound.funnyapp
        applicationId = "com.prank.sound.funnyapp"
        minSdk = 23
        targetSdk = 35
        versionCode = 2
        versionName = "1.0.1"
        setProperty("archivesBaseName", "Prank Sound App_V" + versionName + "(${versionCode})_$timestamp")
        testInstrumentationRunner = "androidx.sounds.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary = true
        }
    }

    buildTypes {
        release {
            isMinifyEnabled = 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
    }

    packaging {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
}

dependencies {
implementation("androidx.appcompat:appcompat:1.7.1")
    implementation("com.google.android.material:material:1.12.0")
    implementation("androidx.constraintlayout:constraintlayout:2.2.1")
    implementation("androidx.legacy:legacy-support-v4:1.0.0")
    implementation("androidx.recyclerview:recyclerview:1.4.0")
    implementation ("com.github.bumptech.glide:glide:4.16.0")
    implementation ("com.airbnb.android:lottie:6.6.6")


    //获取gaid
    implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
    implementation("com.google.android.gms:play-services-appset:16.0.1")
    //开启协程
    implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")


    implementation ("com.squareup.okhttp3:okhttp:4.12.0")
    implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")

    // Import the BoM for the Firebase platform
    implementation(platform("com.google.firebase:firebase-bom:33.7.0"))

    // Add 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")
    implementation("com.google.firebase:firebase-config")

    //Max(BIGO Ads、Chartboost、DT Exchange、InMobi、ironSource、Liftoff Monetize、Mintegral、Pangle)
    dependencies {
        implementation("com.applovin:applovin-sdk:+")
        implementation("com.applovin.mediation:bigoads-adapter:+")
        implementation("com.applovin.mediation:chartboost-adapter:+")
        implementation("com.google.android.gms:play-services-base:16.1.0")
        implementation("com.applovin.mediation:fyber-adapter:+")
        implementation("com.applovin.mediation:inmobi-adapter:+")
        implementation("com.squareup.picasso:picasso:2.8")
        implementation("androidx.recyclerview:recyclerview:1.1.0")
        implementation("com.applovin.mediation:ironsource-adapter:+")
        implementation("com.applovin.mediation:vungle-adapter:+")
        implementation("com.applovin.mediation:mintegral-adapter:+")
        implementation("com.applovin.mediation:bytedance-adapter:+")
    }
}