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

plugins {
    id("com.android.application")
}


fun getCurrentTime(): String {
    val dateFormat = SimpleDateFormat("yyyyMMddHHmm", Locale.getDefault())
    return dateFormat.format(Date())
}
android {
    namespace = "com.example.wkttestapp"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.example.wkttestapp"
        minSdk = 34
        versionCode = 6
        versionName = "6.1.0"
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
            applicationVariants.all {
                outputs.forEach { output ->
                    if (output is com.android.build.gradle.internal.api.ApkVariantOutputImpl) {
                        val dateFormat = SimpleDateFormat("yyyyMMddHHmmss")
                        val timestamp = dateFormat.format(Date())
                        val newApkName = "${name}-${timestamp}.apk"
                        output.outputFileName =newApkName;
                    }
                }
            }
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation("androidx.appcompat:appcompat:1.6.1")
    implementation("cn.hutool:hutool-all:5.8.3")

    implementation("com.google.android.material:material:1.9.0")
    //app-updater
    implementation ("com.github.jenly1314.AppUpdater:app-updater:1.2.0")

    implementation ("com.squareup.okhttp3:okhttp:4.12.0")
    implementation ("com.elvishew:xlog:1.11.0")
    implementation ("io.noties.markwon:core:4.6.2")

    implementation ("com.github.xuexiangjys:XUI:1.2.1")

//    app-dialog
    implementation ("com.github.jenly1314.AppUpdater:app-dialog:1.2.0")
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}


