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

plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
    id("io.objectbox")
    kotlin("kapt")
}
// 生成时间戳（保持原有格式，但后续文件名中不包含特殊字符）
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())

android {
    namespace = "com.snap.wall"
    compileSdk = 36

    defaultConfig {
        applicationId = "com.snap.wall"
        minSdk = 24
        targetSdk = 36
        versionCode = 1
        versionName = "1.0"

        setProperty("archivesBaseName", "SnapWall_V" + versionName + "(${versionCode})_$timestamp")

        testInstrumentationRunner = "androidx.live.runner.AndroidJUnitRunner"
    }

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

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    buildFeatures {
        viewBinding = true
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

dependencies {
    implementation("com.google.code.gson:gson:2.10.1")
    implementation("com.github.bumptech.glide:glide:5.0.5")
    implementation("androidx.activity:activity:1.12.0")
    kapt("com.github.bumptech.glide:compiler:4.16.0")
    implementation("androidx.appcompat:appcompat:1.7.1")
    implementation("com.google.android.material:material:1.11.0")
    implementation("androidx.constraintlayout:constraintlayout:2.2.1")
    implementation("androidx.test:monitor:1.8.0")
    implementation("androidx.test.ext:junit:1.3.0")
    testImplementation("junit:junit:4.13.2")
    implementation("jp.wasabeef:glide-transformations:4.3.0") // Glide图片变换库
    implementation("com.squareup.okhttp3:okhttp:5.3.1")
}