import java.text.SimpleDateFormat
import java.util.Date

plugins {
    alias(libs.plugins.android.application)
    id("com.google.gms.google-services")
    id("com.google.firebase.crashlytics")
    id("applovin-quality-service")
    alias(libs.plugins.kotlin.android)
}
applovin{
    apiKey = "z9LuVGqI3n3UbGeQdWFqDBtsNwy_Ex1ZUdA6WEmpTvrTIVrQLpf_ATE1EpembT_12xh5tX2T6DoCxSVzLeGLX5"
}
val timestamp: String = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android {
    namespace = "com.ardraw.ardrawingflow"
    compileSdk = 35

    defaultConfig {
        applicationId = "com.ardraw.ardrawingflow"
        minSdk = 23
        targetSdk = 35
        versionCode = 2
        versionName = "1.0.1"
        setProperty("archivesBaseName", "AR Drawing Flow_V " + versionName + "(${versionCode})_$timestamp")
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    buildFeatures {
        viewBinding = true
    }

    buildTypes {
        release {
            isMinifyEnabled = true
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = "11"
    }
}

dependencies {

    implementation(libs.appcompat)
    implementation(libs.material)
    implementation(libs.activity)
    implementation(libs.constraintlayout)
    implementation(libs.core.ktx)
    testImplementation(libs.junit)
    androidTestImplementation(libs.ext.junit)
    androidTestImplementation(libs.espresso.core)

    implementation("com.github.bumptech.glide:glide:4.16.0")
    annotationProcessor("com.github.bumptech.glide:compiler:4.16.0")

    implementation ("androidx.room:room-runtime:2.6.1")
    annotationProcessor ("androidx.room:room-compiler:2.6.1")

    implementation ("androidx.camera:camera-core:1.4.1")
    implementation ("androidx.camera:camera-lifecycle:1.4.1")
    implementation ("androidx.camera:camera-view:1.4.1")
    implementation ("androidx.camera:camera-extensions:1.4.1")
    implementation ("androidx.camera:camera-camera2:1.4.1")

    // 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（Liftoff Monetize（vungle）、Mintegral、Pangle、Unity Ads）
    implementation("com.applovin:applovin-sdk:+")
    implementation("com.applovin.mediation:vungle-adapter:+")
    implementation("com.applovin.mediation:mintegral-adapter:+")
    implementation("com.applovin.mediation:bytedance-adapter:+")
    implementation("com.applovin.mediation:unityads-adapter:+")
}