plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
}

android {
    namespace = "blog.wiwi.hoops"
    compileSdk = 34

    defaultConfig {
        applicationId = "blog.wiwi.hoops"
        minSdk = 24            // Android 7.0+ 才有體面的 WebView 跟 Pointer Events
        targetSdk = 34
        versionCode = 1
        versionName = "1.0.0"
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            // 不用 proguard，這個 app 程式碼太少，混淆只會徒增 F-Droid 審核難度
            signingConfig = signingConfigs.getByName("debug")  // 自己 sign 時請改
        }
    }

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

    kotlinOptions {
        jvmTarget = "17"
    }

    // 排除一些不必要的東西，把 APK 壓到最小
    packaging {
        resources {
            excludes += setOf(
                "META-INF/*.kotlin_module",
                "META-INF/AL2.0",
                "META-INF/LGPL2.1",
                "kotlin-tooling-metadata.json"
            )
        }
    }
}

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
    implementation("androidx.activity:activity:1.9.0")
    // Splash Screen API：Android 12+ 是系統 splash，舊版會被 backport
    implementation("androidx.core:core-splashscreen:1.0.1")
}
