plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
}

android {

    applicationVariants.configureEach {
        outputs.all {
            if (this is com.android.build.gradle.internal.api.BaseVariantOutputImpl) {
                val appName = "好运答题王"
                val versionName = this@configureEach.versionName ?: "unknown"
                val buildType = this@configureEach.buildType.name
                val fileName = "${appName}-v${versionName}-${buildType}.apk"

                outputFileName = fileName
            }
        }
    }

    signingConfigs {
        getByName("debug") {
            storeFile = file("D:\\mg\\project_android\\dati\\app\\datiapp.jks")
            storePassword = "datiapp"
            keyAlias = "key0"
            keyPassword = "datiapp"
        }
    }

    namespace = "com.ytpm.hydtw"
    compileSdk = 35

    defaultConfig {
        applicationId = "com.ytpm.hydtw"
        minSdk = 24
        targetSdk = 35
        versionCode = 1
        versionName = "1.0.2.1"
        multiDexEnabled = true
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        resValue("string", "app_name", "好运答题王")
//        buildConfigField("String", "BASE_URL", "DDDDDD")
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }

        debug {
            signingConfig = signingConfigs.getByName("debug")
        }
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = "11"
    }
    buildFeatures {
        viewBinding = true
        aidl = true
    }

}

dependencies {

    implementation(libs.retrofit)
    implementation(libs.converter.gson)
    implementation(libs.adapter.rxjava)
    implementation(libs.glide)
    implementation(libs.androidx.immersionbar)
    implementation(libs.androidx.immersionbar.ktx)
    implementation(libs.android.material)
    implementation(libs.androidx.multidex)
    implementation(libs.wechat.sdk.android.without.mta)
    implementation(libs.utilcodex)
    implementation(libs.autosize)
    implementation(libs.androidx.appcompat)
    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.lifecycle.runtime.ktx)
    implementation(libs.gson)
    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)
    implementation("org.threeten:threetenbp:1.5.1")

    //Anythink (Necessary)
    api("com.anythink.sdk:core-taku:6.4.87")
    api("com.anythink.sdk:core-china-taku:6.4.87")
    api("com.anythink.sdk:nativead-taku:6.4.87")
    api("com.anythink.sdk:banner-taku:6.4.87")
    api("com.anythink.sdk:interstitial-taku:6.4.87")
    api("com.anythink.sdk:rewardedvideo-taku:6.4.87")
    api("com.anythink.sdk:splash-taku:6.4.87")

    //Support (Necessary)
    api("com.android.support:appcompat-v7:28.0.0")

    //Baidu
    api("com.anythink.sdk:adapter-taku-baidu:6.4.87.4")
    api("mobi.baidu.sdk:mobads:9.391.2")

    //Kuaishou
    api("com.anythink.sdk:adapter-taku-kuaishou:6.4.87")
    api("com.anythink.sdk:sdk-ads-kuaishou:3.3.76")
    api("com.android.support:design:28.0.0")

    //Csj
    api("com.anythink.sdk:adapter-taku-csj:6.4.87.5")
    api("com.pangle.cn:ads-sdk-pro:6.8.2.0")

    //GDT
    api("com.anythink.sdk:adapter-taku-gdt:6.4.87.1")
    api("com.qq.e.union:union:4.640.1510")

}