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.paint.trace.drawing"
    compileSdk = 34

    defaultConfig {
        //com.paint.trace.drawing
        applicationId = "com.paint.trace.drawing"
        minSdk = 23
        targetSdk = 34
        versionCode = 2
        versionName = "1.0.1"
        setProperty(
            "archivesBaseName",
            "Trace Drawing_V" + versionName + "(${versionCode})_$timestamp"
        )
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            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")
    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(platform("com.google.firebase:firebase-bom:33.1.1"))
    implementation("com.google.firebase:firebase-crashlytics")
    implementation("com.google.firebase:firebase-analytics")

//-----------------------------------------------TopOn(Mintegral、Pangle、UnitAds、Digital Turbine(Fyber)、Chartboost&Helium、Ironsource、Liftoff(Vungle)、Inmobi、Start.io、Appnext、Bigo)

    //Anythink (Necessary)
    implementation("com.anythink.sdk:core-tpn:6.4.07")
    implementation("com.anythink.sdk:nativead-tpn:6.4.07")
    implementation("com.anythink.sdk:banner-tpn:6.4.07")
    implementation("com.anythink.sdk:interstitial-tpn:6.4.07")
    implementation("com.anythink.sdk:rewardedvideo-tpn:6.4.07")
    implementation("com.anythink.sdk:splash-tpn:6.4.07")

    //Androidx (Necessary)
    implementation("androidx.appcompat:appcompat:1.1.0")
    implementation("androidx.browser:browser:1.4.0")

    //StartApp
    implementation("com.anythink.sdk:adapter-tpn-startapp:6.4.07")
    implementation("com.startapp:inapp-sdk:5.0.2")

    //Appnext
    implementation("com.anythink.sdk:adapter-tpn-appnext:6.4.07")
    implementation("com.appnext.sdk:ads:2.7.1.473")
    implementation("com.appnext.sdk:banners:2.7.1.473")
    implementation("com.appnext.sdk:native-ads2:2.7.1.473")
    implementation("com.appnext.sdk:actions:2.4.6.472")
    implementation("androidx.constraintlayout:constraintlayout:2.0.4")

    //Vungle
    implementation("com.anythink.sdk:adapter-tpn-vungle:6.4.07")
    implementation("com.vungle:vungle-ads:7.4.0")
    implementation("com.google.android.gms:play-services-basement:18.1.0")
    implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")

    //UnityAds
    implementation("com.anythink.sdk:adapter-tpn-unityads:6.4.07")
    implementation("com.unity3d.ads:unity-ads:4.12.2")

    //Ironsource
    implementation("com.anythink.sdk:adapter-tpn-ironsource:6.4.07")
    implementation("com.ironsource.sdk:mediationsdk:8.2.1")
    implementation("com.google.android.gms:play-services-appset:16.0.2")
    implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
    implementation("com.google.android.gms:play-services-basement:18.1.0")

    //Bigo
    implementation("com.anythink.sdk:adapter-tpn-bigo:6.4.07")
    implementation("com.bigossp:bigo-ads:4.9.0")

    //Pangle
    implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.4.07")
    implementation("com.pangle.global:ads-sdk:6.1.0.9")
    implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")

    //Inmobi
    implementation("com.anythink.sdk:adapter-tpn-inmobi:6.4.07")
    implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.7.5")

    //Mintegral
    implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.4.07")
    implementation("com.mbridge.msdk.oversea:reward:16.8.11")
    implementation("com.mbridge.msdk.oversea:newinterstitial:16.8.11")
    implementation("com.mbridge.msdk.oversea:mbnative:16.8.11")
    implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.8.11")
    implementation("com.mbridge.msdk.oversea:mbsplash:16.8.11")
    implementation("com.mbridge.msdk.oversea:mbbanner:16.8.11")
    implementation("com.mbridge.msdk.oversea:mbbid:16.8.11")
    implementation("androidx.recyclerview:recyclerview:1.1.0")

    //Chartboost
    implementation("com.anythink.sdk:adapter-tpn-chartboost:6.4.07")
    implementation("com.chartboost:chartboost-sdk:9.7.0")
    implementation("com.chartboost:chartboost-mediation-sdk:4.9.1")
    implementation("com.chartboost:chartboost-mediation-adapter-chartboost:4.9.7.0.0")
    implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
    implementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
    implementation("com.squareup.okhttp3:okhttp:4.10.0")
    implementation("com.squareup.retrofit2:converter-scalars:2.9.0")
    implementation("com.squareup.retrofit2:retrofit:2.9.0")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")

    //Fyber
    implementation("com.anythink.sdk:adapter-tpn-fyber:6.4.07")
    implementation("com.fyber:marketplace-sdk:8.3.0")
    implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")

    // Debugger UI Tools
    //implementation ("com.anythink.sdk:debugger-ui:1.0.7")

}