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

android {
    namespace = "com.example.launcher"
    compileSdk {
        version = release(36) {
            minorApiLevel = 1
        }
    }
    packaging {
        resources {
            excludes += "META-INF/DEPENDENCIES"
            excludes += "META-INF/INDEX.LIST"
        }
    }

    defaultConfig {
        applicationId = "com.example.launcher"
        minSdk = 23
        targetSdk = 36
        versionCode = 1
        versionName = "1.0"

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

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


dependencies {
    implementation(libs.appcompat)
    implementation(libs.material)
    implementation(libs.activity)
    implementation(libs.constraintlayout)
    testImplementation(libs.junit)
    androidTestImplementation(libs.ext.junit)
    androidTestImplementation(libs.espresso.core)
    dependencies {
        coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
        implementation("androidx.multidex:multidex:2.0.1")

        // Core Android UI
        implementation(libs.appcompat)
        implementation(libs.material)
        implementation(libs.activity)
        implementation(libs.constraintlayout)

        // Google Sheets & Core API (The "1.x" branch fix)
        implementation("com.google.apis:google-api-services-sheets:v4-rev581-1.25.0")
        implementation("com.google.api-client:google-api-client:1.32.1")
        implementation("com.google.oauth-client:google-oauth-client:1.32.1")
        implementation("com.google.http-client:google-http-client-gson:1.42.3")
        implementation("com.google.auth:google-auth-library-oauth2-http:1.15.0")

        // JSON & Networking (Consolidated to stable versions)
        implementation("com.google.code.gson:gson:2.10.1")
        implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2")
        implementation("com.squareup.okhttp3:okhttp:4.12.0")

        // Testing
        testImplementation(libs.junit)
        androidTestImplementation(libs.ext.junit)
        androidTestImplementation(libs.espresso.core)
    }

}