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

plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
    id("com.google.firebase.crashlytics")
    id("com.google.gms.google-services")
    id("io.objectbox")
}
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android {
    namespace = "com.picture.ar.drawing"
    compileSdk = 34

    defaultConfig {
        //com.picture.ar.drawing
        applicationId = "com.picture.ar.drawing"
        minSdk = 24
        targetSdk = 34
        versionCode = 2
        versionName = "1.1"
        setProperty(
            "archivesBaseName",
            "AR Drawing_V" + versionName + "(${versionCode})_$timestamp"
        )
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            isDebuggable = true
            isMinifyEnabled = true
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }
//    kotlinOptions {
//        jvmTarget = "1.8"
//    }
    buildFeatures {
        viewBinding = true
    }
}

dependencies {

    implementation("androidx.appcompat:appcompat:1.7.0")
    implementation("com.google.android.material:material:1.12.0")
    implementation("androidx.constraintlayout:constraintlayout:2.1.4")
//    implementation("com.google.android.gms:play-services-location:21.3.0")
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

    val camerax_version = "1.1.0-beta01"
    //noinspection GradleDependency
    implementation("androidx.camera:camera-core:${camerax_version}")
    //noinspection GradleDependency
    implementation("androidx.camera:camera-camera2:${camerax_version}")
    //noinspection GradleDependency
    implementation("androidx.camera:camera-lifecycle:${camerax_version}")
    //noinspection GradleDependency
//    implementation("androidx.camera:camera-video:${camerax_version}")
    //noinspection GradleDependency
    implementation("androidx.camera:camera-view:${camerax_version}")
    //noinspection GradleDependency
    implementation("androidx.camera:camera-extensions:${camerax_version}")

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

    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.caverock:androidsvg:1.4")


    implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
    implementation("com.google.firebase:firebase-crashlytics")
    implementation("com.google.firebase:firebase-analytics")
    implementation("com.google.firebase:firebase-config")

    implementation(files("libs/TopOnLibrary_06_27_16_00-release.aar"))
    implementation(files("libs/UpLoadLibrary_06_27_16_19-release.aar"))
    //-----------------------------------------------TopOn(Mintegral、Pangle、UnitAds、Digital Turbine(Fyber)、Chartboost&Helium、Ironsource、Liftoff(Vungle)、Inmobi、Start.io、Bigo)
    //TU (Necessary)
    api ("com.thinkup.sdk:core-tpn:6.4.90")
    api ("com.thinkup.sdk:nativead-tpn:6.4.90")
    api ("com.thinkup.sdk:banner-tpn:6.4.90")
    api ("com.thinkup.sdk:interstitial-tpn:6.4.90")
    api ("com.thinkup.sdk:rewardedvideo-tpn:6.4.90")
    api ("com.thinkup.sdk:splash-tpn:6.4.90")

    //Androidx (Necessary)
    api ("androidx.appcompat:appcompat:1.6.1")
    api ("androidx.browser:browser:1.4.0")

    //StartApp
    api ("com.thinkup.sdk:adapter-tpn-startapp:6.4.90")
    api ("com.startapp:inapp-sdk:5.0.2")

    //Vungle
    api ("com.thinkup.sdk:adapter-tpn-vungle:6.4.90")
    api ("com.vungle:vungle-ads:7.5.0")
    api ("com.google.android.gms:play-services-basement:18.1.0")
    api ("com.google.android.gms:play-services-ads-identifier:18.0.1")

    //UnityAds
    api ("com.thinkup.sdk:adapter-tpn-unityads:6.4.90")
    api ("com.unity3d.ads:unity-ads:4.14.0")

    //Ironsource
    api ("com.thinkup.sdk:adapter-tpn-ironsource:6.4.90")
    api ("com.ironsource.sdk:mediationsdk:8.7.0")
    api ("com.google.android.gms:play-services-appset:16.0.2")
    api ("com.google.android.gms:play-services-ads-identifier:18.0.1")
    api ("com.google.android.gms:play-services-basement:18.1.0")

    //Bigo
    api ("com.thinkup.sdk:adapter-tpn-bigo:6.4.90")
    api ("com.bigossp:bigo-ads:5.3.0")

    //Pangle
    api ("com.thinkup.sdk:adapter-tpn-pangle:6.4.90.1")
    api ("com.pangle.global:pag-sdk:7.2.0.6")
    api ("com.google.android.gms:play-services-ads-identifier:18.2.0")

    //Inmobi
    api ("com.thinkup.sdk:adapter-tpn-inmobi:6.4.90")
    api ("com.inmobi.monetization:inmobi-ads-kotlin:10.8.2")

    //Mintegral
    api ("com.thinkup.sdk:adapter-tpn-mintegral:6.4.90")
    api ("com.mbridge.msdk.oversea:mbridge_android_sdk:16.9.71")
    api ("androidx.recyclerview:recyclerview:1.1.0")

    //Chartboost
    api ("com.thinkup.sdk:adapter-tpn-chartboost:6.4.90")
    api ("com.chartboost:chartboost-sdk:9.8.3")
    api ("com.chartboost:chartboost-mediation-sdk:4.9.2")
    api ("com.chartboost:chartboost-mediation-adapter-chartboost:4.9.8.1.0")
    api ("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
    api ("com.squareup.okhttp3:logging-interceptor:4.10.0")
    api ("com.squareup.okhttp3:okhttp:4.10.0")
    api ("com.squareup.retrofit2:converter-scalars:2.9.0")
    api ("com.squareup.retrofit2:retrofit:2.9.0")
    api ("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1")
    api ("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")

    //Fyber
    api ("com.thinkup.sdk:adapter-tpn-fyber:6.4.90")
    api ("com.fyber:marketplace-sdk:8.3.7")
    api ("com.google.android.gms:play-services-ads-identifier:18.0.1")

    //Tramini
    api ("com.thinkup.sdk:tramini-plugin-tpn:6.4.90")

    // Debugger UI Tools
    api ("com.anythink.sdk:debugger-ui:1.1.0")

    //----------------------------------------------TopOn

}