plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
    id("kotlin-kapt")
    id("org.jetbrains.kotlin.plugin.serialization")
    id("kotlin-android")
    id("com.google.gms.google-services")
    id("com.google.firebase.crashlytics")
}

android {
    namespace = "melody.offline.music"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.hi.melody.music.noise"
        minSdk = 24
        targetSdk = 34
        versionCode = 6
        versionName = "1.0.6"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

        setProperty(
            "archivesBaseName",
            "HiMelody_${defaultConfig.versionName}(${defaultConfig.versionCode})"
        )
    }

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

    buildFeatures {
        viewBinding = true
        buildConfig = true
    }
}

dependencies {
    implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar"))))
    implementation("androidx.core:core-ktx:1.13.1")
    implementation("androidx.appcompat:appcompat:1.7.0")
    implementation("com.google.android.material:material:1.11.0")
    implementation("androidx.constraintlayout:constraintlayout:2.1.4")
    implementation("androidx.media3:media3-session:1.3.1")
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0")

    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

    implementation("androidx.room:room-ktx:2.6.1")
    implementation("androidx.room:room-runtime:2.6.1")
    //noinspection KaptUsageInsteadOfKsp
    kapt("androidx.room:room-compiler:2.6.1")

    implementation("androidx.media3:media3-exoplayer:1.3.1")
    implementation("androidx.media3:media3-exoplayer-dash:1.3.1")
    implementation("androidx.media3:media3-ui:1.3.1")
    implementation("androidx.media3:media3-common:1.3.1")
    implementation("androidx.media3:media3-datasource-cronet:1.3.1")
    implementation("androidx.media3:media3-datasource-okhttp:1.3.1")

    implementation("io.coil-kt:coil-compose:2.6.0")
    implementation("io.ktor:ktor-client-core:2.3.8")
    implementation("io.ktor:ktor-client-okhttp:2.3.8")
    implementation("io.ktor:ktor-client-content-negotiation:2.3.8")
    implementation("io.ktor:ktor-client-encoding:2.3.8")
    implementation("io.ktor:ktor-client-serialization:2.1.2")
    implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.8")
    implementation("org.brotli:dec:0.1.2")

    implementation("com.github.bumptech.glide:glide:4.16.0")
    implementation("com.geyifeng.immersionbar:immersionbar:3.2.2")
    implementation("com.geyifeng.immersionbar:immersionbar-ktx:3.2.2")
    implementation("com.github.lihangleo2:ShadowLayout:3.4.0")
    implementation("com.google.android.flexbox:flexbox:3.0.0")
    implementation("io.github.scwang90:refresh-layout-kernel:2.1.0")
    implementation("io.github.scwang90:refresh-footer-ball:2.1.0")
    implementation("com.google.code.gson:gson:2.10.1")

    //fb
    implementation("com.facebook.android:facebook-android-sdk:latest.release")
    //google
    implementation("com.google.android.gms:play-services-ads-identifier:18.1.0")

    // Import the Firebase BoM
    implementation(platform("com.google.firebase:firebase-bom:33.1.0"))
    implementation("com.google.firebase:firebase-analytics-ktx")
    implementation("com.google.firebase:firebase-crashlytics-ktx")
    implementation("com.google.firebase:firebase-config")

    //google ads
    implementation("com.google.android.gms:play-services-ads:23.1.0")
    implementation("com.google.ads.mediation:adcolony:4.8.0.2")
    implementation("com.google.ads.mediation:applovin:12.5.0.0")
    implementation("com.google.ads.mediation:vungle:6.12.0.0")
    implementation("com.google.ads.mediation:facebook:6.17.0.0")
    implementation("com.google.ads.mediation:mintegral:16.7.51.0")
    implementation("com.google.ads.mediation:pangle:6.0.0.5.0")
    implementation("com.unity3d.ads:unity-ads:4.6.1")
    implementation("com.google.ads.mediation:unity:4.12.0.0")
    implementation("com.google.ads.mediation:ironsource:8.1.0.0")

    //max
//    implementation("com.applovin:applovin-sdk:12.5.0")
//    implementation("com.applovin.mediation:google-adapter:22.1.0.0")
//    implementation("com.applovin.mediation:facebook-adapter:6.11.0.5")
//    implementation("com.applovin.mediation:adcolony-adapter:4.8.0.2")
//    implementation("com.applovin.mediation:vungle-adapter:6.12.0.0")
//    implementation("com.applovin.mediation:bytedance-adapter:4.7.0.8.0")
//    implementation("com.applovin.mediation:mintegral-adapter:16.2.31.0")
//    implementation("androidx.recyclerview:recyclerview:1.3.2")//mintegral 需要
//    implementation("com.applovin.mediation:unityads-adapter:4.4.1.0")
//    implementation("com.applovin.mediation:smaato-adapter:21.8.5.0")
//    implementation("com.applovin.mediation:tapjoy-adapter:12.11.0.0")
//    implementation("com.applovin.mediation:ironsource-adapter:7.3.1.1.0")
}